Search completed in 1.64 seconds.
10036 results for "not":
Your results are loading. Please wait...
Notification.Notification() - Web APIs
note: this feature is available in web workers.
... the notification() constructor creates a new notification object instance, which represents a user notification.
... syntax var mynotification = new notification(title, options); parameters title defines a title for the notification, which is shown at the top of the notification window.
...And 20 more matches
Notification.renotify - Web APIs
note: this feature is available in web workers.
... the renotify read-only property of the notification interface specifies whether the user should be notified after a new notification replaces an old one, as specified in the renotify option of the notification() constructor.
... syntax var renotify = notification.renotify; value a boolean.
...And 3 more matches
NotificationEvent.notification - Web APIs
the notification read-only property of the notificationevent interface returns the instance of the notification that was clicked to fire the event.
... the notification provides read-only access to many properties that were set at the instantiation time of the notification such as tag and data attributes that allow you to store information for defered use in the notificationclick event.
... returns a notification object.
...And 2 more matches
NotificationEvent.NotificationEvent() - Web APIs
the notificationevent() constructor creates a new notificationevent object.
... syntax var mynotificationevent = new notificationevent(type, notificationeventinit); parameters type tbd notificationeventinit optional a dictionary object containing a notification object to be used as the notification the event is dispatched on.
... in later drafts of the specification, this parameter is not optional.
... example var n = new notification('hello'); var init = { notification: n }; var mynotificationevent = new notificationevent(type, init); specifications specification status comment notifications apithe definition of 'notificationevent() constructor' in that specification.
nsIAnnotationService
toolkit/components/places/public/nsiannotationservice.idlscriptable stores arbitrary data about a web page.
... supported for use from trusted code, such as extensions, but not from web content.
... 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/annotation-service;1".
...And 254 more matches
PopupNotifications.jsm
the popupnotifications.jsm javascript code module provides a popup notification box service.
... this service is used, for example, to display geolocation related notifications.
... to use this, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/popupnotifications.jsm"); once you've imported the module, you can then use the popupnotifications object it exports; this object provides methods for creating and displaying popup notification panels.
...And 59 more matches
Using the Notifications API - Web APIs
note: this feature is available in web workers.
... the notifications api lets a web page or app send notifications that are displayed outside the page at the system level; this lets web apps send information to a user even if the application is idle or in the background.
... typically, system notifications refer to the operating system's standard notification mechanism: think for example of how a typical desktop system or mobile device broadcasts notifications.
...And 54 more matches
Observer Notifications
unless otherwise noted you register for the topics using the nsiobserverservice.
... if your component requires access to the user profile, or any services which require access to the profile (preferences, bookmarks, and so on) then a common pattern is to register with the nsicategorymanager for the app-startup topic which can be done in the component's registration code, and then in that notification register with the observer service for the profile-after-change notification.
... see receiving startup notifications for more information about how this works.
...And 52 more matches
Using the Places annotation service
the annotation service, provided by the nsiannotationservice interface, is designed to store arbitrary data about a web page or about an item in the places database in firefox 3.
... it is usable from trusted firefox code such as extensions, but not from web pages.
... most methods in the service are duplicated with one method labeled as a 'page annotation' taking an nsiuri and the others labeled as an 'item annotation' and taking the id of an item in the places database.
...And 44 more matches
Notification - Web APIs
note: this feature is available in web workers.
... the notification interface of the notifications api is used to configure and display desktop notifications to the user.
... these notifications' appearance and specific functionality vary across platforms but generally they provide a way to asynchronously provide information to the user.
...And 41 more matches
notificationbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the notificationbox element is used to display notifications above an element.
...the notification element is used for each notification, and will be created automatically for each item.
... each notification will slide in and out as needed.
...And 32 more matches
Observer Notifications - Archive of obsolete content
for example, you might want to notify that a task is completed, and then several different actions must be performed.
... an observer is an object that is responsible to observe (wait for) notifications and then to carry out subsequent actions.
...the first parameter (subject) can be any xpcom object, the second parameter is a notification topic, and the final parameter is a string that further describes the notification.
...And 28 more matches
User Notifications and Alerts - Archive of obsolete content
« previousnext » it is often the case that extensions need to notify users about important events, often requiring some response.
... this section lists a few alternatives that give you the possibility of notifying the user and requesting action without being too annoying.
... the notificationbox element you have probably seen these before.
...And 25 more matches
New Skin Notes - Archive of obsolete content
--dria stuff that's been fixed note that while i've made these fixes, they haven't necessarily been checked in yet.
...devmo skin vs cavendish skin --callek i can probably pull-off this patch if needed (quickly), so dria or others do not have to hunt up "how".
... --callek add "what not to do" css class to stylesheet, as discussed on talk:core javascript 1.5 reference.
...And 24 more matches
JSS Provider Notes
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.
... if you build jss yourself from source instead of using binaries downloaded from mozilla.org, your jar file will not have a valid signature.
... this means you will not be able to use the jss provider for jce algorithms.
...And 24 more matches
Mozilla-JSS JCA Provider notes
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.
...if you build jss yourself from source instead of using binaries downloaded from mozilla.org, your jar file will not have a valid signature.
... this means you will not be able to use the jss provider for jce algorithms.
...And 23 more matches
Storing annotations - Archive of obsolete content
now we are able to create annotations, let's store them using the simple-storage module.
... in this chapter we will cover three topics relating to persistent storage: using simple-storage to persist objects handling exhaustion of the storage quota allocated to you respecting private browsing storing new annotations in this section we are only touching the main.js file.
... first, import the simple-storage module with a declaration like: var simplestorage = require('sdk/simple-storage'); in the module scope, initialize an array which will contain the stored annotations: if (!simplestorage.storage.annotations) simplestorage.storage.annotations = []; now we'll add a function to the module scope which deals with a new annotation.
...And 22 more matches
NSS_3.12_release_notes.html
nss 3.12 release notes 17 june 2008 newsgroup: mozilla.dev.tech.crypto contents introduction distribution information new in nss 3.12 bugs fixed documentation compatibility feedback introduction network security services (nss) 3.12 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 camellia cipher support tls session ticket extension (rfc 5077) nss 3.12 is tri-licensed under the mpl 1.1/gpl 2.0/lgpl 2.1.
... note: firefox 3 uses nss 3.12, but not the new sqlite-based shareable certificate and key databases.
...er nss libraries: 3.12.0.3 new in nss 3.12 3 new shared library are shipped with nss 3.12: nssutil sqlite nssdbm 1 new include file is shipped with nss3.12: utilrename.h new functions in the nss shared library: cert_checknamespace (see cert.h) cert_encodecertpoliciesextension (see cert.h) cert_encodeinfoaccessextension (see cert.h) cert_encodeinhibitanyextension (see cert.h) cert_encodenoticereference (see cert.h) cert_encodepolicyconstraintsextension (see cert.h) cert_encodepolicymappingextension (see cert.h) cert_encodesubjectkeyid (see certdb/cert.h) cert_encodeusernotice (see cert.h) cert_findcrlentryreasonexten (see cert.h) cert_findcrlnumberexten (see cert.h) cert_findnameconstraintsexten (see cert.h) cert_getclassicocspdisabledpolicy (see cert.h) cert_getclassicocspenabledha...
...And 22 more matches
nss tech note5
using nss to perform miscellaneous cryptographic operations nss technical note: 5 nss project info is at http://www.mozilla.org/projects/security/pki/nss/ you can browse the nss source online at http://lxr.mozilla.org/mozilla/source/security/nss/ and http://lxr.mozilla.org/security/ be sure to look for sample code first for things you need to do.
... note: this document contains code snippets that focus on essential aspects of the task and often do not illustrate all the cleanup that needs to be done.
... also, this document does not attempt to be an exhaustive survey of all possible ways to do a certain task; it merely tries to show a certain way.
...And 22 more matches
ServiceWorkerRegistration.showNotification() - Web APIs
the shownotification() method of the serviceworkerregistration interface creates a notification on an active service worker.
... note: this feature is available in web workers.
... syntax ​serviceworkerregistration.shownotification(title, [options]); parameters title the title that must be shown within the notification options optional an object that allows configuring the notification.
...And 22 more matches
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
but instead of relying only on user actions, we can do more, using push messages and notifications to automatically re-engage and deliver new content whenever it is available.
... two apis, one goal the push api and notifications api are two separate apis, but they work well together when you want to provide engaging functionality in your app.
...notifications can be used by the service worker to show new information to the user, or at least alert them when something has been updated.
...And 22 more matches
ARIA annotations - Accessibility
wai-aria version 1.3 sees the addition of a set of new features, collectively known as aria annotations, which allow the creation of accessible annotations inside web documents.
... below we'll introduce the new features associated with aria annotations, and have a look at some code examples that show them in action.
... note: you can find all the examples discussed in this article in a demo file at aria-annotations.
...And 21 more matches
Web Push API Notifications best practices - Web APIs
this article provides a useful summary of best practices to keep in mind when developing web sites and applications that use push notifications for user engagement.
... “if done well, it's nice to have, but if not done well, it's really annoying.” — overheard conversation between two browser developers discussing the ethics of push notifications.
... overview of web push notifications web push notifications (created using a combination of the notifications, push, and service worker apis) are part of the rising noise that product developers and marketers are using to get attention for their sites.
...And 20 more matches
Creating annotations - Archive of obsolete content
we'll use two objects to create annotations: a page-mod to find page elements that the user can annotate, and a panel for the user to enter the annotation text itself.
... its main job is to maintain a matched element: this is the page element that is the current candidate for an annotation.
...it is initially off: var matchedelement = null; var originalbgcolor = null; var active = false; function resetmatchedelement() { if (matchedelement) { (matchedelement).css('background-color', originalbgcolor); (matchedelement).unbind('click.annotator'); } } self.on('message', function onmessage(activation) { active = activation; if (!active) { resetmatchedelement(); } }); this selector listens for occurrences of the jquery mouseenter event.
...And 19 more matches
nss tech note1
how to use the nss asn.1 and quickder decoders nss technical note: 1 nss 3.6 contains several decoders for asn.1 and der.two of them are extensively used and are part of the public nss api : the "classic" asn.1 decoder, written by lisa repka .
...it can only decode der .† it does not handle streaming input, and requires that all input be present before beginning to decode.
...the syntax of these templates is identical for both decoders, except where noted.
...And 18 more matches
appendNotification - Archive of obsolete content
« xul reference home appendnotification( label , value , image , priority , buttons, eventcallback ) return type: element create a new notification and display it.
... if another notification is already present with a higher priority, the new notification will be added behind it.
... label - label to appear on the notification.
...And 17 more matches
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.
...And 17 more matches
Notifications API - Web APIs
note: this feature is available in web workers.
... the notifications api allows web pages to control the display of system notifications to the end user.
...the api is designed to be compatible with existing notification systems, across different platforms.
...And 15 more matches
Release notes - Archive of obsolete content
this will not include any uplifts made after this release entered aurora.
...this will not include any uplifts made after this release entered aurora.
...this will not include any uplifts made after this release entered aurora.
...And 13 more matches
Displaying annotations - Archive of obsolete content
in this chapter we'll use a page-mod to locate elements of web pages that have annotations associated with them, and a panel to display the annotations.
... matcher page-mod matcher content script the content script for the matcher page-mod is initialized with a list of all the annotations that the user has created.
... when a page is loaded the matcher searches the dom for elements that match annotations.
...And 13 more matches
notification - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the notification is used to display an informative message.
... it will normally be used as part of a notificationbox.
... attributes image, label, priority, persistence, type, value properties accessibletype, control, image, label, priority, persistence, type, value methods close examples <notification label="this is a warning"/> attributes image type: uri the uri of the image to appear on the element.
...And 13 more matches
:not() - CSS: Cascading Style Sheets
WebCSS:not
the :not() css pseudo-class represents elements that do not match a list of selectors.
... /* selects any element that is not a paragraph */ :not(p) { 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.
...And 13 more matches
What to do and what not to do in Bugzilla
it explains what should and what should not be done in bugzilla.mozilla.org.
... the conditions for not resolving a bug always overrule the conditions for resolving a bug.
... you should not resolve a bug as wfm if: the bug reporter uses a different hardware/operating system (e.g.
...And 12 more matches
NSS 3.35 release notes
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.
...note that debug builds will use a lower count, for better performance in test environments.
...And 12 more matches
Using popup notifications
popup notifications, also known as "doorhanger notifications", are presented to notify the user of something that's important but may not need immediate attention.
... these non-modal notifications let the user make decisions when they have a moment to do so, instead of being forced to deal with them at possibly inconvenient times.
... for example, this popup notification is displayed when a web site requests geolocation information: this lets the user decide whether or not to share their location when it's convenient to do so, instead of being compelled to do it at once.
...And 12 more matches
NPN_GetURLNotify - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary requests creation of a new stream with the contents of the specified url; gets notification of the result.
... syntax #include <npapi.h> nperror npn_geturlnotify(npp instance, const char* url, const char* target, void* notifydata); parameters the function has the following parameters: instance pointer to the current plug-in instance.
... notifydata plug-in-private value for associating the request with the subsequent npp_urlnotify() call, which passes this value (see description below).
...And 11 more matches
Notification.requestPermission() - Web APIs
note: this feature is available in web workers.
... note: this feature is not available in sharedworker note: safari still uses the callback syntax to get the permission.
... read using the notifications api for a good example of how to feature detect this and run code as appropriate.
...And 10 more matches
NotificationEvent - Web APIs
the parameter passed into the onnotificationclick handler, the notificationevent interface represents a notification click event that is dispatched on the serviceworkerglobalscope of a serviceworker.
... constructor notificationevent() creates a new notificationevent object.
... notificationevent.notification read only returns a notification object representing the notification that was clicked to fire the event.
...And 10 more matches
NotificationAction - Web APIs
note: this feature is available in web workers.
... the notificationaction interface of the notifications api is used to represent action buttons the user can click to interact with notifications.
... these buttons' appearance and specific functionality vary across platforms but generally they provide a way to asynchronously show actions to the user in a notification.
...And 8 more matches
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.
...see displaying notifications for an example.
... the support for this property as been dropped in favor of the standard notification constructor.
...And 7 more matches
Example Sticky Notes - Archive of obsolete content
notes.html all parts are made and commented by vk [schools_ring@yahoo.com].
... view this example <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html401/strict.dtd"> <html> <head> <title>xbl demo : sticky notes</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <style type="text/css"> body { background-color: #ffffff; color: #000000; font: 1em verdana, sans-serif; } h1 { font-size: 1.5em; } /* binding: */ .sticker { -moz-binding: url(notes.xml#default); } </style> </head> <body> <h1><a href="http://developer.mozilla.org/en/docs/xbl:xbl_1.0_reference">xbl</a> demo : sticky notes</h1> <div class="sticker"><p>acme,&nbsp;inc.
... the eggs!</p></div> <div class="sticker"><p>the new project - who's on charge?</p></div> <div class="sticker"><p>learn more about xbl.</p></div> <p style="clear: left"><a href="http://validator.w3.org/check?uri=referer"><img src="https://udn.realityripple.com/samples/e2/dd625ef1cd.png" width="88" height="31" alt="valid html 4.01" style="border: 1px none"></a></p> </body> </html> notes.xml <?xml version="1.0"?> <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/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.
...And 7 more matches
NSS 3.12.4 release notes
this is not a hard requirement.
...these forms cannot be combined, e.g [a-gp-z] does not work.
... exclusions: as a top level, outter-most expression only, the expression foo~bar will match the expression foo, provided it does not also match the expression bar.
...And 7 more matches
Notification.close() - Web APIs
note: this feature is available in web workers.
... the close() method of the notification interface is used to close/remove a previously displayed notification.
... note: this api shouldn't be used just to have the notification removed from the screen after a fixed delay since this method will also remove the notification from any notification tray, preventing users from interacting with it after it was initially shown.
...And 7 more matches
TypeError: 'x' is not iterable - JavaScript
the javascript exception "is not iterable" occurs when the value which is given as the right hand-side of for…of or as argument of a function such as promise.all or typedarray.from, is not an iterable object.
... message typeerror: 'x' is not iterable (firefox, chrome) typeerror: 'x' is not a function or its return value is not iterable (chrome) error type typeerror what went wrong?
... the value which is given as the right hand-side of for…of or as argument of a function such as promise.all or typedarray.from, is not an iterable object.
...And 7 more matches
NPN_PostURLNotify - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary posts data to a url, and receives notification of the result.
... syntax #include <npapi.h> nperror npn_posturlnotify(npp instance, const char* url, const char* target, uint32 len, const char* buf, npbool file, void* notifydata); parameters the function has the following parameters: instance current plug-in instance, specified by the plug-in.
... notifydata plug-in-private value for associating the request with the subsequent npp_urlnotify call, which returns this value (see description below).
...And 6 more matches
Displaying notifications (deprecated) - Archive of obsolete content
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 by using the navigator.moznotification object's createnotification() method, as follows: var notification = navigator.moznotification.createnotification( "hey, check this out!", "this is a notification posted by " + "firefox 4.
...And 6 more matches
Notes on TLS - SSL 3.0 Intolerant Servers
problem a number of netscape 6.x/7.x and mozilla users have reported that some secure sites -- typically sites featuring online transactions or online banking over the https protocol -- do not display any content at all.
... netscape 6.x/7.x and mozilla browsers (0.9.1 and later versions) correctly implement the tls specification, and the users cannot utilize sites which have this problem.
...tls is now available and used, and products that have implemented the roll-back detection incorrectly are not interoperable with tls/ssl spec-compliant clients.
...And 6 more matches
Receiving startup notifications
sometimes it's necessary for xpcom components to receive notifications as to the progress of the application's startup process, so they can start new services at appropriate times, for example.
... receiving startup notifications in gecko 2.0 (firefox 4) and later in order to improve startup times, changes were made to the xpcom startup process.
...the important thing to note is that now instead of registering with the category manager programmatically as was done in the past, you add lines to your chrome.manifest to let the application handle it for you.
...And 6 more matches
Notification.permission - Web APIs
note: this feature is available in web workers.
... the permission read-only property of the notification interface indicates the current permission granted by the user for the current origin to display web notifications.
... syntax var permission = notification.permission; value a domstring representing the current permission.
...And 6 more matches
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.
...And 6 more matches
Atomics.notify() - JavaScript
the static atomics.notify() method notifies up some agents that are sleeping in the wait queue.
... note: this operation works with a shared int32array only.
... syntax atomics.notify(typedarray, index, count) parameters typedarray a shared int32array.
...And 6 more matches
NPP_URLNotify - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary notifies the plug-in instance of the completion of a url request.
... syntax #include <npapi.h> void npp_urlnotify(npp instance, const char* url, npreason reason, void* notifydata); parameters the function has the following parameters: instance pointer to the current plug-in instance.
... url url of the npn_geturlnotify() or npn_posturlnotify() request that has completed.
...And 5 more matches
nsITextInputProcessorNotification
dom/interfaces/base/nsitextinputprocessorcallback.idlscriptable this interface of a request or notification to ime 1.0 66 introduced gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) this interface tells details of a request or notification to ime.
... when gecko supports new notification to ime, this interface may have some new attributes.
... attributes attribute type description type acstring the type of request or notification to ime.
...And 5 more matches
ServiceWorkerRegistration.getNotifications() - Web APIs
the getnotifications() method of the serviceworkerregistration interface returns a list of the notifications in the order that they were created from the current origin via the current service worker registration.
...notifications created by one service worker on the same origin will not be available to other active services workers on that same origin.
... syntax s​erviceworkerregistration.getnotifications(options) .then(function(notificationslist) { ...
...And 5 more matches
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
WebHTMLElementu
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 annotation.
... see the usage notes section for further details on when it's appropriate to use <u> and when it isn't.
... usage notes along with other pure styling elements, the original html underline (<u>) element was deprecated in html 4; however, <u> was restored in html 5 with a new, semantic, meaning: to mark text as having some form of non-textual annotation applied.
...And 5 more matches
TypeError: "x" is not a function - JavaScript
the javascript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value is not actually a function.
... message typeerror: object doesn't support property or method {x} (edge) typeerror: "x" is not a function error type typeerror what went wrong?
... it attempted to call a value from a function, but the value is not actually a function.
...And 5 more matches
PR_Notify
notifies a monitor that a change in state of the monitored data has occurred.
... syntax #include <prmon.h> prstatus pr_notify(prmonitor *mon); parameters the function has the following parameter: mon a reference to an existing structure of type prmonitor.
... description notification of a monitor signals the change of state of some monitored data.
...And 4 more matches
PR_NotifyCondVar
notifies a condition variable of a change in its associated monitored data.
... syntax #include <prcvar.h> prstatus pr_notifycondvar(prcondvar *cvar); parameter pr_notifycondvar has one parameter: cvar the condition variable to notify.
... if unsuccessful (for example, if the caller has not locked the lock associated with the condition variable), pr_failure.
...And 4 more matches
nss tech note6
nss .chk files for the fips 140 mode nss technical note: 6 in nss 3.8, we added checksum files required for the nss softoken to operate in fips 140 mode.
... the following applies to nss 3.8 through 3.10 : on 32-bit solaris sparc (i.e., not x86, and not 64-bit sparc) and 32-bit hp-ux pa-risc (i.e., not itanium, and not 64-bit pa-risc), there are two more .chk files: libfreebl_pure32_3.chk and libfreebl_hybrid_3.chk.
...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 .
...And 4 more matches
Notation - Web APIs
WebAPINotation
represents a dtd notation (read-only).
...its nodename is the notation name.
... properties notation.publicid read only is a domstring.
...And 4 more matches
Notification.actions - Web APIs
note: this feature is available in web workers.
... the actions read-only property of the notification interface returns the list of notificationaction objects set using the actions option when creating the notification using the notification() constructor.
... this is a list of the application-defined actions the user can choose to take immediately within the context of a notification.
...And 4 more matches
Notification.silent - Web APIs
note: this feature is available in web workers.
... the silent read-only property of the notification interface specifies whether the notification should be silent, i.e., no sounds or vibrations should be issued, regardless of the device settings.
... this is specified in the silent option of the notification() constructor.
...And 4 more matches
Notification.tag - Web APIs
WebAPINotificationtag
note: this feature is available in web workers.
... the tag read-only property of the notification interface signifies an identifying tag for the notification, as specified in the tag option of the notification() constructor.
... the idea of notification tags is that more than one notification can share the same tag, linking them together.
...And 4 more matches
onnotificationclose - Web APIs
the serviceworkerglobalscope.onnotificationclose property is an event handler called whenever the notificationclose event is dispatched on the serviceworkerglobalscope object, that is when a user closes a displayed notification spawned by serviceworkerregistration.shownotification().
... notifications created on the main thread or in workers which aren't service workers using the notification() constructor will instead receive a close event on the notification object itself.
... note: trying to create a notification inside the serviceworkerglobalscope using the notification() constructor will throw an error.
...And 4 more matches
Warning: 08/09 is not a legal ECMA-262 octal constant - JavaScript
the javascript warning "08 (or 09) is not a legal ecma-262 octal constant" occurs when 08 or 09 number literals are used.
... message warning: syntaxerror: 08 is not a legal ecma-262 octal constant.
... warning: syntaxerror: 09 is not a legal ecma-262 octal constant.
...And 4 more matches
Logical NOT (!) - JavaScript
the logical not (!) operator (logical complement, negation) takes truth to falsity and vice versa.
...operator can be used with operands that are not boolean values, it can still be considered a boolean operator since its return value can always be converted to a boolean primitive.
... to explicitly convert its return value (or any expression in general) to the corresponding boolean value, use a double not operator or the boolean constructor.
...And 4 more matches
notifications - Archive of obsolete content
usage this api supports desktop notifications on windows, os x using growl (and notification center as of os x 10.9 mavericks), and linux using libnotify.
... 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.
... var notifications = require("sdk/notifications"); var self = require("sdk/self"); var myiconurl = self.data.url("myicon.png"); notifications.notify({ text: "i have an icon!", iconurl: myiconurl }); from firefox 34, you can use "./myicon.png" as an alias for self.data.url("myicon.png").
...And 3 more matches
4.3.1 Release Notes
this will cause programs that attempt to perform renegotiation to experience failures where they formerly experienced successes, and is necessary for them to not be vulnerable, until such time as a new safe renegotiation scheme is standardized by the ietf.
...(default) sslsocket.ssl_renegotiate_unrestricted - renegotiate without restriction, whether or not the peer's client hello bears the renegotiation info extension (like we always did in the past).
... sslsocket.ssl_renegotiate_requires_xtn - not yet implemented explicitly set the key usage for the generated private key in pkcs #11, each keypair can be marked with the operations it will be used to perform.
...And 3 more matches
NSS_3.11.10_release_notes.html
nss 3.11.10 release notes 2008-12-10 newsgroup: <ahref="news: mozilla.dev.tech.crypto"="" news.mozilla.org="">mozilla.dev.tech.crypto</ahref="news:> contents introduction distribution information bugs fixed documentation compatibility feedback introduction network security services (nss) 3.11.10 is a patch release for nss 3.11.
... bug 291384: certutil -k behavior doesn't match usage bug 374247: modutil -disable command not disabling modules' slots bug 384459: certification path validation fails when authority key identifier extension contains key identifier bug 385946: can't import certificate into cert database in fips mode (certutil).
... bug 387892: add entrust root ca certificate(s) to nss bug 396999: pk11_authenticate bug 397478: lock from ssl_initsymwrapkeyslock not freed on selfserv shutdown.
...And 3 more matches
NSS 3.12.6 release notes
nss 3.12.6 release notes 2010-03-03 newsgroup: mozilla.dev.tech.crypto introduction network security services (nss) 3.12.6 is a patch release for nss 3.12.
...if true, a connection will be dropped at initial handshake if the peer server or client does not support safe renegotiation.
... 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) tls server name indication for servers tls server name indication (sni) for servers is almost fully implemented in nss 3.12.6.
...And 3 more matches
NSS 3.24 release notes
in fips mode, you may move from level 1 to level 2 (by setting an appropriate password), but not the reverse.
...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.
...although these certificates can be configured, they will not be used by nss in this version.
...And 3 more matches
nss tech note3
all about certificate extensions nss technical note: 3 09 may 2002 nelson b.
... each of the above seccertusages translates into a required set of cert type and key usage for the certificate itself, and into another set of required cert type and key usage for all the ca certs in the cert chain.
... sslserver: cert_sign; ssl_ca; sslca: cert_sign; ssl_ca; emailsigner: cert_sign; email_ca or ssl_ca emailrecipient: cert_sign; email_ca or ssl_ca objectsigner: cert_sign; object_signing_ca; usageanyca: cert_sign; object_signing_ca or email_ca or ssl_ca; statusresponder: cert_sign; object_signing_ca or email_ca or ssl_ca; note: when the required key usage is key_agreement or key_encipherment, the actual key usage required depends on the key's algorithm.
...And 3 more matches
NSS_3.12.3_release_notes.html
nss 3.12.3 release notes 2009-04-01 newsgroup: mozilla.dev.tech.crypto contents introduction distribution information new in nss 3.12.3 bugs fixed documentation compatibility feedback introduction network security services (nss) 3.12.3 is a patch release for nss 3.12.
... bug 426413: audit messages need distinct types bug 438870: free freebl hashing code of dependencies on nspr and libutil bug 439115: db merge allows nickname conflicts in merged db bug 439199: sse2 instructions for bignum are not implemented on windows 32-bit bug 441321: tolerate incorrect encoding of dsa signatures in ssl 3.0 handshakes bug 444404: libpkix reports unknown issuer for nearly all certificate errors bug 452391: certutil -k incorrectly reports ec private key as an orphan bug 453234: support for seed cipher suites to tls rfc4010 bug 453364: improve pk11_cipherop error reporting (was: pk11_createconte...
...xtbysymkey returns null bug 456406: slot list leaks in symkeyutil bug 461085: rfe: export function cert_comparecerts bug 462293: crash on fork after softoken is dlclose'd on some unix platforms in nss 3.12 bug 463342: move some headers to freebl/softoken bug 463452: sql db creation does not set files protections to 0600 bug 463678: need to add rpath to 64-bit libraries on hp-ux bug 464088: option to build nss without dbm (handy for wince) bug 464223: certutil didn't accept certificate request to sign.
...And 3 more matches
Notification.data - Web APIs
WebAPINotificationdata
note: this feature is available in web workers.
... the data read-only property of the notification interface returns a structured clone of the notification's data, as specified in the data option of the notification() constructor.
... the notification's data can be any arbitrary data that you want associated with the notification.
...And 3 more matches
Notification.dir - Web APIs
WebAPINotificationdir
note: this feature is available in web workers.
... the dir read-only property of the notification interface indicates the text direction of the notification, as specified in the dir option of the notification() constructor.
... syntax var direction = notification.dir; value a domstring specifying the text direction.
...And 3 more matches
Notification.onclick - Web APIs
note: this feature is available in web workers.
... the onclick property of the notification interface specifies an event listener to receive click events.
... these events occur when the user clicks on a displayed notification.
...And 3 more matches
Notification.timestamp - Web APIs
note: this feature is available in web workers.
... the timestamp read-only property of the notification interface returns a domtimestamp, as specified in the timestamp option of the notification() constructor.
... the notification's timestamp can represent the time, in milliseconds since 00:00:00 utc on 1 january 1970, of the event for which the notification was created, or it can be an arbitrary timestamp that you want associated with the notification.
...And 3 more matches
Notification.vibrate - Web APIs
note: this feature is available in web workers.
... the vibrate read-only property of the notification interface specifies a a vibration pattern for the device's vibration hardware to emit when the notification fires.
... this is specified in the vibrate option of the notification() constructor.
...And 3 more matches
ServiceWorkerGlobalScope.onnotificationclick - Web APIs
the serviceworkerglobalscope.onnotificationclick property is an event handler called whenever the notificationclick event is dispatched on the serviceworkerglobalscope object, that is when a user clicks on a displayed notification spawned by serviceworkerregistration.shownotification().
... notifications created on the main thread or in workers which aren't service workers using the notification() constructor will instead receive a click event on the notification object itself.
... note: trying to create a notification inside the serviceworkerglobalscope using the notification() constructor will throw an error.
...And 3 more matches
501 Not Implemented - HTTP
WebHTTPStatus501
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.
... 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.
...And 3 more matches
TypeError: "x" is not a non-null object - JavaScript
the javascript exception "is not a non-null object" occurs when an object is expected somewhere and wasn't provided.
... null is not an object and won't work.
... message typeerror: invalid descriptor for property {x} (edge) typeerror: "x" is not a non-null object (firefox) typeerror: property description must be an object: "x" (chrome) typeerror: invalid value used in weak set (chrome) error type typeerror what went wrong?
...And 3 more matches
Annotator - Archive of obsolete content
the add-on is an annotator: it enables the user to select elements of web pages and enter notes (annotations) associated with them.
... the annotator stores the notes.
... whenever the user loads a page containing annotated elements these elements are highlighted, and if the user moves the mouse over an annotated element its annotation is displayed.
...And 2 more matches
Notes on HTML Reflow - Archive of obsolete content
elements later "in the flow" typically do not affect the geometry of elements that are earlier "in the flow", so layout can proceed left-to-right, top-to-bottom through the document.
... there are exceptions to this rule: most notably, html tables may require more than one pass.
...for example, a <div> with a constrained width (e.g., set via the css width property) would note this in the reflow state object before flowing its children.
...And 2 more matches
Notifications - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
... the notification box appears at the bottom right corner of the browser and displays important information to the user.
... the namespace for this class is jetpack.notifications.
...And 2 more matches
Object.getNotifier() - Archive of obsolete content
the object.getnotifer() method was used to create an object that allows to synthetically trigger a change, but has been deprecated and removed in browsers.
... syntax object.getnotifier(obj) parameters obj the object to retrieve the notifier of.
... return value the notifier object associated with the object being passed to the function.
...And 2 more matches
NSS_3.12.2_release_notes.html
nss 3.12.2 release notes 2008-10-20 newsgroup: mozilla.dev.tech.crypto contents introduction distribution information new in nss 3.12.2 bugs fixed documentation compatibility feedback introduction network security services (nss) 3.12.2 is a patch release for nss 3.12.
... 200704: pkcs11: invalid session handle 0 bug 205434: fully implement new libpkix cert verification api from bug 294531 bug 302670: use the installed libz.so where available bug 305693: shlibsign generates pqg for every run bug 311483: exposing includecertchain as a parameter to sec_pkcs12addcertandkey bug 390527: get rid of pkixerrormsg variable in pkix_error bug 391560: libpkix does not consistently return pkix_validatenode tree that truly represent failure reasons bug 408260: certutil usage doesn't give enough information about trust arguments bug 412311: replace pr_interval_no_wait with pr_interval_no_timeout in client initialization calls bug 423839: add multiple pkcs#11 token password command line option to nss tools.
... bug 432260: [[@ pkix_pl_httpdefaultclient_hdrcheckcomplete - pkix_pl_memcpy] crashes when there is no content-length header in the http response bug 436599: pkix: aia extension is not used in some bridge ca / known certs configuration bug 437804: certutil -r for cert renewal should derive the subject from the cert if none is specified.
...And 2 more matches
NSS 3.12.5 release_notes
nss 3.12.5 release notes 2009-12-02 newsgroup: mozilla.dev.tech.crypto introduction network security services (nss) 3.12.5 is a patch release for nss 3.12.
...this will cause programs that attempt to perform renegotiation to experience failures where they formerly experienced successes, and is necessary for them to not be vulnerable, until such time as a new safe renegotiation scheme is standardized by the ietf.
... ssl_renegotiate_unrestricted: renegotiate without restriction, whether or not the peer's client hello bears the renegotiation info extension (as we always did in the past).
...And 2 more matches
NSS 3.14.1 release notes
note that this code is used primarily for purposes of testing.
... new functions in ocspt.h cert_createocspsingleresponsegood cert_createocspsingleresponseunknown cert_createocspsingleresponserevoked cert_createencodedocspsuccessresponse cert_createencodedocsperrorresponse new types in ocspt.h ​certocspresponderidtype notable changes in nss 3.14.1 windows ce support has been removed from the code base.
... bug 802429 - in previous versions of nss, the "cipherorder" slot configuration flag was not respected, causing the most recently added slot that supported the requested pkcs#11 mechanism to be used instead.
...And 2 more matches
NSS 3.28 release notes
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.
... request to test and prepare for tls 1.3 this release contains improved support for tls 1.3, however, the code that supports tls 1.3 is still disabled by default (not built).
...And 2 more matches
NSS 3.52 release notes
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.
... bug 1630458 - fix problem of gyp msvc builds not producing debug symbol files.
...And 2 more matches
Release notes for recent versions of NSS
(nss 3.56 release notes) the current esr releases of nss are 3.44.4 (nss 3.44.4 release notes), intended for firefox esr 68, which was released on 19 may 2020, and 3.53.1 (nss 3.53.1 release notes), intended for firefox esr 78, which was released on 16 june 2020.
... past releases nss 3.56 release notes nss 3.55 release notes nss 3.54 release notes nss 3.53.1 release notes nss 3.53 release notes nss 3.52.1 release notes nss 3.44.4 release notes nss 3.52 release notes nss 3.51.1 release notes nss 3.51 release notes nss 3.50 release notes nss 3.49.2 release notes nss 3.49.1 release notes nss 3.49 release notes nss 3.48.1 release notes nss 3.48 release notes nss 3.47.1 release notes nss 3.47 release notes nss 3.46.1 release notes nss 3.46 release notes nss 3.45 release notes nss 3.44.3 release notes nss 3.44.2 release notes nss 3.44.1 release notes nss 3.44 release notes nss 3.43 release notes nss 3.42.1 release notes nss 3.42 release notes nss 3.36.8 release notes nss 3.36.7 release notes nss 3.41 release notes nss 3.40.1...
... release notes nss 3.36.6 release notes nss 3.40 release notes nss 3.39 release notes nss 3.38 release notes nss 3.37.3 release notes nss 3.37.1 release notes nss 3.37 release notes nss 3.36.5 release notes nss 3.36.4 release notes nss 3.36.2 release notes nss 3.36.1 release notes nss 3.36 release notes nss 3.35 release notes nss 3.34.1 release notes nss 3.34 release notes nss 3.33 release notes nss 3.32 release notes nss 3.31.1 release notes nss 3.31 release notes nss 3.30.2 release notes nss 3.30.1 release notes nss 3.30 release notes nss 3.29.5 release notes nss 3.29.3 release notes nss 3.29.2 release notes nss 3.29.1 release notes nss 3.29 release notes nss 3.28.5 release notes nss 3.28.4 release notes nss 3.28.3 release notes nss 3.28.2 release notes nss 3...
...And 2 more matches
nss tech note8
background information on libssl's cache functions and sids nss technical note: 8 27 february 2006 nelson b.
... a sid (or sslsessionid struct) contains all the info needed to restart the ssl session at a later time on another socket.
...as originally designed, before calling the cache function, the caller was responsible to fill in the session creation time (which might not be the same as the time of insertion into the cache) and the session expiration time, among other things.
...And 2 more matches
Notification.icon - Web APIs
WebAPINotificationicon
note: this feature is available in web workers.
... the icon read-only property of the notification interface contains the url of an icon to be displayed as part of the notification, as specified in the icon option of the notification() constructor.
... syntax var icon = notification.icon; value a usvstring.
...And 2 more matches
Notification.lang - Web APIs
WebAPINotificationlang
note: this feature is available in web workers.
... the lang read-only property of the notification interface indicates the language used in the notification, as specified in the lang option of the notification() constructor.
... syntax var language = notification.lang; value a domstring specifying the language tag.
...And 2 more matches
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.
...And 2 more matches
Notification.requireInteraction - Web APIs
note: this feature is available in web workers.
... the requireinteraction read-only property of the notification interface returns a boolean indicating that a notification should remain active until the user clicks or dismisses it, rather than closing automatically.
... note: this can be set when the notification is first created by setting the requireinteraction option to true in the options object of the notification.notification() constructor.
...And 2 more matches
404 Not Found - HTTP
WebHTTPStatus404
the http 404 not found client error response code indicates that the server can't find the requested resource.
... a 404 status code does not indicate whether the resource is temporarily or permanently missing.
... status 404 not found custom error pages many web sites customize the look of a 404 page to be more helpful to the user and provide guidance on what to do next.
...And 2 more matches
TypeError: can't assign to property "x" on "y": not an object - JavaScript
primitive values cannot hold any property.
... message typeerror: can't assign to property "x" on {y}: not an object (firefox) typeerror: cannot create property 'x' on {y} (chrome) error type typeerror.
...primitive values cannot hold any property.
...And 2 more matches
ReferenceError: "x" is not defined - JavaScript
the javascript exception "variable is not defined" occurs when there is a non-existent variable referenced somewhere.
... message referenceerror: "x" is not defined error type referenceerror.
... note: when loading a library (such as jquery), make sure it is loaded before you access library variables, such as "$".
...And 2 more matches
SyntaxError: "use strict" not allowed in function with non-simple parameters - JavaScript
the javascript exception "'use strict' not allowed in function" occurs when a "use strict" directive is used at the top of a function with default parameters, rest parameters, or destructuring parameters.
... message edge: cannot apply strict mode on functions with non-simple parameter list firefox: syntaxerror: "use strict" not allowed in function with default parameter syntaxerror: "use strict" not allowed in function with rest parameter syntaxerror: "use strict" not allowed in function with destructuring parameter chrome: syntaxerror: illegal 'use strict' directive in function with non-simple parameter list error type syntaxerror.
... a "use strict" directive is written at the top of a function that has one of the following parameters: default parameters rest parameters destructuring parameters a "use strict" directive is not allowed at the top of such functions per the ecmascript specification.
...And 2 more matches
notification.type - Archive of obsolete content
« xul reference home type type: one of the values below indicates the type of notification, determined from the priority.
... info a notification that is of lesser importance.
... warning a normal warning notification.
... critical a critical notification.
XULRunner 1.9.1 Release Notes - Archive of obsolete content
current version the current version of xulrunner is 1.9.1.19, matching firefox 3.5.19 detailed release notes can be found here.
... mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version.
... save the application archive to your desktop or another convenient place.
...please search to make sure that your bug has not already been reported.
XULRunner 1.9.2 Release Notes - Archive of obsolete content
current version the current version of xulrunner 1.9.2 is 3.6.26, matching firefox 3.6.26 detailed release notes can be found here.
... mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version.
... save the application archive to your desktop or another convenient place.
...please search to make sure that your bug has not already been reported.
XULRunner 1.9 Release Notes - Archive of obsolete content
current version the current version of xulrunner is 1.9.0.17, matching firefox 3.0.17 detailed release notes can be found here.
... mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version.
... save the application archive to your desktop or another convenient place.
...please search to make sure that your bug has not already been reported.
XULRunner 2.0 Release Notes - Archive of obsolete content
current version the current version of xulrunner 2.0 is 2.0, matching firefox 4.0 detailed release notes can be found here.
... mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version.
... save the application archive to your desktop or another convenient place.
...please search to make sure that your bug has not already been reported.
PR_CNotify
notify a thread waiting on a change in the state of monitored data.
... syntax #include <prcmon.h> prstatus pr_cnotify(void *address); parameter the function has the following parameter: address the address of the monitored object.
... pr_failure indicates that the monitor has not been entered by the calling thread.
... description using the value specified in the address parameter to find a monitor in the monitor cache, pr_cnotify notifies single a thread waiting for the monitor's state to change.
PR_CNotifyAll
notifies all the threads waiting for a change in the state of monitored data.
... syntax #include <prcmon.h> prstatus pr_cnotifyall(void *address); parameter the function has the following parameter: address the address of the monitored object.
... the calling thread must be in the monitor at the time pr_cnotifyall is called.
... pr_failure indicates that the referenced monitor could not be located or that the calling thread was not in the monitor description using the value specified in the address parameter to find a monitor in the monitor cache, pr_cnotifyall notifies all threads waiting for the monitor's state to change.
PR_NotifyAllCondVar
notifies all of the threads waiting on a specified condition variable.
... syntax #include <prcvar.h> prstatus pr_notifyallcondvar(prcondvar *cvar); returns the function returns one of the following values: if successful, pr_success.
... if unsuccessful (for example, if the caller has not locked the lock associated with the condition variable), pr_failure.
... a call to pr_notifyallcondvar causes all of the threads waiting on the specified condition variable to be promoted to a ready state.
4.3 Release Notes
tus_response_alert ssl_error_bad_cert_hash_value_alert new tls cipher suites (see http://mxr.mozilla.org/security/sour...sslsocket.java): tls_rsa_with_camellia_128_cbc_sha tls_dhe_dss_with_camellia_128_cbc_sha tls_dhe_rsa_with_camellia_128_cbc_sha tls_rsa_with_camellia_256_cbc_sha tls_dhe_dss_with_camellia_256_cbc_sha tls_dhe_rsa_with_camellia_256_cbc_sha note: the following tls cipher suites are declared but are not yet implemented: tls_dh_dss_with_camellia_128_cbc_sha tls_dh_rsa_with_camellia_128_cbc_sha tls_dh_anon_with_camellia_128_cbc_sha tls_dh_dss_with_camellia_256_cbc_sha tls_dh_rsa_with_camellia_256_cbc_sha tls_dh_anon_with_camellia_256_cbc_sha tls_ecdh_anon_with_null_sha tls_ecdh_anon_with_rc4_128_sha tl...
...we provide the jss4.jar in case you do not want to obtain your own jce code signing certificate.
... 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 was released.
NSS_3.12.1_release_notes.html
nss 3.12.1 release notes 2008-09-05 newsgroup: mozilla.dev.tech.crypto contents introduction distribution information new in nss 3.12.1 bugs fixed documentation compatibility feedback introduction network security services (nss) 3.12.1 is a patch release for nss 3.12.
... bug 311432: ecc's ecl_use_fp code (for linux x86) fails pairwise consistency 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_ocspchec...
...ker_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_parselocation bug 420644: improve ssl tracing of key derivation bug 426886: use const char* in pk11_importcertforkey bug 428103: cert_encodesubjectkeyid is not defined in any public header file bug 429716: debug builds of libpkix unconditionally dump socket traffic to stdout bug 430368: vfychain -t option is undocumented bug 430369: vfychain -o succeeds even if -pp is not specified bug 430399: vfychain -pp crashes bug 430405: error log is not produced by cert_pkixverifycert bug 430743: update ssltap to understand the ...
...n devutil.c bug 432303: replace pkix_pl_memcpy with memcpy bug 433177: fix the gcc compiler warnings in lib/util and lib/freebl bug 433437: vfychain ignores the -a option bug 433594: crash destroying ocsp cert id [[@ cert_destroyocspcertid ] bug 434099: nss relies on unchecked pkcs#11 object attribute values bug 434187: fix the gcc compiler warnings in nss/lib bug 434398: libpkix cannot find issuer cert immediately after checking it with ocsp bug 434808: certutil -b deadlock when importing two or more roots bug 434860: coverity 1150 - dead code in ocsp_createcertid bug 436428: remove unneeded assert from sec_pkcs7encryptlength bug 436430: make nss public headers compilable with no_nspr_10_support defined bug 436577: uninitialized variable in sec_pkcs5createalgorithmid ...
NSS 3.14 release notes
because the test coverage and interoperability testing is not yet at the same level as other nss code, this feature should be considered "experimental" and may contain bugs.
...they should not use multi-part apis (c_encryptupdate/c_decryptupdate).
...applications may use this callback to inform libpkix whether or not candidate certificate chains meet application-specific security policies, allowing libpkix to continue discovering certificate paths until it can find a chain that satisfies the policies.
...note that ssl cipher suites with "md5" in their names are not disabled by this change; those cipher suites use hmac-md5, not plain md5, and are still considered safe.
NSS 3.15.1 release notes
note the following limitations.
... aes gcm cipher suites are not yet supported.
...notable changes in nss 3.15.1 bug 856060 - enforce name constraints on the common name in libpkix when no subjectaltname is present.
... bug 882829 - on windows, nss initialization fails if nss cannot call the rtlgenrandom function.
NSS 3.15 release notes
support for single-operation (eg: not multi-part) symmetric key encryption and decryption, via pk11_encrypt and pk11_decrypt.
... in pk11pub.h pk11_decrypt - performs decryption as a single pkcs#11 operation (eg: not multi-part).
... pk11_encrypt - performs encryption as a single pkcs#11 operation (eg: not multi-part).
... new macros in ssl.h ssl_enable_ocsp_stapling - used with ssl_optionset to configure tls client sockets to request the certificate_status extension (eg: ocsp stapling) when set to pr_true notable changes in nss 3.15 secitem_reallocitem is now deprecated.
NSS 3.16 release notes
notable changes in nss 3.16 ecc is enabled by default.
... bug 903885: (cve-2014-1492) in a wildcard certificate, the wildcard character should not be embedded within the u-label of an internationalized domain name.
... bug 962760: libpkix should not include the common name of ca as dns names when evaluating name constraints.
... bug 981170: aeskeywrap_decrypt should not return secsuccess for invalid keys.
nss tech note4
pulling certificate extension information out of ssl certificates nss technical note: 4 note: this document contains code snippets that focus on essential aspects of the task and often do not illustrate all the cleanup that needs to be done.
... also, this document does not attempt to be an exhaustive survey of all possible ways to do a certain task; it merely tries to show a certain way.
...ecitem *ext_oid = &(*extensions)->id; secitem *ext_critical = &(*extensions)->critical; secitem *ext_value = &(*extensions)->value; /* id attribute of the extension */ secoiddata *oiddata = secoid_findoid(ext_oid); if (oiddata == null) { /* oid not found */ /* secitem ext_oid has type (secitemtype), data (unsigned char *) and len (unsigned int) fields - the application interprets these */ .......
... } /* critical attribute of the extension */ if (ext_critical->len > 0) { if (ext_critical->data[0]) /* the extension is critical */ else /* the extension is not critical */ } /* value attribute of the extension */ /* secitem ext_value has type (secitemtype), data (unsigned char *) and len (unsigned int) fields - the application interprets these */ secoidtag oidtag = secoid_findoidtag(ext_oid); switch (oidtag) ...
Notification.badge - Web APIs
note: this feature is available in web workers.
... the badge property of the notification interface returns the url of the image used to represent the notification when there is not enough space to display the notification itself.
... syntax var url = notification.badge value a usvstring containing a url.
... specifications specification status comment notifications apithe definition of 'badge' in that specification.
Notification.body - Web APIs
WebAPINotificationbody
note: this feature is available in web workers.
... the body read-only property of the notification interface indicates the body string of the notification, as specified in the body option of the notification() constructor.
... syntax var body = notification.body; value a domstring.
... examples function spawnnotification(thebody, theicon, thetitle) { var options = { body: thebody, icon: theicon } var n = new notification(thetitle, options); console.log(n.body); } specifications specification status comment notifications apithe definition of 'body' in that specification.
Notification.image - Web APIs
note: this feature is available in web workers.
... the image read-only property of the notification interface contains the url of an image to be displayed as part of the notification, as specified in the image option of the notification() constructor.
... syntax var image = notification.image; value a usvstring.
... specifications specification status comment notifications apithe definition of 'image' in that specification.
Notification.onclose - Web APIs
note: this feature is available in web workers.
... the onclose property of the notification interface specifies an event listener to receive close events.
... these events occur when a notification is closed.
... syntax notification.onclose = function() { ...
Notification.onerror - Web APIs
note: this feature is available in web workers.
... the onerror property of the notification interface specifies an event listener to receive error events.
... these events occur when something goes wrong with a notification (in many cases an error preventing the notification from being displayed.) syntax notification.onerror = function() { ...
... }; specifications specification status comment notifications apithe definition of 'onerror' in that specification.
Notification.onshow - Web APIs
note: this feature is available in web workers.
... the onshow property of the notification interface specifies an event listener to receive show events.
... these events occur when a notification is displayed.
... syntax notification.onshow = function() { ...
Notification.title - Web APIs
note: this feature is available in web workers.
... the title read-only property of the notification interface indicates the title of the notification, as specified in the title parameter of the notification() constructor.
... syntax var title = notification.title; value a domstring.
... examples function spawnnotification(thebody,theicon,thetitle) { var options = { body: thebody, icon: theicon } var n = new notification(thetitle,options); console.log(n.title) } specifications specification status comment notifications apithe definition of 'title' in that specification.
NotificationEvent.action - Web APIs
returns the string id of the notification button the user clicked.
... this value returns an empty string if the user clicked the notification somewhere other than an action button, or the notification does not have a button.
... the notification id is set during the creation of the notification via the actions array attribute and can't be modified unless the notification is replaced.
... example self.registration.shownotification("new articles available", { actions: [{action: "get", title: "get now."}] }); self.addeventlistener('notificationclick', function(event) { event.notification.close(); if (event.action === 'get') { synchronizereader(); } else { clients.openwindow("/reader"); } }, false); specifications specification status comment notifications apithe definition of 'action' in that specification.
Reason: CORS request did not succeed - HTTP
reason reason: cors request did not succeed what went wrong?
...the error is not directly related to cors, but is a fundamental network error of some kind.
... as of firefox 68, https pages are not permitted to access http://localhost, although this may be changed by bug 1488740.
... the server did not respond to the actual request (even if it responded to the preflight request).
TypeError: can't define property "x": "obj" is not extensible - JavaScript
the javascript exception "can't define property "x": "obj" is not extensible" occurs when object.preventextensions() marked an object as no longer extensible, so that it will never have properties beyond the ones it had at the time it was marked as non-extensible.
... message typeerror: cannot create property for a non-extensible object (edge) typeerror: can't define property "x": "obj" is not extensible (firefox) typeerror: cannot define property: "x", object is not extensible.
... 'use strict'; var obj = {}; object.preventextensions(obj); obj.x = 'foo'; // typeerror: can't define property "x": "obj" is not extensible in both, strict mode and sloppy mode, a call to object.defineproperty() throws when adding a new property to a non-extensible object.
... var obj = { }; object.preventextensions(obj); object.defineproperty(obj, 'x', { value: "foo" } ); // typeerror: can't define property "x": "obj" is not extensible to fix this error, you will either need to remove the call to object.preventextensions() entirely, or move it to a position so that the property is added earlier and only later the object is marked as non-extensible.
SyntaxError: for-in loop head declarations may not have initializers - JavaScript
the javascript strict mode-only exception "for-in loop head declarations may not have initializers" occurs when the head of a for...in contains an initializer expression, such as |for (var i = 0 in obj)|.
... this is not allowed in for-of loops in strict mode.
... message syntaxerror: for-in loop head declarations cannot have an initializer (edge) syntaxerror: for-in loop head declarations may not have initializers (firefox) syntaxerror: for-in loop variable declaration may not have an initializer.
... examples this example throws a syntaxerror: "use strict"; var obj = {a: 1, b: 2, c: 3 }; for (var i = 0 in obj) { console.log(obj[i]); } // syntaxerror: for-in loop head declarations may not have initializers valid for-in loop you can remove the initializer (i = 0) in the head of the for-in loop.
TypeError: cannot use 'in' operator to search for 'x' in 'y' - JavaScript
message typeerror: invalid operand to 'in' (edge) typeerror: right-hand side of 'in' should be an object, got 'x' (firefox) typeerror: cannot use 'in' operator to search for 'x' in 'y' (firefox, chrome) error type typeerror what went wrong?
... "hello" in "hello world"; // typeerror: cannot use 'in' operator to search for 'hello' in 'hello world' instead you will need to use string.prototype.indexof(), for example.
... var foo = null; "bar" in foo; // typeerror: cannot use 'in' operator to search for 'bar' in 'foo' (chrome) // typeerror: right-hand side of 'in' should be an object, got null (firefox) the in operator always expects an object.
...the in operator checks the index number, not the value at that index.
Bitwise NOT (~) - JavaScript
the bitwise not operator (~) inverts the bits of its operand.
... the truth table for the not operation is: a not a 0 1 1 0 9 (base 10) = 00000000000000000000000000001001 (base 2) -------------------------------- ~9 (base 10) = 11111111111111111111111111110110 (base 2) = -10 (base 10) bitwise noting any number x yields -(x + 1).
... note that due to using 32-bit representation for numbers both ~-1 and ~4294967295 (232-1) results in 0.
... examples using bitwise not ~0; // -1 ~-1; // 0 ~1; // -2 specifications specification ecmascript (ecma-262)the definition of 'unary not expression' in that specification.
not - XPath
WebXPathFunctionsnot
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the not function evaluates a boolean expression and returns the opposite value.
... syntax not(expression ) arguments expression the expression is evaluated exactly as if it were passed as an argument to the boolean() function.
... notes this function should behave similarly to the boolean() function except that it returns the opposite value.
... <xsl:for-each match="//a[not(@name and @name = 'badname')]"> <!-- iterates over any <a> element in the document, that either has no 'name' attribute at all, or it has one, but its value is not "badname".
Alerts and Notifications - Archive of obsolete content
this works on windows, linux and (if growl is installed) mac os x: function 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', null); win.arguments = [image, title, msg, false, '']; } using notification box another way of non-modal notification and further interaction with users is using of xul elements notificationbox and notification (implicitly).
... var message = 'another pop-up blocked'; var box = gbrowser.getnotificationbox(); var notification = box.getnotificationwithvalue('popup-blocked'); if (notification) { notification.label = message; } else { var buttons = [{ label: 'button', accesskey: 'b', popup: 'blockedpopupoptions', callback: null }]; let priority = box.priority_warning_medium; box.appendnotification(message, 'popup-blocked', 'chrome://browser/skin/info.png', priority, buttons); } ...
XULRunner 1.8.0.1 Release Notes - Archive of obsolete content
mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version.
... save the application archive to your desktop or another convenient place.
...please search to make sure that your bug has not already been reported.
XULRunner 1.8.0.4 Release Notes - Archive of obsolete content
mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version.
... save the application archive to your desktop or another convenient place.
...please search to make sure that your bug has not already been reported.
PR_NOT_REACHED
syntax #include <prlog.h> void pr_not_reached(const char *_reasonstr); parameters the macro has this parameter: reasonstr a string that describes why you should not have reached this statement.
... returns nothing description this macro writes the specified reason string to the log and terminates the application.
... this macro compiles to nothing if compile-time options are not specified to enable logging.
PR_NotifyAll
syntax #include <prmon.h> prstatus pr_notifyall(prmonitor *mon); parameters the function has the following parameter: mon a reference to an existing structure of type prmonitor.
... description a call to pr_notifyall causes all of the threads waiting on the monitor to be scheduled to be promoted to a ready state.
... pr_notifyall should be used with some care.
JSS 4.4.0 Release Notes
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:.
... 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.
NSS 3.14.2 release notes
note: the new assembly code requires gnu as version 2.19 or newer.
... 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.
...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.
NSS 3.21 release notes
the module represented by the module structure is not loaded.
...sh 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_enable_extended_master_secret - configuration to enable the tls extended master secret extension (rfc 7627) ssl_preinfo_version - used with sslpreliminarychannelinfo to indicate that a tls version has been selected ssl_preinfo_cipher_suite - used with sslpreliminarychannelinfo to indicate that a tls cipher suite has been selected ssl_preinfo_all - use...
...d with sslpreliminarychannelinfo to indicate that all preliminary information has been set notable changes in nss 3.21 nss now builds with elliptic curve ciphers enabled by default (bug 1205688) nss now builds with warnings as errors (bug 1182667) the following ca certificates were removed cn = verisign class 4 public primary certification authority - g3 sha1 fingerprint: c8:ec:8c:87:92:69:cb:4b:ab:39:e9:8d:7e:57:67:f3:14:95:73:9d cn = utn-userfirst-network applications sha1 fingerprint: 5d:98:9c:db:15:96:11:36:51:65:64:1b:56:0f:db:ea:2a:c2:3e:f1 cn = tc trustcenter universal ca iii sha1 fingerprint: 96:56:cd:7b:57:96:98:95:d0:e1:41:46:68:06:fb:b8:c6:11:06:87 cn = a-trust-nqual-03 sha-1 fingerprint: ...
NSS 3.44 release notes
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.
...bswap64 in crypto_primitives.h 1533216 - cert_decodecertpackage() crash with netscape certificate sequences 1533616 - sdb_getattributevaluenolock 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 data that arrives before the handshake completes can be read afterwards 1548398 - freebl_gtest not building on linux/mac 1548722 - fix some coverity warnings 1540652 - softoken/sdb.c: logically dead code 1549413 - android log lib is not included in build 1537927 - ipsec usage is too restrictive for existing deployments 1549608 - signature fails with dbm disabled 1549848 - allow building nss for ios using gyp 1549847 - nss's sqlite compilation warnings make the build fail on ios 1550041 - freebl not building on ios simulator 1542950 - macos cipher test timeouts this bugzilla query returns all the bugs fixed in nss 3.44: https://bugzilla.moz...
NSS 3.45 release notes
notable changes in nss 3.45 bug 1540403 - implement delegated credentials (draft-ietf-tls-subcerts) this adds a new experimental function: ssl_delegatecredential note: in 3.45, selfserv does not yet support delegated credentials.
... 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.
... bug 1546477 - various changes in response to the ongoing fips review note: the source package size has increased substantially due to the new fips test vectors.
NSS 3.46 release notes
of particular note are significant improvements to aes-gcm performance on arm.
... notable changes in nss 3.46 certificate authority changes the following ca certificates were removed: bug 1574670 - remove expired class 2 primary root certificate sha-256 fingerprint: 0f993c8aef97baaf5687140ed59ad1821bb4afacf0aa9a58b5d57a338a3afbcb bug 1574670 - remove expired utn-userfirst-client root certificate sha-256 fingerprint: 43f257412d440d627476974f877da8f1fc2444565a367ae60eddc27a412531ae bug 1574670 - remove expired deutsche telekom root ca 2 root certificate sha-256 fingerprint: b6191a50d0c3977f7da99bcdaac86a227daeb9679ec70ba3b0c9d92271c170d3 bug 1566569 - remove swisscom root ca 2 root certificate sha-256 fingerprint: f09b122c7114f4a09bd4ea4f4a99d558b46e4c25cd81140d29c05613914c3841 ...
...vertised extensions in ssl_constructextensions bug 1415118 - nss build with ./build.sh --enable-libpkix fails bug 1539788 - add length checks for cryptographic primitives (cve-2019-17006) bug 1542077 - mp_set_ulong and mp_set_int should return errors on bad values bug 1572791 - read out-of-bounds in der_decodetimechoice_util from sslexp_delegatecredential bug 1560593 - cleanup.sh script does not set error exit code for tests that "failed with core" bug 1566601 - add wycheproof test vectors for aes-kw bug 1571316 - curve25519_32.c:280: undefined reference to `pr_assert' when building nss 3.45 on armhf-linux bug 1516593 - client to generate new random during renegotiation bug 1563258 - fips.sh fails due to non-existent "resp" directories bug 1561598 - remove -wmaybe-uninitialized warn...
NSS 3.47 release notes
notable changes in nss 3.47 bug 1152625 - support aes hw acceleration on armv8 bug 1267894 - allow per-socket run-time ordering of the cipher suites presented in clienthello bug 1570501 - add cmac to freebl and pkcs #11 libraries bugs fixed in nss 3.47 bug 1459141 - make softoken cbc padding removal constant time bug 1589120 - more cbc padding tests bug 1465613 - add ability to distrust c...
... 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) 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 test messages for thunderbird bug 1399095 - allow nss-try to be used to test nspr changes bug 1267894 - libssl should allow selecting the order of cipher suites in clienthello bug 1581507 - fix unportable grep expression in test scripts bug 1234830 - [cid 1242894][cid 1242852] unused values bug 1580126 - fix build failure on aarch64_be while building freebl/gcm bug 1385039 - build nspr tests as part of nss continuous integration bug 1...
NSS 3.55 release notes
notable changes in nss 3.55 p384 and p521 elliptic curve implementations are replaced with verifiable implementations from fiat-crypto and ecckiila.
...another potential workaround is to use the gyp-based build.sh script.
... bug 1636771 (cve-2020-12403) - explicitly disable multi-part chacha20 (which was not functioning correctly) and more strictly enforce tag length.
nss tech note2
using the pkcs #11 module logger nss technical note: 2 modes of operation extracting output from log files the logger displays all activity between nss and a specified pkcs #11 module.
...for example, to log the softoken, use: nss_debug_pkcs11_module="nss internal pkcs #11 module" note: in the command prompt on windows, do not quote the name of the target module, otherwise the quotes are considered part of the name.
...yyyyyyy for example, 1024[805ef10]: c_initialize 1024[805ef10]: pinitargs = 0x4010c938 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getinfo 1024[805ef10]: pinfo = 0xbffff340 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getslotlist 1024[805ef10]: tokenpresent = 0x0 1024[805ef10]: pslotlist = 0x0 1024[805ef10]: pulcount = 0xbffff33c 1024[805ef10]: *pulcount = 0x2 1024[805ef10]: rv = 0x0 note that when a pkcs #11 function takes a pointer argument for which it will set a value (c_getslotlist above), this mode will display the value upon return.
nsIDOMNavigatorDesktopNotification
dom/interfaces/notification/nsidomnavigatordesktopnotification.idlscriptable property that extends the navigator object.
...attributes attribute type description moznotification nsidomdesktopnotificationcenter read only.
... see also nsidomdesktopnotificationcenter ...
BluetoothCharacteristicProperties.notify - Web APIs
the notify read-only property of the bluetoothcharacteristicproperties interface returns a boolean that is true if notifications of the characteristic value without acknowledgement is permitted.
... syntax var aboolean = bluetoothcharacteristicproperties.notify; value a boolean.
... specifications specification status comment web bluetooththe definition of 'notify' in that specification.
BluetoothRemoteGATTCharacteristic.startNotifications() - Web APIs
the bluetoothremotegattcharacteristic.startnotifications() method returns a promise to the bluetoothremotegattcharacteristic instance when there is an active notification on it.
... syntax bluetoothremotegattcharacteristic.startnotifications().then(function(bluetoothremotegattcharacteristic) { ...
... specifications specification status comment web bluetooththe definition of 'startnotifications()' in that specification.
BluetoothRemoteGATTCharacteristic.stopNotifications() - Web APIs
the bluetoothremotegattcharacteristic.stopnotifications() method returns a promise to the bluetoothremotegattcharacteristic instance when there is no longer an active notification on it.
... syntax bluetoothremotegattcharacteristic.stopnotifications().then(function(bluetoothremotegattcharacteristic) { ...
... specifications specification status comment web bluetooththe definition of 'stopnotifications()' in that specification.
NotifyAudioAvailableEvent - 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.
... the non-standard, obsolete, notifyaudioavailableevent interface defines the event sent to audio elements when the audio buffer is full.
ServiceWorkerGlobalScope: notificationclick event - Web APIs
the notificationclick event is fired to indicate that a system notification spawned by serviceworkerregistration.shownotification() has been clicked.
... bubbles no cancelable no interface notificationevent event handler onnotificationclick examples you can use the notificationclick event in an addeventlistener method: self.addeventlistener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); ...
...or use the onnotificationclick event handler property: self.onnotificationclick = function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }; specifications specification status notifications apithe definition of 'onnotificationclick' in that specification.
Reason: CORS header 'Access-Control-Allow-Origin' does not match 'xyz' - HTTP
reason reason: cors header 'access-control-allow-origin' does not match 'xyz' what went wrong?
... simply put, the origin making the request does not match any of the origins permitted by the access-control-allow-origin header.
...the header itself accepts a comma-delineated list of origins, so adding a new origin is not difficult.
Reason: CORS request external redirect not allowed - HTTP
reason reason: cors request external redirect not allowed what went wrong?
... the cors request was responded to by the server with an http redirect to a url on a different origin than the original request, which is not permitted during cors requests.
... for example, if the page https://service.tld/fetchdata were requested, and the http response is "301 moved permanently", "307 temporary redirect", or "308 permanent redirect" with a location of https://anotherservice.net/getdata, the cors request will fail in this manner.
Reason: Did not find method in CORS header ‘Access-Control-Allow-Methods’ - HTTP
reason reason: did not find method in cors header ‘access-control-allow-methods’ what went wrong?
... the http method being used by the cors request is not included in the list of methods specified by the response's access-control-allow-methods header.
... note: if the server includes any unrecognized or undefined method names in its access-control-allow-methods header, a different error occurs: reason: invalid token ‘xyz' in cors header ‘access-control-allow-methods’.
Reason: CORS preflight channel did not succeed - HTTP
reason reason: cors preflight channel did not succeed what went wrong?
... the cors request requires preflight, preflighting could not be performed.
... there are a couple of reasons why preflighting might fail: a cross-site request has previously been performed that already did a preflight, and doing the preflight again is not permitted.
510 Not Extended - HTTP
WebHTTPStatus510
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.
...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 ...
SyntaxError: return not in function - JavaScript
the javascript exception "return (or yield) not in function" occurs when a return or yield statement is called outside of a function.
... message syntaxerror: 'return' statement outside of function (edge) syntaxerror: return not in function (firefox) syntaxerror: yield not in function (firefox) error type syntaxerror.
... examples missing curly brackets var cheer = function(score) { if (score === 147) return 'maximum!'; }; if (score > 100) { return 'century!'; } } // syntaxerror: return not in function the curly brackets look correct at a first glance, but this code snippet is missing a { after the first if statement.
TypeError: "x" is (not) "y" - JavaScript
the javascript exception "x is (not) y" occurs when there was an unexpected type.
... message typeerror: unable to get property {x} of undefined or null reference (edge) typeerror: "x" is (not) "y" (firefox) examples: typeerror: "x" is undefined typeerror: "x" is null typeerror: "undefined" is not an object typeerror: "x" is not an object or null typeerror: "x" is not a symbol error type typeerror.
... examples invalid cases // undefined and null cases on which the substring method won't work var foo = undefined; foo.substring(1); // typeerror: foo is undefined var foo = null; foo.substring(1); // typeerror: foo is null // certain methods might require a specific type var foo = {} symbol.keyfor(foo); // typeerror: foo is not a symbol var foo = 'bar' object.create(foo); // typeerror: "foo" is not an object or null fixing the issue to fix null pointer to undefined values, you can use the typeof operator, for example.
getNotificationWithValue - Archive of obsolete content
« xul reference home getnotificationwithvalue( value ) return type: notification element retrieve the notification with a particular value.
... the value is specified when adding the notification with appendnotification.
removeAllNotifications - Archive of obsolete content
« xul reference home removeallnotifications( immediate ) return type: no return value remove all notifications.
...if immediate is false, the notifications are removed using a slide transition.
Localization notes
these comments are generally referred to as localization notes.
...dtd files <!-- localization note (entity name): comment --> properties files # localization note (key): comment file-wide comments should use the same format, be at the top of the file (after the license header, though) and just drop the (entity name/key) reference.
NSS 3.14.3 release notes
notable changes in nss 3.14.3 cve-2013-1620 recent research by nadhem alfardan and kenny patterson has highlighted a weakness in the handling of cbc padding as used in ssl, tls, and dtls that allows an attacker to exploit timing differences in mac processing.
... bug 840714 - "certutil -a" was not correctly producing ascii output as requested.
NSS 3.16.4 release notes
notable changes in nss 3.16.4 the following 1024-bit root ca certificate was restored to allow more time to develop a better transition strategy for affected sites.
...the inclusion of the intermediate certificate is a temporary measure to allow those sites to function, by allowing them to find a trust path to another 2048-bit root ca certificate.
NSS 3.17 release notes
this option does not affect the tls client code, which always generates a fresh ephemeral ecdh key for each handshake.
... new macros in ssl.h ssl_reuse_server_ecdhe_key notable changes in nss 3.17 the manual pages for the certutil and pp tools have been updated to document the new parameters that had been added in nss 3.16.2.
NSS 3.18.1 release notes
notable changes in nss 3.18.1 the following ca certificate had the websites and code signing trust bits restored to their original state to allow more time to develop a better transition strategy for affected sites.
... cn = e-guven kok elektronik sertifika hizmet saglayicisi sha1 fingerprint: dd:e1:d2:a9:01:80:2e:1d:87:5e:84:b3:80:7e:4b:b1:fd:99:41:34 the following intermediate ca certificate has been added as actively distrusted because it was misused to issue certificates for domain names the holder did not own or control.
NSS 3.18 release notes
a pkcs#11 library that contains root ca certificates can be loaded by tstclnt, which may either be the nssckbi library provided by nss (-b) or another compatible library (-r).
... notable changes in nss 3.18 the highest tls protocol version enabled by default has been increased from tls 1.0 to tls 1.2.
NSS 3.19.1 release notes
notable changes in nss 3.19.1 nss reports the bit length of keys more accurately.
... note: nss 3.19.1 increases the minimum size of keys it is willing to use.
NSS 3.19.2 release notes
notable changes in nss 3.19.2 bug 1172128 - in nss 3.19.1, the minimum key sizes that the freebl cryptographic implementation (part of the softoken cryptographic module used by default by nss) was willing to generate or use was increased - for rsa keys, to 512 bits, and for dh keys, 1023 bits.
... note: future versions of nss may increase the minimum keysizes required by the freebl module.
NSS 3.20 release notes
new types in sslt.h ssldhegrouptype - enumerates the set of dhe parameters embedded in nss that can be used with function ssl_dhegroupprefset new macros in ssl.h ssl_enable_server_dhe - a socket option user to enable or disable dhe ciphersuites for a server socket notable changes in nss 3.20 the tls library has been extended to support dhe ciphersuites in server applications.
... the server side implementation of the tls does not support session tickets while using a dhe ciphersuite (see bug 1174677).
NSS 3.22.1 release notes
the bug fixes in nss 3.22.1 are described in the "notable changes" section below.
... notable changes in nss 3.22.1 bug 1194680: nss has been changed to use the pr_getenvsecure function that was made available in nspr 4.12 compatibility nss 3.22.1 shared libraries are backward compatible with all older nss 3.22 shared libraries.
NSS 3.22 release notes
new macros in nss.h nss_rsa_min_key_size nss_dh_min_key_size nss_dsa_min_key_size nss_tls_version_min_policy nss_tls_version_max_policy nss_dtls_version_min_policy nss_dtls_version_max_policy in pkcs11t.h ckp_pkcs5_pbkd2_hmac_gostr3411 - prf based on hmac with gostr3411 for pbkdf (not supported) ckp_pkcs5_pbkd2_hmac_sha224 - prf based on hmac with sha-224 for pbkdf ckp_pkcs5_pbkd2_hmac_sha256 - prf based on hmac with sha-256 for pbkdf ckp_pkcs5_pbkd2_hmac_sha384 - prf based on hmac with sha-256 for pbkdf ckp_pkcs5_pbkd2_hmac_sha512 - prf based on hmac with sha-256 for pbkdf ckp_pkcs5_pbkd2_hmac_sha512_224 - prf based on hmac with sha-512 truncated to 224 bits fo...
...r pbkdf (not supported) ckp_pkcs5_pbkd2_hmac_sha512_256 - prf based on hmac with sha-512 truncated to 256 bits for pbkdf (not supported) in secoidt.h nss_use_alg_in_ssl nss_use_policy_in_ssl in ssl.h ssl_enable_signed_cert_timestamps in sslt.h ssl_max_extensions is updated to 13 notable changes in nss 3.22 nss c++ tests are built by default, requiring a c++11 compiler.
NSS 3.23 release notes
this code is not ready for production use.
... notable changes in nss 3.23 the copy of sqlite shipped with nss has been updated to version 3.10.2 (bug 1234698) the list of tls extensions sent in the tls handshake has been reordered to increase compatibility of the extended master secret with servers (bug 1243641) the build time environment variable nss_enable_zlib has been renamed to nss_ssl_enable_zlib (bug 1243872).
NSS 3.27.2 Release Notes
notable changes in nss 3.27.2 the ssl_settrustanchors() function is used to set the distinguished names that an nss server includes in its tls certificaterequest message.
... if this function is not used, nss will include the distinguished names for all trust anchors installed in the database.
NSS 3.27 release notes
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).
... npn can not be enabled anymore.
NSS 3.28.3 release notes
please note that nss 3.29 also contained the incorrect change.
...see also the separate release notes for nss 3.29.1 feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss).
NSS 3.30 release notes
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.
... rsa-pss signatures produced by key pairs with a modulus bit length that is not a multiple of 8 are now supported.
NSS 3.40 release notes
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.
... mozilla::pkix apis are not exposed in the libraries nss builds.
NSS 3.42 release notes
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 tes...
...note: this was mistakenly not in release 3.42, and is instead in nss 3.42.1.
NSS 3.48 release notes
notable changes in nss 3.48 tls 1.3 is the default maximum tls version.
...t root certification authority - g4 certificate to nss bug 1590001 - prevent negotiation of versions lower than 1.3 after helloretryrequest bug 1596450 - added a simplified and unified mac implementation for hmac and cmac behind pkcs#11 bug 1522203 - remove an old pentium pro performance workaround bug 1592557 - fix prng known-answer-test scripts bug 1586176 - encryptupdate should use maxout not block size (cve-2019-11745) bug 1593141 - add `notbefore` or similar "beginning-of-validity-period" parameter to mozilla::pkix::trustdomain::checkrevocation bug 1591363 - fix a pbkdf2 memory leak in nsc_generatekey if key length > max_key_len (256) bug 1592869 - use arm neon for ctr_xor bug 1566131 - ensure sha-1 fallback disabled in tls 1.2 bug 1577803 - mark pkcs#11 token as friendly if it...
NSS 3.50 release notes
notable changes in nss 3.50 verified primitives from hacl* were updated, bringing performance improvements for several platforms.
... note that intel processors with sse4 but without avx are currently unable to use the improved chacha20/poly1305 due to a build issue; such platforms will fall-back to less optimized algorithms.
NSS 3.51.1 release notes
notable changes in nss 3.51.1 bug 1617968 - update delegated credentials implementation to draft-07.
... bug 1619056 - update readme: tls 1.3 is not experimental anymore.
NSS 3.51 release notes
notable changes in nss 3.51 updated 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.
NSS 3.53 release notes
notable changes in nss 3.53 when using the makefiles, nss can be built in parallel, speeding up those builds to more similar performance as the build.sh/ninja/gyp system.
...(bug 1618404, bug 1621159) if a builtin certificate has a cka_nss_server_distrust_after timestamp before the sct or notbefore date of a certificate that builtin issued, then clients can elect not to trust it.
nss tech note7
rsa signing and encryption with nss nss technical note: 7 this technical note explains how to use nss to perform rsa signing and encryption.
...pk11_sign does not do the ber encoding of the hash (as is done in sgn_ functions).
Navigator.doNotTrack - Web APIs
the navigator.donottrack property returns the user's do not track setting, which indicates whether the user is requesting web sites and advertisers to not track them.
... example console.log(navigator.donottrack); // prints "1" if dnt is enabled; "0" if the user opted-in for tracking; otherwise this is "unspecified" specifications specification status comment tracking preference expression (dnt)the definition of 'navigator.donottrack' in that specification.
Reason: Multiple CORS header 'Access-Control-Allow-Origin' not allowed - HTTP
reason reason: multiple cors header ‘access-control-allow-origin’ not allowed what went wrong?
...you cannot send back a list of origins, because browsers only accept a value that is either a single origin or null ...
Reason: Credential is not supported if the CORS header ‘Access-Control-Allow-Origin’ is ‘*’ - HTTP
reason reason: credential is not supported if the cors header ‘access-control-allow-origin’ is ‘*’ what went wrong?
... if the request is being issued using xmlhttprequest, make sure you're not setting withcredentials to true.
304 Not Modified - HTTP
WebHTTPStatus304
the http 304 not modified client redirection response code indicates that there is no need to retransmit the requested resources.
... status 304 not modified specifications specification title rfc 7232, section 4.1: 304 not modified hypertext transfer protocol (http/1.1): conditional requests ...
405 Method Not Allowed - HTTP
WebHTTPStatus405
the hypertext transfer protocol (http) 405 method not allowed response status code indicates that the request method is known by the server but is not supported by the target resource.
... 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
WebHTTPStatus406
the hypertext transfer protocol (http) 406 not acceptable client error response code indicates that the server cannot produce a response matching the list of acceptable values defined in the request's proactive content negotiation headers, and that the server is unwilling to supply a default representation.
... status 406 not acceptable specifications specification title rfc 7231, section 6.5.6: 406 not acceptable hypertext transfer protocol (http/1.1): semantics and content ...
416 Range Not Satisfiable - HTTP
WebHTTPStatus416
the hypertext transfer protocol (http) 416 range not satisfiable error response code indicates that a server cannot serve the requested ranges.
... status 416 range not satisfiable specifications specification title rfc 7233, section 4.4: 416 request not satisfiable hypertext transfer protocol (http/1.1): range requests ...
505 HTTP Version Not Supported - HTTP
WebHTTPStatus505
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.
... status 505 http version not supported specifications specification title rfc 7231, section 6.6.6: 505 http version not supported hypertext transfer protocol (http/1.1): semantics and content ...
getNotificationBox - Archive of obsolete content
« xul reference home getnotificationbox( browser ) return type: notificationbox element returns a notificationbox for the specified browser element.
removeCurrentNotification - Archive of obsolete content
« xul reference home removecurrentnotification() return type: no return value remove the current notification.
removeNotification - Archive of obsolete content
« xul reference home removenotification( item ) return type: element remove a notification, displaying the next one if the removed item is the current one.
removeTransientNotifications - Archive of obsolete content
« xul reference home removetransientnotifications( ) return type: no return value remove only those notifications that have a persistence value of zero, and decrements by one the persistence value of those that have a non-zero value.
allNotifications - Archive of obsolete content
« xul reference allnotifications type: nodelist nodelist of all notifications.
currentNotification - Archive of obsolete content
« xul reference currentnotification type: notification element the currently displayed notification element or null.
notificationsHidden - Archive of obsolete content
« xul reference notificationshidden type: boolean indicating whether the notification area should be hidden.
Notes - Archive of obsolete content
implementing an nsicommandlinehandler on windows may trigger a bug that causes an error message ("windows cannot find the file specified") to be displayed when opening external links (like from a shortcut or from an external application).
ui.alertNotificationOrigin
ui.alertnotificationorigin controls the position and direction from which popup notifications invoked by nsialertsservice are sliding in.
NSS 3.12.9 release notes
bug 596798: win_rand.c (among others) uses unsafe _snwprintf bug 597622: do not use the sec_error_bad_info_access_location error code for bad crl distribution point urls bug 619268: memory leaks in cert_changecerttrust and cert_savesmimeprofile bug 585518: addtrust qualified ca root serial wrong in certdata.txt trust entry bug 337433: need cert_findcertbynicknameoremailaddrbyusage bug 592939: expired cas in certdata.txt documentation <for a="" class="new " docu...
NSS 3.15.2 release notes
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.
NSS 3.15.4 release notes
notable changes in nss 3.15.4 reordered the cipher suites offered in ssl/tls client hello messages to match modern best practices.
NSS 3.15.5 release notes
notable changes in nss 3.15.5 bug 950129: improve the ocsp fetching policy when verifying ocsp responses bug 949060: validate the iov input argument (an array of priovec structures) of ssl_writev (called via pr_writev).
NSS 3.16.1 release notes
notable changes in nss 3.16.1 imposed name constraints on the french government root ca anssi (dciss).
NSS 3.16.2.2 release notes
notable changes in nss 3.16.2.2 bug 1049435: change rsa_privatekeycheck to not require p > q.
NSS 3.16.2.3 release notes
notable changes in nss 3.16.2.3 bug 1057161: check that an imported elliptic curve public key is valid.
NSS 3.16.2 release notes
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.
NSS 3.16.3 release notes
notable changes in nss 3.16.3 the following 1024-bit ca certificates were removed cn = entrust.net secure server certification authority sha1 fingerprint: 99:a6:9b:e6:1a:fe:88:6b:4d:2b:82:00:7c:b8:54:fc:31:7e:15:39 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 ou = valicert class 1 poli...
NSS 3.16.6 release notes
notable changes in nss 3.16.6 bug 1049435: change rsa_privatekeycheck to not require p > q.
NSS 3.17.1 release notes
notable changes in nss 3.17.1 signature algorithms now use sha-256 instead of sha-1 by default.
NSS 3.17.2 release notes
notable changes in nss 3.17.2 bug 1049435: change rsa_privatekeycheck to not require p > q.
NSS 3.17.3 release notes
notable changes in nss 3.17.3 the quickder decoder now decodes lengths robustly (cve-2014-1569).
NSS 3.17.4 release notes
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).
NSS 3.19.3 release notes
notable changes in nss 3.19.3 the following ca certificates were removed cn = buypass class 3 ca 1 sha1 fingerprint: 61:57:3a:11:df:0e:d8:7e:d5:92:65:22:ea:d0:56:d7:44:b3:23:71 cn = tÜrktrust elektronik sertifika hizmet sağlayıcısı sha1 fingerprint: 79:98:a3:08:e1:4d:65:85:e6:c2:1e:15:3a:71:9f:ba:5a:d3:4a:d9 cn = sg trust services racine ...
NSS 3.19 release notes
notable changes in nss 3.19 the ssl 3 protocol has been disabled by default.
NSS 3.22.2 release notes
notable changes in nss 3.22.2 bug 1247990 - the root ca changes from nss 3.23 have been backported.
NSS 3.25.1 release notes
notable changes in nss 3.25.1 md5 signature algorithms sent by the server in certificaterequest messages are now properly ignored.
NSS 3.25 release notes
new functions in nssckfw.h nssckfwslot_getslotid nssckfwsession_getfwslot nssckfwinstance_destroysessionhandle nssckfwinstance_findsessionhandle notable changes in nss 3.25 an ssl socket can no longer be configured to allow both tls 1.3 and ssl v3.
NSS 3.26.2 release notes
notable changes in nss 3.26.2 md5 signature algorithms sent by the server in certificaterequest messages are now properly ignored.
NSS 3.26 release notes
rg/security/nss/releases/nss_3_26_rtm/src/ new in nss 3.26 new functionality the selfserv test utility has been enhanced to support alpn (http/1.1) and 0-rtt added support for the system-wide crypto policy available on fedora linux, see http://fedoraproject.org/wiki/changes/cryptopolicy introduced build flag nss_disable_libpkix which allows compilation of nss without the libpkix library notable changes in nss 3.26 the following ca certificate was added cn = isrg root x1 sha-256 fingerprint: 96:bc:ec:06:26:49:76:f3:74:60:77:9a:cf:28:c5:a7:cf:e8:a3:c0:aa:e1:1a:8f:fc:ee:05:c0:bd:df:08:c6 npn is disabled, and alpn is enabled by default the nss test suite now completes with the experimental tls 1.3 code enabled several test improvements and additions,...
NSS 3.27.1 release notes
notable changes in nss 3.27.1 availability of the tls 1.3 (draft) implementation has been re-disabled in the default build.
NSS 3.28.1 release notes
notable changes in nss 3.28.1 the following ca certificates were removed cn = buypass class 2 ca 1 sha-256 fingerprint: 0f:4e:9c:dd:26:4b:02:55:50:d1:70:80:63:40:21:4f:e9:44:34:c9:b0:2f:69:7e:c7:10:fc:5f:ea:fb:5e:38 cn = root ca generalitat valenciana sha-256 fingerprint: 8c:4e:df:d0:43:48:f3:22:96:9e:7e:29:a4:cd:4d:ca:00:46:55:06:1c:16:e1:b0:76:42:2e:f3:42:a...
NSS 3.28.2 release notes
nss 3.28.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_28_2_rtm/src/ incorrect version number note the version numbers embedded in the nss 3.28.2 are wrong (it reports itself as version 3.28.1).
NSS 3.28.5 release notes
notable changes in nss 3.28.5 the following ca certificates were removed: o = japanese government, ou = applicationca sha-256 fingerprint: 2d:47:43:7d:e1:79:51:21:5a:12:f3:c5:8e:51:c7:29:a5:80:26:ef:1f:cc:0a:5f:b3:d9:dc:01:2f:60:0d:19 cn = wellssecure public root certificate authority sha-256 fingerprint: a7:12:72:ae:aa:a3:cf:e8:72:7f:7f:b3:9f:0f:b3:d1:e5:42:...
NSS 3.29.1 release notes
note that nss 3.28.3 from the older nss 3.28.x branch has also been released with the identical fixes.
NSS 3.29.3 release notes
notable changes in nss 3.29.3 a rare crash when initializing an ssl socket fails has been fixed.
NSS 3.29 release notes
nss 3.29 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_29_rtm/src/ notable changes in nss 3.29 fixed a nss 3.28 regression in the signature scheme flexibility that causes connectivity issues between ios 8 clients and nss servers with ecdsa certificates (bug1334114).
NSS 3.30.2 release notes
notable changes in nss 3.30.2 the following ca certificates were removed: o = japanese government, ou = applicationca sha-256 fingerprint: 2d:47:43:7d:e1:79:51:21:5a:12:f3:c5:8e:51:c7:29:a5:80:26:ef:1f:cc:0a:5f:b3:d9:dc:01:2f:60:0d:19 cn = wellssecure public root certificate authority sha-256 fingerprint: a7:12:72:ae:aa:a3:cf:e8:72:7f:7f:b3:9f:0f:b3:d1:e5:42:...
NSS 3.31.1 release notes
this notice will be removed when completed.
NSS 3.31 release notes
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.
NSS 3.32 release notes
nss 3.32 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_32_rtm/src/ notable changes in nss 3.32 various minor improvements and correctness fixes.
NSS 3.33 release notes
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.
NSS 3.34.1 release notes
nss 3.34.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_34_1_rtm/src/ notable changes in nss 3.34.1 the following ca certificate was re-added.
NSS 3.34 release notes
nss 3.34 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_34_rtm/src/ notable changes in nss 3.34 the following ca certificates were added: cn = gdca trustauth r5 root sha-256 fingerprint: bf:ff:8f:d0:44:33:48:7d:6a:8a:a6:0c:1a:29:76:7a:9f:c2:bb:b0:5e:42:0f:71:3a:13:b9:92:89:1d:38:93 trust flags: websites cn = ssl.com root certification authority rsa sha-256 fingerprint: 85:66:6a:56:2e:e0:be:5c:e9:25:c1:d8:89:0a:6f:76:a8:7...
NSS 3.36.1 release notes
notable changes in nss 3.36.1 in nss version 3.35 the iteration count in optimized builds, which is used for password based encryption algorithm related to encrypted pkcs#7 or pkcs#12 data, was increased to one million iterations.
NSS 3.36 release notes
notable changes in nss 3.36 replaced existing vectorized chacha20 code with verified hacl* implementation.
NSS 3.37 release notes
nss 3.37 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_37_rtm/src/ notable changes in nss 3.37 the tls 1.3 implementation was updated to draft 28.
NSS 3.38 release notes
new functions in secitem.h secitem_makeitem - allocate and make an item with the requested contents new macros in ssl.h ssl_record_size_limit - used to control the tls record size limit extension notable changes in nss 3.38 fixed cve-2018-0495 in bug 1464971.
NSS 3.39 release notes
notable changes in nss 3.39 the tls 1.3 implementation uses the final version number from rfc 8446.
NSS 3.41 release notes
bug 1493215 - enabled the following ciphersuites by default: tls_ecdhe_ecdsa_with_aes_256_gcm_sha384 tls_ecdhe_rsa_with_aes_256_gcm_sha384 tls_dhe_rsa_with_aes_256_gcm_sha384 tls_rsa_with_aes_256_gcm_sha384 new functions none notable changes in nss 3.41 the following ca certificates were added: cn = certigna root ca sha-256 fingerprint: d48d3d23eedb50a459e55197601c27774b9d7b18c94d5a059511a10250b93168 cn = gts root r1 sha-256 fingerprint: 2a575471e31340bc21581cbd2cf13e158463203ece94bcf9d3cc196bf09a5472 cn = gts root r2 sha-256 fingerprint: c45d7bb08e6d67e62e4235110b564e5f78fd92ef05...
NSS 3.42.1 release notes
this was originally announced in nss 3.42, but was mistakenly not included in the release.
NSS 3.43 release notes
note that while the mechanism is present, post-handshake authentication is currently not tls 1.3 compliant due to bug 1532312 notable changes in nss 3.43 the following ca certificates were added: cn = emsign root ca - g1 sha-256 fingerprint: 40f6af0346a99aa1cd1d555a4e9cce62c7f9634603ee406615833dc8c8d00367 cn = emsign ecc root ca - g3 sha-256 fingerprint: 86...
NSS 3.44.1 release notes
new in nss 3.44.1 new functionality 1546229 - add ipsec ike support to softoken many new fips test cases (note: this has increased the source archive by approximately 50 megabytes for this release.) bugs fixed in nss 3.44.1 1554336 - optimize away unneeded loop in mpi.c 1515342 - more thorough input checking (cve-2019-11729) 1540541 - don't unnecessarily strip leading 0's from key material during pkcs11 import (cve-2019-11719) 1515236 - add a sslkeylogfile enable/disable flag ...
NSS 3.44.2 release notes
bugs fixed in nss 3.44.2 bug 1582343 - soft token mac verification not constant time bug 1577953 - remove arbitrary hkdf output limit by allocating space as needed this bugzilla query returns all the bugs fixed in nss 3.44.2: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.44.2 compatibility nss 3.44.2 shared libraries are backward compatible with all older nss 3.x shared ...
NSS 3.44.3 release notes
bugs fixed in nss 3.44.3 bug 1579060 - don't set the constructed bit for issueruniqueid and subjectuniqueid in mozilla::pkix cve-2019-11745 - encryptupdate should use maxout, not block size this bugzilla query returns all the bugs fixed in nss 3.44: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.44 compatibility nss 3.44.3 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.46.1 release notes
bugs fixed in nss 3.46.1 bug 1582343 - soft token mac verification not constant time bug 1577953 - remove arbitrary hkdf output limit by allocating space as needed this bugzilla query returns all the bugs fixed in nss 3.46.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.46.1 compatibility nss 3.46.1 shared libraries are backward compatible with all older nss 3.x shared ...
NSS 3.47.1 release notes
bugs fixed in nss 3.47.1 cve-2019-11745 - encryptupdate should use maxout, not block size bug 1590495 - fix a crash that could be caused by client certificates during startup bug 1589810 - fix compile-time warnings from uninitialized variables in a perl script this bugzilla query returns all the bugs fixed in nss 3.47: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.47 compatibili...
NSS 3.49 release notes
notable changes in nss 3.49 the legacy dbm database, libnssdbm, is no longer built by default when using gyp builds.
NSS 3.54 release notes
notable changes in nss 3.54 support for tls 1.3 external pre-shared keys (bug 1603042).
NSS 3.56 release notes
notable changes in nss 3.56 nspr dependency updated to 4.28.
NSS Tech Notes
nss technical notes newsgroup: mozilla.dev.tech.crypto nss technical notes provide latest information about new nss features and supplementary documentation for advanced topics in programming with nss.
NSS release notes template
new macros in ___.h macro - description notable changes in nss 3.xx ...
nsIDOMDesktopNotification
the nsidomdesktopnotification interface implements the dom notification interface.
nsIDOMDesktopNotificationCenter
the nsidomdesktopnotificationcenter interface implements the dom navigator.moznotification interface.
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.
notifyObservers
this content is now available at nsiobserverservice.notifyobservers().
Reason: CORS header ‘Origin’ cannot be added - HTTP
reason reason: cors header ‘origin’ cannot be added what went wrong?
Reason: CORS request not HTTP - HTTP
reason reason: cors request not http what went wrong?
RangeError: argument is not a valid code point - JavaScript
message rangeerror: {0} is not a valid code point (firefox) rangeerror: invalid code point {0} (chromium) error type rangeerror what went wrong?
Index - Web APIs
WebAPIIndex
11 abortsignal.aborted api, abortsignal, experimental, property, reference, aborted the aborted read-only property returns a boolean that indicates whether the dom request(s) the signal is communicating with is/are aborted (true) or not (false).
... 22 abstractworker api, abstract, abstractworker, interface, reference, sharedworker, web workers, web workers api, worker the abstractworker interface of the web workers api is an abstract interface that defines properties and methods that are common to all types of worker, including not only the basic worker, but also serviceworker and sharedworker.
...this will be unresolved if the animation was not associated with a timeline at the time the event was generated or if the associated timeline was inactive.
...And 563 more matches
Index
(note that it's important to look at the number 11, as there are other pkcs standards with different numbers that define quite different topics.) a software or hardware module conforming to the pkcs#11 standard implements an interface of c calls, which allow querying the characteristics and offered services of the module.
... many (if not most) of the operations performed by nss involve the use of x.509 certificates (often abbreviated as “cert”, unfortunately making it easy to confuse with the term “computer emergency response team“).
... when checking whether a certificate is trusted or not, it's necessary to find a relevant trust anchor (root certificate) that represents the signing capability of a trusted third party, usually called a certificate authority (ca).
...And 250 more matches
Index - Archive of obsolete content
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.
... 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.
...see displaying notifications for an example.
...And 190 more matches
Index
MozillaTechXPCOMIndex
4 binary compatibility xpcom if mozilla decides to upgrade to a compiler that does not have the same abi as the current version, any built component may fail.
... 14 introduction to xpcom for the dom developing mozilla warning: this document has not yet been reviewed by the dom gurus, it might contain some errors.
...these exception objects may be thrown when implementing xpcom interfaces in javascript, and they can provide better diagnostics in the error console if not caught than simply throwing an nsresult's value will.
...And 133 more matches
sslfnc.html
note that at least one of the functions listed in ssl export policy functions must also be called during nss initialization.
...nss_init isnot idempotent, so call it only once.
...therefore, an application cannot use nss to perform any cryptographic operations until after it enables appropriate cipher suites by calling one of the ssl export policy functions: nss_setdomesticpolicy, nss_setexportpolicy, and nss_setfrancepolicy configure the cipher suites for domestic, international, and french versions of software products with encryption features.
...And 111 more matches
WebIDL bindings
notes: need to document the setup for indexed and named setters/creators/deleters.
... note that if you're adding new interfaces, then the test at dom/tests/mochitest/general/test_interfaces.html will most likely fail.
...note that you may not need to do this if your objects can only be created, never gotten from other objects.
...And 110 more matches
Editor Embedding Guide - Archive of obsolete content
in calling this method, the editor is created underneath and the event listeners are all prepa if (ns_failed(rv)) return ns_error_failure; // we are not setup??!!
... nscomptr<nsieditingsession> editingsession; nsiwebbrowser->do_getinterface(getter_addrefs(editingsession)); if (editingsession) editingsession->makewindoweditable(domwindow, "html", pr_true); the valid editor types are: "text" (similar to notepad or a textarea; does not allow for html) "textmail" (similar to "text" but html can be inserted; intended for plaintext mail usage and handling of citations) "html" (this is the default type if no type is specified; it allows for all html tags to be inserted) "htmlmail" (this is much like "html" except there are a few editing rules/behaviors that differ such as splitting of mail quotes) editor commands you need to call commands and receive updates in order to make any changes to the content on the browser.
...text is not wrapped by word.
...And 93 more matches
nsIFile
a string 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.
...And 93 more matches
IME handling guide
ime is used by chinese, japanese, korean and taiwan users for inputting chinese characters because the number of them is beyond thousands and cannot be input from the keyboard directly.
...if ime is not fully available(i.e., user cannot enable ime), we call this state "disabled".
...then, converts each clause with chinese characters: "私の", "名前は" and "中野です" (in the following screenshot each clause is underlined and not connected adjacently.
...And 92 more matches
ARIA Test Cases - Accessibility
jaws 9 & 10 with ie beta 2 nvda 0.6p2 with firefox 3 orca with firefox 3 window-eyes 7 with ie 8 beta 2 and firefox 3 voiceover (leopard) with safari 4.0.2 zoom (leopard) with safari 4.0.2, firefox 3.x and opera 9.x zoomtext 9.1 with firefox 3 and ie 8 beta 2 test case structure test cases are organized as follows: test case links test details expected at behavior markup notes results table at firefox ie opera safari jaws 9 - - - - jaws 10 - 1.
... - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - - - - zoom (leopard) pass n/a pass pass zoomtext - - - - orca - - - - table legend - no info/test yet n/a not applicable (not supported technically) pass expected behaviour met fail expected behaviour notmet 1.
... 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.
...And 85 more matches
Index
it is separated in 2 parts, one section related to debugging and another section related to drafting optimizations.
... many of these tips only apply to debug builds of the js shell; they will not function in a release build.
...does not write the null terminator.
...And 82 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
if this attribute is not specified, the default type adopted is text.
... <input type="file" accept="image/*, text/*" name="file"/> hidden a control that is not displayed but whose value is submitted to the server.
...will alert user if site is not secure.
...And 80 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
2 404 glossary, http errors, infrastructure, navigation a 404 is a standard response code meaning that the server cannot find the requested resource.
...for example, <p> is by default a block-level element, whereas <a> is an inline element — you can put several links next to one another in your html source and they will sit on the same line as one another in the rendered output.
... 47 cms cms, composing, content management system, glossary a cms (content management system) is software that allows users to publish, organize, change, or remove various kinds of content, not only text but also embedded images, video, audio, and interactive code.
...And 72 more matches
Bytecode Descriptions
(per spec, unary - supports bigints, but unary + does not.) format: jof_ic neg stack: val ⇒ (-val) the unary - operator.
...format: jof_ic bitnot stack: val ⇒ (~val) the bitwise not operator (~).
...format: jof_ic not stack: val ⇒ (!val) the logical not operator (!).
...And 68 more matches
Starting WebLock
after having its registration procedure called, the component does nothing.
... in order to be started up or notified when some event happens, the sample component has to hook into mozilla, which it can do either by overriding an existing component or by registering for some event that will cause it to start up.
...when a gecko application starts up, registered components are created and notified via the general-purpose observer interface nsiobserver.
...And 67 more matches
sslerr.html
peer does not support high-grade encryption." the local system was configured to support the cipher suites permitted for domestic use.
...peer requires high-grade encryption which is not supported." the remote system was configured to support the cipher suites permitted for domestic use.
... 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.
...And 63 more matches
HTTP Index - HTTP
WebHTTPIndex
http is a stateless protocol, meaning that the server does not keep any data (state) between two requests.
...it relies on a few basic concepts like the notion of resources and uris, a simple structure of messages, and a client-server structure for the communication flow.
... 23 reason: cors header 'access-control-allow-origin' does not match 'xyz' cors, corsalloworiginnotmatchingorigin, cross-origin, error, http, https, messages, reasons, security, console, troubleshooting simply put, the origin making the request does not match any of the origins permitted by the access-control-allow-origin header.
...And 62 more matches
CustomizableUI.jsm
if you want to use it from a jsm or another context without a window reference, you need to import it yourself: components.utils.import("resource:///modules/customizableui.jsm"); introduction the module is intended for two primary purposes: allow adding, moving and removing customizable widgets.
... note that it is expressly not really aware about the specific ui used by users to make customizations.
...note that these are also abstract cross-window objects; customizableui will manage the actual dom manipulation involved with adding/moving/removing widgets in all windows for you.
...And 60 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
this article was written in 2003 and is not on par with current standards.
... this article is outdated, do not follow it.
...note that some other browsers such as safari are reporting (like gecko) in their user agent strings and can confuse simple tests.
...And 56 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
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).
... when to use msaa, and when not to it's a common mistake to say that msaa is not worth using, for a number of reasons.
... myths for not using msaa myth: msaa doesn't really work reality: msaa works really well for dialogs and ui.
...And 56 more matches
Client-side storage - Learn web development
note: there are limits to the amount of data you can store using client-side storage apis (possibly both per individual api and cumulatively); the exact limit varies depending on the browser and possibly based on user settings.
...however, this does not mean cookies are completely useless on the modern-day web — they are still used commonly to store data related to user personalization and state, e.g.
... next, note how our html references a javascript file called index.js (see line 40).
...And 53 more matches
Using IndexedDB - Web APIs
if you are not familiar with indexeddb, you should first read basic concepts about indexeddb.
...window.indexeddb = window.indexeddb || window.mozindexeddb || window.webkitindexeddb || window.msindexeddb; // don't use "var indexeddb = ..." if you're not in a function.
...therefore, it is not recommended to use it in production code.
...And 53 more matches
Index - Archive of obsolete content
ArchiveMozillaXULIndex
unlike normal buttons, a statusbarpanel can only have a label or an image but not both.
... 3 a xul bestiary add-ons, extensions, needstechnicalreview, xul this xulnote presents some of the key concepts and terms in the xul development environment.
... the purpose of this article is not to describe these items in any great detail but to define what they are in simple terms.
...And 52 more matches
Debugger.Object - Firefox Developer Tools
the referent’s properties do not appear directly as properties of the debugger.object instance; the debugger can access them only through methods like debugger.object.prototype.getownpropertydescriptor and debugger.object.prototype.defineproperty, ensuring that the debugger will not inadvertently invoke the referent’s getters and setters.
...if the referent is an anonymous function, or not a function at all, this is undefined.
...if the referent is not a function, or if it has no display name, this is undefined.
...And 52 more matches
OS.File for the main thread
it uses an atomic write to ensure that the file is not modified if, for some reason, the write cannot complete (typically because the computer is turned off, the battery runs out, or the application is stopped.) let encoder = new textencoder(); // this encoder can be reused for several writes let array = encoder.encode("this is some text"); // convert the text to an array let promise = os.file.writ...
... 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 represents a directory } else { // the path represents a file, not a directory } }, function onfailure(reason) { if (reason instanceof os.file.error && reason.becausenosuchfile) { // the file does not exist } else { // some other error throw reason; } } ); example: copy a file by chunks the following snippet writes a (presumably large) buffer by chunks.
... note that this snippet is useful as a demonstration of complex asynchronous programming with os.file – in most cases, function os.file.writeatomic is a better choice.
...And 51 more matches
BluetoothCharacteristicProperties - Web APIs
notifyread only returns a boolean that is true if notifications of the characteristic value without acknowledgement 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('characteristicvaluechanged', function(event) { console.log(`received heart rate measurement: ${event.target.value}`); } await characteristic.startnotifications(); } specifications specification status comment web bluetooththe definition of 'bluetoothcharacteristicproperties' in that specification.
...And 51 more matches
Window.open() - Web APIs
WebAPIWindowopen
the name should not contain whitespace.
... keep in mind that this will not be used as the window's title.
...these features include options such as the window's default size and position, whether or not to include toolbar, and so forth.
...And 51 more matches
Error codes returned by Mozilla APIs
for example, by using components.results.ns_error_not_initialized general errors the following errors are general and can occur when using any component.
... ns_error_not_initialized (0xc1f30001) an attempt was made to use a component or object which has not yet been initialized.
... ns_error_not_implemented (0x80004001) this error is caused by methods which are not implemented.
...And 50 more matches
Mozilla’s UAAG evaluation report
the uaag is not the basis for any government accessibility regulations at this time.
...this evaluation does not cover mailnews or composer.
... there may be accessibility and customizability features not listed here.
...And 48 more matches
How to build custom form controls - Learn web development
there are some cases where the available native html form controls may seem like they are not enough.
... note: we'll focus on building the control, not on how to make the code generic and reusable; that would involve some non-trival javascript code and dom manipulation in an unknown context, and that is out of the scope of this article.
... the control was active and the user moves the focus to another control using the keyboard (e.g.
...And 47 more matches
nsIDOMWindowUtils
exceptions thrown ns_error_not_available there is no current inner window displaydpi float the dpi of the display.
...cannot be accessed from unprivileged context (not content-accessible) read only.
...throws ns_error_not_available if the count can't be provided.
...And 47 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
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.
...not only does this make the code easier to read, it simplifies adding support for new clients: var elm = getelmbyid("myid"); function getelmbyid(aid){ var element = null; if (ismozilla || isie5) element = document.getelementbyid(aid); else if (isnetscape4) element = document.layers[aid]; else if (isie4) element = document.all[aid]; return element; } the above code still ha...
...modern browsers will use the title attribute to display tooltips, and mozilla only supports showing tooltips for that attribute and not the alt attribute.
...And 44 more matches
Handling common accessibility problems - Learn web development
really, the aim of accessibility is to make your websites/apps usable by as many people in as many contexts as possible, not just those users using high-powered desktop computers.
... users of older devices that might not have the latest browsers.
... note: like many things in web development, accessibility isn't about 100% success or not; 100% accessibility is pretty much impossible to achieve for all content, especially as sites get more complex.
...And 44 more matches
Introduction to NSPR
nspr does not provide a platform for porting existing code.
...(prthread and functions for creating and manipulating threads are described in detail in threads.) nspr threads are lightweight in the sense that they are cheaper than full-blown processes, but they are not free.
...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 .
...And 44 more matches
Mozilla internal string guide
as a result, you cannot assign a 8-bit string to a 16-bit string without some kind of conversion helper class or routine.
... the string classes distinguish, as part of the type hierarchy, between strings that must have a null-terminator at the end of their buffer (ns[c]string) and strings that are not required to have a null-terminator (nsa[c]string).
...all string classes support the following three ownership models dynamically: reference counted, copy-on-write, buffers (the default) adopted buffers (a buffer that the string class owns, but is not reference counted, because it came from somewhere else) dependent buffers, that is, an underlying buffer that the string class does not own, but that the caller that constructed the string guarantees will outlive the string instance in addition, there is a special string class, ns[c]autostring, that additionally contains an internal 64-unit buffer (intended primarily for use on the stack), lea...
...And 44 more matches
MMgc - Archive of obsolete content
unmanaged memory mmgc is not only a garbage collector, but a general-purpose memory manager.
...another way to think about it: unmanaged memory is c++ operators new and delete managed memory is c++ operator new, with optional delete mmgc contains a page allocator called gcheap, which allocates large blocks (megabytes) of memory from the system and doles out 4kb pages to the unmanaged memory allocator (fixedmalloc) and the managed memory allocator (gc).
... each instance manages its own set of objects; objects are not allowed to reference objects in other gc instances.
...And 43 more matches
Details of the object model - JavaScript
a prototype-based language, such as javascript, does not make this distinction: it simply has objects.
... a prototype-based language has the notion of a prototypical object, an object used as a template from which to get the initial properties for a new object.
...in addition, any object can be associated as the prototype for another object, allowing the second object to share the first object's properties.
...And 43 more matches
HTML: A good basis for accessibility - Learn web development
for example, a control button to play a video on your site could be marked up like this: <div>play video</div> but as you'll see in greater detail later on, it makes sense to use the correct element for the job: <button>play video</button> not only do html <button>s have some suitable styling applied by default (which you will probably want to override), they also have built-in keyboard accessibility — users can navigate between buttons using the tab key and activate their selection using return or enter.
... note: it is a good idea to have a screen reader set up on your local computer so that you can do some testing of the examples shown below.
...this cannot be ignored, as it is one of the main places that accessibility is badly broken if not handled properly.
...And 42 more matches
HTML: A good basis for accessibility - Learn web development
for example, a control button to play a video on your site could be marked up like this: <div>play video</div> but as you'll see in greater detail later on, it makes sense to use the correct element for the job: <button>play video</button> not only do html <button>s have some suitable styling applied by default (which you will probably want to override), they also have built-in keyboard accessibility — users can navigate between buttons using the tab key and activate their selection using return or enter.
... note: it is a good idea to have a screen reader set up on your local computer so that you can do some testing of the examples shown below.
...this cannot be ignored, as it is one of the main places that accessibility is badly broken if not handled properly.
...And 42 more matches
nsIDocShell
do not create an instance directly.
...note that out-of-process browsers do not have an nsidocshell; instead you can access the nsidocshell object from a frame script.
...atitle, in domstring aurl, in boolean areplace); void beginrestore(in nsicontentviewer viewer, in boolean top); void createaboutblankcontentviewer(in nsiprincipal aprincipal); void createloadinfo(out nsidocshellloadinfo loadinfo); void detacheditorfromwindow(); violates the xpcom interface guidelines void finishrestore(); void firepagehidenotification(in boolean isunload); native code only!
...And 42 more matches
CSS property compatibility table for form controls - Learn web development
no the property simply doesn't work or is so inconsistent that it's not reliable.
... 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.
...And 41 more matches
Localization content best practices
note: if you're a localizer and you want to contribute to the localization of mozilla products, you might want to read our localization quick start guide for information on localizing mozilla code.
... note on localizers mozilla localizers are volunteers with very diverse technical skills: some of them rely exclusively on translation tools, others prefer to work directly with text editors and don't have problems working with vcs systems.
... 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 ids if you're adding new strings, check that you're not duplicating an existing id.
...And 41 more matches
JSAPI User Guide
but mozilla's javascript engine is a library that can be linked into any c++ program, not just a browser.
... note: the foss wiki page contains a few links to other libraries and programs that can make life easier when using spidermonkey and jsapi.
...but in mozilla, all of these features are actually provided by other components, not the spidermonkey engine itself.
...And 40 more matches
nsINavBookmarksService
faces.nsinavbookmarksservice); method overview void addobserver(in nsinavbookmarkobserver observer, in boolean ownsweak); void beginupdatebatch(); obsolete since gecko 1.9 void changebookmarkuri(in long long aitemid, in nsiuri anewuri); long long createdynamiccontainer(in long long aparentfolder, in autf8string aname, in astring acontractid, in long aindex); note: renamed from createcontainer in gecko 1.9 obsolete since gecko 13.0 long long createfolder(in long long aparentfolder, in autf8string name, in long index); void endupdatebatch(); obsolete since gecko 1.9 void exportbookmarkshtml(in nsifile file); obsolete since gecko 1.9 nsiuri getbookmarkedurifor(in nsiuri auri); void getbookmarkfolderstarray(in nsi...
...obsolete since gecko 1.9 void getbookmarkidsforuri(in nsiuri auri, [optional] out unsigned long count, [array, retval, size_is(count)] out long long bookmarks); note: renamed from getbookmarkfolders in gecko 1.9 void getbookmarkidsforuritarray(in nsiuri auri, in print64array aresult); native code only!
...note: renamed from bookmarksroot in gecko 1.9 placesroot long long the item id of the top-level folder that contains bookmarks, tags and all other places data.
...And 40 more matches
EventTarget.addEventListener() - Web APIs
listener the object that receives a notification (an object that implements the event interface) when an event of the specified type occurs.
...if a passive listener does call preventdefault(), the user agent will do nothing other than generate a console warning.
...events that are bubbling upward through the tree will not trigger a listener designated to use capture.
...And 40 more matches
Debugger.Object - Firefox Developer Tools
the referent's properties do not appear directly as properties of the debugger.object instance; the debugger can access them only through methods like debugger.object.prototype.getownpropertydescriptor and debugger.object.prototype.defineproperty, ensuring that the debugger will not inadvertently invoke the referent's getters and setters.
...if the referent is an anonymous function, or not a function at all, this is undefined.
...if the referent is not a function, or if it has no display name, this is undefined.
...And 38 more matches
Example and tutorial: Simple synth keyboard - Web APIs
we will be programmatically constructing the keyboard, because doing so gives us the flexibility to configure each key as we determine the appropriate data for the corresponding note.
...for now, we will have two controls: one to set the master volume and another to select what periodic waveform to use when generating notes.
... wavepicker is the <select> element used to choose the waveform to use for the notes.
...And 38 more matches
Grammar and types - JavaScript
let früh = "foobar" but, the variable früh is not the same as früh because javascript is case sensitive.
... a semicolon is not necessary after a statement if it is written on its own line.
...(for more information, see the detailed reference about javascript's lexical grammar.) it is considered best practice, however, to always write a semicolon after a statement, even when it is not strictly needed.
...And 38 more matches
JavaScript modules - JavaScript
a background on modules javascript programs started off pretty small — most of its usage in the early days was to do isolated scripting tasks, providing a bit of interactivity to your web pages where needed, so large scripts were generally not needed.
...to change preferences in firefox, visit about:config.opera android full support 45safari ios full support 10.3samsung internet android full support 8.0nodejs full support 13.2.0notes full support 13.2.0notes notes modules must either have a filename ending in .mjs, or the nearest parent package.json file must contain "type": "module".
... full support 12.0.0notes disabled notes modules must either have a filename ending in .mjs, or the nearest parent package.json file must contain "type": "module".
...And 38 more matches
Web video codec guide - Web media technologies
not only is the required storage space enormous, but the network bandwidth needed to transmit an uncompressed video like that would be enormous, at 249 mb/sec—not including audio and overhead.
... most video codecs are lossy, in that the decoded video does not precisely match the source.
...additionally, in saturated portions of the image (that is, where colors are pure and intense, such as a bright, pure red [rgba(255, 0, 0, 1)]), color depths below 10 bits per component (10-bit color) allow banding, where gradients cannot be represented without visible stepping of the colors.
...And 38 more matches
XUL accessibility guidelines - Archive of obsolete content
accessibility is not difficult, but does require a basic understanding of the different types of disabilities, commonly used assistive technologies, and special accessibility features built into the xul languages.
...the column picker and column headers in xul trees are not keyboard accessible, consistent with the standard tree behavior on most contemporary operating systems.
...because column headers and the column picker, in the upper right hand corner of the tree, can not receive focus, they are not operable with a keyboard.
...And 37 more matches
Drawing graphics - Learn web development
this however was still not enough.
... 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.
... if you save and load your example in a browser now, you'll see nothing, which is fine, but you'll also see scrollbars — this is a problem for us, which happens because the <body> element has a margin that, added to our full-window-size canvas, results in a document that's wider than the window.
...And 37 more matches
Gecko info for Windows accessibility vendors
the other differences are not important).
...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.
... k-meleon: a light, ultra-fast and more advanced (fully configurable) gecko-based web browser available on the windows platform xul-based clients (support msaa) xul-based clients make full use of the gecko architecture, not only for html content, as well as for menus, dialogs and the entire user interface via an xml language called xul (extensible user-interface language).
...And 37 more matches
Mozilla Web Developer FAQ
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.
... 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.
...And 37 more matches
nsIFaviconService
note: this is an asynchronous operation; when it completes, a "places-favicons-expired" notification is dispatched through the observer's service.
... getfavicondata() obsolete since gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) note: this method was removed in gecko 22.0.
... exceptions thrown ns_error_not_available thrown when we have never heard of this favicon url.
...And 37 more matches
nsITextInputProcessor
for example, the implementation of this interface manages modifier state and composition state, initializes dom events from minimum information, and doesn't dispatch some events if they are not necessary.
... this means that even when gecko changes the dom event behavior, it may not be necessary that the users of this interface need to be updated, i.e., the implementation of this class can be a cushion from the impact of gecko's change.
... createinstance(components.interfaces.nsitextinputprocessor); next, you need to get the rights to create composition or dispatch keyboard events with begininputtransaction() or begininputtransactionfortests(): if (!tip.begininputtransaction(window, callback)) { return; } if begininputtransaction() or begininputtransactionfortests() returns false, it means that another instance of nsitextinputprocessor has composition on the window or is dispatching an event.
...And 37 more matches
HTML attribute: rel - HTML: Hypertext Markup Language
WebHTMLAttributesrel
link link not allowed author author of the current document or article.
... link link not allowed bookmark permalink for the nearest ancestor section.
... not allowed link not allowed canonical preferred url for the current document.
...And 37 more matches
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
it can have the following values: 17 hidden global attributes, html, reference the hidden global attribute is a boolean attribute indicating that the element is not yet, or is no longer, relevant.
... 23 itemref attribute, global attribute, html, html microdata, microdata, reference properties that are not descendants of an element with the itemscope attribute can be associated with an item using the global attribute itemref.
...note that it is recommended for styles to be defined in a separate file or files.
...And 37 more matches
Appendix: What you should know about open-source software licenses - Archive of obsolete content
appendix: what you should know about open-source software licenses draft this page is not complete.
... understanding copyright all software licenses, not just open source, enforce their terms based on copyright.
... duplication: copying a piece of software distribution: passing a piece of software to another person modification: modifying the software a typical software license will grant these permissions in return for a fee, and will still restrict some normally unrestricted uses.
...And 36 more matches
JXON - Archive of obsolete content
jxon (lossless javascript xml object notation) is a generic name by which is defined the representation of javascript objects using xml.
... if you want a complete bidirectional jxon library (modelled on the json global object), skip to the dedicated paragraph (but please read the note about the const statement compatibility).
... note: if you are interested to address only some parts of an xml document (and are not starting in javascript/json for templating purposes), use xpath instead of converting the whole document into json.
...And 36 more matches
Anatomy of a video game - Game development
not surprisingly, this pattern corresponds to how a game engine is programmed.
... but it might not need per-frame control.
...if something looks like it should be attached to a more infrequent event then it is often a good idea to break it out of the main loop (but not always).
...And 36 more matches
TypeScript support in Svelte - Learn web development
note that our application is fully functional and porting it to typescript is completely optional.
...even if you are not planning to adopt it, this article will be useful for allowing you to learn what it has to offer and help you make your own decision.
... if you are not interested 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.
...And 36 more matches
XPIDL
note: starting in gecko 9.0, the older xpidl utility, which was previously used to generate c++ header files, typelib information, and so forth has been replaced with pyxpidl in the gecko sdk.
... xpidl:syntax (now up to date again) xpidl syntax (out of date) xpidl author's guide (not as out of date) explanation of idl semantics a full guide to the syntax can be found at xpidl:syntax, which is written in an abnf form.
...the following is the correspondence table: table 1: standard idl types idl c++ in parameter c++ out parameter js type notes boolean bool bool* boolean char char char* string only chars in range \u0000-\u00ff permitted double double double* number float float float* number long int32_t int32_t* number long long int64_t int64_t* number octet uint8_t uint8_t* number ...
...And 36 more matches
Web Accessibility: Understanding Colors and Luminance - Accessibility
how the viewer perceives color after it gets to his eyes is yet another matter, and can be affected by overall health.
... when speaking of color contrast, w3c formulas are actually incorporating luminance, not just the colors ("hues") themselves.
... the srgb color space the mdn document, <color> notes "the css data type represents a color in the srgb color space." color has many ways of being defined, including rgb, rgb decimal, rgb percent, hsl, cmyk among others.
...And 36 more matches
HTTP response status codes - HTTP
WebHTTPStatus
if you receive a response that is not in this list, it is a non-standard response, possibly custom to the server's software.
... 202 accepted the request has been received but not yet acted upon.
...it is intended for cases where another process or server handles the request, or for batch processing.
...And 36 more matches
Install Manifests - Archive of obsolete content
required property reference your install manifest must specify these properties correctly otherwise your add-on may not install.
...you should not use a real email address for your id, however, as it might attract spam.
... note: the id property is optional in a webextension.
...And 35 more matches
The Implementation of the Application Object Model - Archive of obsolete content
as of 2007, we're trying to rely less on rdf, not more.
...the second section describes the xul/rdf architecture itself and outlines enhancements to the xul language in order to allow the markup language to reference local data and to indicate how and when it would like to be annotatable with local data.
...rdf can suck up data from different places (like your bookmarks and history or another web site), and it can combine them.
...And 35 more matches
Introduction to SSL - Archive of obsolete content
note: firefox 2 ships with ssl 2.0 support disabled by default, in favor of ssl 3.0.
...that way, when a domestic client or server is dealing with another domestic server or client, respectively, it will negotiate the use of the strongest ciphers available.
... red hat console does not support all of the cipher suites supported by red hat clients and servers.
...And 35 more matches
Client-side form validation - Learn web development
if it gets to the server and is then rejected, a noticeable delay is caused by a round trip to the server and then back to the client-side to tell the user to fix their data.
... however, client-side validation should not be considered an exhaustive security measure!
... go to any popular site with a registration form, and you will notice that they provide feedback when you don't enter your data in the format they are expecting.
...And 35 more matches
JIT Optimization Outcomes
genericfailure the optimization attempt failed, and the reason was not recorded.
... notypeinfo optimization failed because there was no type information associated with an object containing the property.
... unknownobject the type of the object is not known.
...And 35 more matches
nsIZipWriter
file and directory names should use slashes ("/") as separators and should not begin with a slash.
... note: although it is not necessary to add directory entries in order to add file entries within them, some zip utilities may have problems with that, so it may be best to add the directory entries explicitly first.
... exceptions thrown ns_error_not_initialized if no zip file has been opened.
...And 35 more matches
BluetoothRemoteGATTDescriptor - Web APIs
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).
... full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only.
...And 35 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
because javascript is notorious for being the world's most misunderstood programming language.
...see this example: console.log(3 / 2); // 1.5, not 1 console.log(math.floor(3 / 2)); // 1 so an apparent 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.
...And 35 more matches
Handling common JavaScript problems - Learn web development
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).
...if you are not already familiar with the basics of troubleshooting javascript, you should study that article before moving on.
...are defined in the correct scope, and you are not running into conflicts between items declared in different places (see function scope and conflicts).
...And 34 more matches
Introducing a complete toolchain - Learn web development
note: it's also worth repeating that not all of these tools need to be run on the command line.
... you may not be familiar with all the above features and tools or what they are doing, but don't panic — we'll explain each part as we move through this article.
... netlify is a hosting service for static websites (that is, websites that entirely consist of files that do not change in real time), which lets us deploy multiple times a day and freely hosts static sites of all kinds.
...And 34 more matches
Places utilities for JavaScript
utils.js is accessible at the following url: http://mxr.mozilla.org/mozilla-centr...ntent/utils.js this file includes utility functions used by a lot of the bookmarking, tagging, and annotation services that are built into firefox.
...its not an interface, and as such it will never be frozen, but it provides some easy to use functions that can save you from reinventing the wheel and cluttering up your own classes/functions when you need it.
...these just take in the node, as the interface is already defined: asvisit(anode) asfullvisit(anode) ascontainer(anode) asquery(anode) annotations a few annotation names are defined here.
...And 34 more matches
URLs - Plugins
in addition, gecko may support urls not listed on this table.
... wysiwyg placed before another url; displays a page that javascript has updated using document.write.
... getting urls posting urls getting urls to retrieve a url and display it on a specified target page, use the npn_geturl, npn_geturlnotify, and npp_urlnotify functions.
...And 34 more matches
Browser detection using the user agent - HTTP
but browsers and standards are not perfect, and there are still some edge cases where detecting the browser is needed.
...also, experts, or simply people with another point of view, can give you ideas for working around the bug.
...in addition, it is not practical to test every one of the less popular browsers and test for them.
...And 34 more matches
MathML Accessibility in Mozilla
mozilla and nvda developers essentially do not have control on how mathematical formulas are read, please contact design science for any inquiries.
...note that voiceover is proprietary so we do not have control on improvements to mathml accessibility in voiceover.
...note that this is still very experimental.
...And 33 more matches
Plug-in Basics - Plugins
notice in view-source that this information is simply gathered from the javascript.
...unlike a plug-in, a helper application runs separately from the browser in its own application space and does not interact with the browser or the web.
...a plug-in consumes no resources other than disk space when it is not loaded.
...And 33 more matches
Using XMLHttpRequest - Web APIs
if this argument is true or not specified, the xmlhttprequest is processed asynchronously, otherwise the process is handled synchronously.
...do not use synchronous requests outside web workers.
... note: starting with gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27), synchronous requests on the main thread have been deprecated due to the negative effects to the user experience.
...And 33 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
WebHTTPCORS
another article for server developers discussing cross-origin sharing from a server perspective (with php code snippets) is supplementary reading.
... cors failures result in errors, but for security reasons, specifics about the error are not available to javascript.
... apart from the headers automatically set by the user agent (for example, connection, user-agent, or the other headers defined in the fetch spec as a “forbidden header name”), the only headers which are allowed to be manually set are those which the fetch spec defines as a “cors-safelisted request-header”, which are: accept accept-language content-language content-type (but note the additional requirements below) dpr downlink save-data viewport-width width the only allowed values for the content-type header are: application/x-www-form-urlencoded multipart/form-data text/plain no event listeners are registered on any xmlhttprequestupload object used in the request; these are accessed using the xmlhttprequest.upload property.
...And 33 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
mappings, so that you can access your files with custom paths such as: resource://myaddon/filename.ext chrome://myaddon/content/filename.ext step 2: no more resource:// uris for files internal to your bundle unfortunately, resource mappings in your chrome.manifest were not usable in restartless add-ons until mozilla finally fixed this bug in firefox 38, which looked bad, but only because mozilla is still using resource:// uris internally and in examples.
...however, because it was implemented first for only file:// and resource:// but not chrome://, everyone who learned of this new feature learned that you had to load jsm from resource:// uris and just stuck with that forever.
...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).
...And 32 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
alwaysopenpopup obsolete since gecko 1.9.1 type: boolean note: applies to: thunderbird and seamonkeyif true, the autocomplete popup will be displayed even when there are no matches.
... autofill obsolete since gecko 1.9.1 type: boolean note: applies to: thunderbird and seamonkeyif 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.
...And 32 more matches
Index - Learn web development
14 common questions codingscripting, infrastructure, learn, web, webmechanics this section of the learning area is designed to provide answers to common questions that may come up, which are not necessarily part of the structured core learning pathways (e.g.
...yes, it seems obvious, but too many projects fail not from a lack of technical know-how, but from lack of goals and vision.
... beginner, webmechanics, cost, hosting, web development tools when launching a website, you may spend nothing, or your costs may go through the roof.
...And 32 more matches
Working with Svelte stores - Learn web development
in this article we will show another way to handle state management in svelte — stores.
...components can subscribe to stores and receive notifications when their values change.
... objective: learn how to use svelte stores using stores we will create an alert component that shows notifications on screen, which can receive messages from any component.
...And 32 more matches
Mozilla accessibility architecture
we do not currently support the carbon accessibility model for apple's os x.
... please note, the documentation for implementing an msaa server has moved.
...for example, tables support nsiaccessibletable, text supports nsiaccessibletext and edit boxes support nsieditabletext., although this code has been moved into the atk specific directories because it is not currently used in windows.
...And 32 more matches
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
nss does not use all the features of later versions of pkcs #11.
...other certificates on the token are also loaded (to allow building certificate chains), but it's not necessary to include the full chain, as long as the full chain is available in the regular certificate database.
...nss falls back to looking for for the existance of public keys to determine if the token may have the corresponding private key while the token is not logged in.
...And 32 more matches
PKCS #11 Module Specs
note that case must be preserved in the values.
... if the library is not specified, the line represents some application specific meta configuration data.
... if the name is not specified, the application can use the library path to describe the pkcs #11 library in any ui it may have.
...And 32 more matches
JavaScript Daemons Management - Archive of obsolete content
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.
...And 31 more matches
Gecko Compatibility Handbook - Archive of obsolete content
** notes ** - the solution quick reference needs more attention.
... while they support the css 1 standard to some degree, the implementations are not complete and have non-standard features added.
... set up browsers for testing the various gecko-based browsers do not always contain netscape in the user-agent string.
...And 31 more matches
Graceful asynchronous programming with Promises - Learn web development
since getusermedia() has to ensure that the user has permission to use those devices and ask the user which microphone to use and which camera to use (or whether to be a voice-only call, among other possible options), it can block until not only all of those decisions are made, but also the camera and microphone have been engaged.
... also, the user may not respond immediately to these permission requests.
...obviously, that's not an acceptable option; without promises, everything in the browser becomes unusable until the user decides what to do about the camera and microphone.
...And 31 more matches
Handling common HTML and CSS problems - Learn web development
in other cases, nascent features are not supported consistently across browsers, which can make some features and styles not work for some users.
... in our debugging html and debugging css articles, we provided some really basic guidance on debugging html/css — if you are not familiar with the basics, you should definitely study these articles before carrying on.
... note: one common problem with css and html arises when different css rules begin to conflict with one another.
...And 31 more matches
Eclipse CDT
therefore, it is not recommended for use if your machine only has 4 gb of ram.
... installing eclipse regarding llvm4eclipsecdt, do not install or select this toolchain for mozilla development.
... download "eclipse ide for c/c++ developers" (not eclipse ide for enterprise java developers) from the eclipse download page, install it, and add the directory containing the eclipse binary to your path (/applications/eclipse.app/contents/eclipse/ on mac).
...And 31 more matches
nsIContentPolicy - Archive of obsolete content
warning: do not block the caller in your implementations of shouldload() 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.
...rincipal 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.
...And 30 more matches
Hacking Tips
it is separated in 2 parts, one section related to debugging and another section related to drafting optimizations.
... many of these tips only apply to debug builds of the js shell; they will not function in a release build.
...note that some functions have been moved under an 'os' object, and help(os) will give brief help on just the members of that "namespace".
...And 30 more matches
Basic concepts - Web APIs
indexeddb is useful for applications that store a large amount of data (for example, a catalog of dvds in a lending library) and applications that don't need persistent internet connectivity to work (for example, mail clients, to-do lists, and notepads).
...so while you can access stored data within a domain, you cannot access data across different domains.
...while both indexeddb and websql are solutions for storage, they do not offer the same functionalities.
...And 30 more matches
Introduction to client-side frameworks - Learn web development
the web became not just a place to read things, but to do things.
...react itself is not technically a framework; it's a library for rendering ui components.
... we've discussed the environment that inspired the creation of frameworks, but not really why developers felt the need to make them.
...And 29 more matches
Mozilla MathML Status
the sections are marked with their current status: supported, in progress, and not currently supported.
... sections related to semantics/content mathml or irrelevant features are left blank or not listed at all.
... attribute notes display implemented.
...And 29 more matches
Web Replay
this has the same effect as above but can be used when the developer tools are not open.
... this feature has had little testing or polishing and there is not yet a good definition of 'reasonably similar'.
...logpoints cannot have side-effects or diverge from the recording in any othe way in this mode.
...And 29 more matches
Introduction to XPCOM for the DOM
warning: this document has not yet been reviewed by the dom gurus, it might contain some errors.
... important note: this document assumes some knowledge of c++, specially the object-oriented part of it.
...you do not, however, need to know all the hairy details, if you just intend to read the code or to work with the existing framework.
...And 29 more matches
Debugger - Firefox Developer Tools
code coverage reports are monotone, thus one can take a snapshot when the debugger is enabled, and output the difference.
... setting this to false prevents this debugger instance from requiring any code coverage instrumentation, but it does not guarantee that the instrumentation is not present.
...exceptions thrown in the debugger are not propagated to debuggee code; instead, spidermonkey calls this function, passingdebugger-exception as its sole argument and the debugger instance as the this value.
...And 29 more matches
Signaling and video calling - Web APIs
a form of discovery and media format negotiation must take place, as discussed elsewhere, in order for two devices on different networks to locate one another.
...through this third server, the two devices can locate one another, and exchange negotiation messages.
... note: if you try out the example on glitch, please note that any changes made to the code will immediately reset any connections.
...And 29 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
the first and most important thing to understand when considering the code to manage point-of-view and cameras in your application is this: webxr does not have cameras.
...note: most diagrams used in this article to show how the camera moves while performing standard movements was taken from an article on the filmmakeriq web site; namely, from this image which is found all over the web, however, and though we assume these are under a permissive license due to their frequent reuse, ownership is not certain.
... we hope that it's freely usable; if not, and you're the owner, please let us know and we'll find or produce new diagrams.
...And 29 more matches
<input type="url"> - HTML: Hypertext Markup Language
WebHTMLElementinputurl
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.
...more specifically, there are two possible value formats that will pass validation: an empty string ("") indicating that the user did not enter a value or that the value was removed.
...mber of characters the input should accept minlength the minimum number of characters long the input can be and still be considered valid pattern a regular expression the input's contents must match in order to be valid placeholder an exemplar value to display in the input field whenever it is empty readonly a boolean attribute indicating whether or not the contents of the input should be read-only size a number indicating how many characters wide the input field should be spellcheck controls whether or not to enable spell checking for the input field, or if the default spell checking configuration should be used list the values of the list attribute is the id of a <datalist> element located in the same document.
...And 29 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
this mcd (aka autoconfig here), is not to be confused with https://wiki.mozilla.org/thunderbird...oconfiguration .
... file location (not tested since 2012 ...) in thunderbird , firefox, the javascript preference file that calls the centralized preference file is located in $install_dir_moz_app/defaults/pref, for example in thunderbird this would be repectively for windows/linux: c:\program files\mozilla thunderbird\defaults\pref /usr/lib/thunderbird/default/pref ( it used to be in /usr/lib/thunderbird-version#/default/pref as ...
...do not use the name all.js because it is reserved.
...And 28 more matches
Command line options
comma separators must not follow or precede spaces ( ).
...in some cases, option arguments must be enclosed in quotation marks (this is noted in the option descriptions below).
...depending on changes between the two versions, some files in a profile may not be downwards compatible.
...And 28 more matches
Performance best practices for Firefox front-end engineers
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.
...it's also important to note that most of our javascript runs on the main thread, so it's easy for script to cause delays in event processing or painting.
... use requestidlecallback() if you simply cannot avoid doing some kind of long job on the main thread, try to break it up into smaller pieces that you can run when the browser has a free moment to spare, and the user isn't doing anything.
...And 28 more matches
Shell global objects
note: this list overlaps with "built-in functions" in introduction to the javascript shell and is probably not complete.
... elementattributename if present and not undefined, the name of property of element that holds this code.
... sourceislazy if present and true, indicates that, after compilation, script source should not be cached by the js engine and should be lazily loaded from the embedding as-needed.
...And 28 more matches
Component; nsIPrefBranch
aobserver the object to be notified if the preference changes.
... note: this method does nothing if the prefbranch it is called on is a default branch.
... remarks note: prior to gecko 6.0, this method would throw an exception if there was no user value set for the specified preference.
...And 28 more matches
Mozilla
android-specific test suites there are several android-specific test suites that run on the firefox for android codebase: api change rules until further notice, the following rules govern api changes: application cache implementation overview this happens in nshttpchannel::opencacheentry().
... cookies preferences in mozilla these preferences apply to most mozilla products (including firefox and seamonkey), however they are application-specific, so not all of them may apply to you.
... creating a localized windows installer of seamonkey preamble: not all of the programs listed below are necessary.
...And 28 more matches
MediaDevices.getUserMedia() - Web APIs
if the user denies permission, or matching media is not available, then the promise is rejected with notallowederror or notfounderror respectively.
... note: it's possible for the returned promise to neither resolve nor reject, as the user is not required to make a choice at all and may simply ignore the request.
... let stream = null; try { stream = await navigator.mediadevices.getusermedia(constraints); /* use the stream */ } catch(err) { /* handle the error */ } } similarly, using the raw promises directly, the code looks like this: navigator.mediadevices.getusermedia(constraints) .then(function(stream) { /* use the stream */ }) .catch(function(err) { /* handle the error */ }); note: if the current document isn't loaded securely, navigator.mediadevices will be undefined, and you cannot use getusermedia().
...And 28 more matches
Regular expression syntax cheatsheet - JavaScript
for example, /.y/ matches "my" and "ay", but not "yes", in "yes make my day".
... note that the m multiline flag doesn't change the dot behavior.
... \d matches any character that is not a digit (arabic numeral).
...And 28 more matches
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.
...this logging of result changes is not done by default; it must be enabled with a flag.
...this logging of results can be very useful for debugging, but remember to remove this flag when you have finished and the template works correctly, as the logging can take up extra time that is not necessary when the template is working.
...And 27 more matches
Reference - Archive of obsolete content
in fx 1.0, js 1.2 is available, but not in the upcoming fx 1.5.
...once that is done, the various code samples should be updated to reflect current practices and code if they cannot be written in a "version-neutral" manner.
...-- dria 04:27, 22 september 2005 (pdt) those examples are not "bad examples" per se.
...And 27 more matches
Looping code - Learn web development
if not, the farmer spends an hour collecting two portions of food, and the loop runs again.
... often, the code will be slightly different on each successive iteration of the loop, which means that you can complete a whole load of tasks that are similar but slightly different — if you've got a lot of different calculations to do, you want to do each different one, not the same one over and over again!
...basic for loop example</title> <style> </style> </head> <body> <p></p> <script> const cats = ['bill', 'jeff', 'pete', 'biggles', 'jasmin']; let info = 'my cats are called '; const para = document.queryselector('p'); for (let i = 0; i < cats.length; i++) { info += cats[i] + ', '; } para.textcontent = info; </script> </body> </html> note: you can find this example code on github too (also see it running live).
...And 27 more matches
Making decisions in your code — conditionals - Learn web development
another set of curly braces, inside which we have some more code — this can be any code we like, and it only runs if the condition is not true — or in other words, the condition is false.
... this code is pretty human-readable — it is saying "if the condition returns true, run code a, else run code b" you should note that you don't have to include the else and the second curly brace block — the following is also perfectly legal code: if (condition) { code to run if condition is true } run some other code however, you need to be careful here — in this case, the second block of code is not controlled by the conditional statement, so it always runs, regardless of whether the condition returns true or false.
... this is not necessarily a bad thing, but it might not be what you want — often you want to run one block of code or the other, not both.
...And 27 more matches
Profiling with the Firefox Profiler
it can be used in a variety of situations where external profilers are not available, and can provide more information and insight into what the browser is doing.
...in addition to profiler.firefox.com, the firefox devtools have a simplified interface targeted towards web developers, but does not include as much information as the firefox profiler web app.
... tip: threads that are annotated with "[default]" are in the parent (aka "ui", aka "browser chrome", aka "main") process and those annotated with "[tab]" are in the web content (aka "child") processes.
...And 27 more matches
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/.
... const char *certreqfilename) { prbool validationfailed = pr_false; if (!subject) { pr_fprintf(pr_stderr, "%s -g -d %s -s: improperly formatted name: \"%s\"\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (!certreqfilename) { pr_fprintf(pr_stderr, "%s -g -d %s -s %s -r: certificate request file name not found\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (validationfailed) { fprintf(stderr, "\nusage: %s %s \n\n", progname, "-g -d <dbdirpath> -s <subject> -r <csr> \n"); exit(-1); } } /* * validate the options used for add cert to db command */ static void validateaddcerttodbcommand(const c...
... missing\n", progname, dbdir); validationfailed = pr_true; } if (!truststr) { pr_fprintf(pr_stderr, "%s -a -d %s -n %s -t: trust flag is missing\n", progname, dbdir, nicknamestr); validationfailed = pr_true; } if (!certfilename) { pr_fprintf(pr_stderr, "%s -a -d %s -n %s -t %s -c: certificate file name not found\n", progname, dbdir, nicknamestr, truststr, serialnumberstr, certreqfilename); validationfailed = pr_true; } if (pr_access(certfilename, pr_access_exists) == pr_failure) { if (!certreqfilename) { pr_fprintf(pr_stderr, "%s -a -d %s -n %s -t %s -c %s -r: certificate file or certificate request file is not found\n", ...
...And 27 more matches
An Overview of XPCOM
the goal of xpcom is to allow different pieces of software to be developed and built independently of one another.
... xpcom not only supports component software development, it also provides much of the functionality that a development platform provides, such as: component management file abstraction object message passing memory management we will discuss the above items in detail in the coming chapters, but for now, it can be useful to think of xpcom as a platform for component development, in which features suc...
... gecko is used in many internet applications, mostly browsers and most notably mozilla firefox.
...And 27 more matches
Getting Started Guide
if this is unfamiliar material, you're not ready for nscomptrs yet.
...that object cannot go away until the owning reference has relinquished its claim.
... not all references need to be owning references.
...And 27 more matches
Inheritance and the prototype chain - JavaScript
javascript is a bit confusing for developers experienced in class-based languages (like java or c++), as it is dynamic and does not provide a class implementation per se (the class keyword is introduced in es2015, but is syntactical sugar, javascript remains prototype-based).
...each object has a private property which holds a link to another object called its prototype.
...when trying to access a property of an object, the property will not only be sought on the object but on the prototype of the object, the prototype of the prototype, and so on until either a property with a matching name is found or the end of the prototype chain is reached.
...And 27 more matches
WAI-ARIA basics - Learn web development
the initial solution was to add one or more hidden links at the top of the page to link to the navigation (or whatever else), for example: <a href="#hidden" class="hidden">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.
...And 26 more matches
Positioning - Learn web development
previous overview: css layout next positioning allows you to take elements out of the normal document layout flow, and make them behave differently; for example sitting on top of one another, or always remaining in the same place inside the browser viewport.
... static positioning static positioning is the default that every element gets — it just means "put the element into its normal position in the document layout flow — nothing special to see here." to demonstrate this, and get your example set up for future sections, first add a class of positioned to the second <p> in the html: <p class="positioned"> ...
... note: you can see the example at this point live at 1_static-positioning.html (see source code).
...And 26 more matches
What went wrong? Troubleshooting JavaScript - Learn web development
types of error generally speaking, when you do something wrong in code, there are two main types of error that you'll come across: syntax errors: these are spelling errors in your code that actually cause the program not to run at all, or stop working part way through — you will usually be provided with some error messages too.
... logic errors: these are errors where the syntax is actually correct but the code is not what you intended it to be, meaning that program runs successfully but gives incorrect results.
... okay, so it's not quite that simple — there are some other differentiators as you drill down deeper.
...And 26 more matches
nsIURI
note: ipv6 addresses are not enclosed in square brackets.
... exceptions thrown ns_error_failure if host is not applicable to the uri scheme (e.g.
... about:blank) note: characters are not escaped.
...And 26 more matches
nsIWebProgressListener
note: for document requests, a second state_stop is generated (see the description of state_is_window for more details).
... state_negotiating 0x00000008 this flag is not used.
...these flags are not mutually exclusive (that is an onstatechange() event may indicate some combination of these flags).
...And 26 more matches
HTMLInputElement - Web APIs
formnovalidate boolean: returns / sets the element's formnovalidate attribute, indicating that the form is not to be validated when it is submitted.
... properties that apply to any type of input element that is not hidden name string: returns / sets the element's name attribute, containing a name that identifies the element when submitting the form.
... disabled boolean: returns / sets the element's disabled attribute, indicating that the control is not available for interaction.
...And 26 more matches
Using Service Workers - Web APIs
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.
...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: go to opera://flags and enable support for serviceworker; restart browser.
...And 26 more matches
Using media queries - CSS: Cascading Style Sheets
note: the examples on this page use css's @media for illustrative purposes, but the basic syntax remains the same for all types of media queries.
... note: a style sheet with a media query attached to its <link> tag will still download even if the query returns false.
... nevertheless, its contents will not apply unless and until the result of the query changes to true.
...And 26 more matches
<color> - CSS: Cascading Style Sheets
a <color> can be defined in any of the following ways: using a keyword (such as blue or transparent) using the rgb cubic-coordinate system (via the #-hexadecimal or the rgb() and rgba() functional notations) using the hsl cylindrical-coordinate system (via the hsl() and hsla() functional notations) note: this article describes the <color> data type in detail.
... 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.
...And 26 more matches
<textarea> - HTML: Hypertext Markup Language
WebHTMLElementtextarea
<textarea> does not support the value attribute.
...possible values are: off: the user must explicitly enter a value into this field for every use, or the document provides its own auto-completion method; the browser does not automatically complete the entry.
... if the autocomplete attribute is not specified on a <textarea> element, then the browser uses the autocomplete attribute value of the <textarea> element's form owner.
...And 26 more matches
Codecs used by WebRTC - Web media technologies
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.
...the sender is not required to support this mechanism, however, so you have to be prepared to receive media at a different resolution than you requested.
...And 26 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
note: if you want to contribute to this document please follow the guidelines on the contribute page.
... unlike languages with formal specifications that have been standardized by bodies like the w3c, xul currently does not have an explicit specification.
... note: although there is a specification document, its markup is based on implementations and markup as of 2001, and current xul differs from it in many aspects.
...And 25 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
crop type: boolean this attribute is not used and is only provided for compatibility with the menulist element.
... disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
...And 25 more matches
Introduction to automated testing - Learn web development
note: the above two categories are not mutually exclusive.
...note that node comes with node package manager (npm), which allows you to easily install packages, share your own packages with others, and run useful scripts on your projects.
...to update npm, use the following command in your terminal: npm install npm@latest -g note: if the above command fails with permissions errors, fixing npm permissions should sort you out.
...And 25 more matches
Command line crash course - Learn web development
since then, the terminal has remained a constant feature of all operating systems — from desktop machines, to servers tucked away in the cloud (it’s not really a cloud), to microcomputers like the raspberry pi zero, and even to mobile phones.
... anyway, the terminal is not going away anytime soon.
...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.
...And 25 more matches
Creating reftest-based unit tests
so, if the effect of complex markup is being tested, put that complex markup into a page and create another page that uses simple markup to achieve the same visual effect.
...if one has software that multiplies numbers, one wants a regression test to show that 2 * 2 continues to be calculated to be 4, not something similar to but not quite exactly 4.
...it is not invariant.
...And 25 more matches
source-editor.jsm
you must not directly import that code module; it is essentially an implementation detail.
... sourceeditor.prefs.expand_tab "devtools.editor.expandtab" a boolean value that indicates whether or not to automatically expand tabs out to a series of spaces.
...faults.contextmenu "sourceeditorcontextmenu" sourceeditor.defaults.expandtab true sourceeditor.defaults.highlightcurrentline true sourceeditor.defaults.initialtext "" sourceeditor.defaults.keys null sourceeditor.defaults.mode sourceeditor.modes.text sourceeditor.defaults.readonly false sourceeditor.defaults.showannotationruler false sourceeditor.defaults.showlinenumbers false sourceeditor.defaults.showoverviewruler false sourceeditor.defaults.tabsize 4 sourceeditor.defaults.theme sourceeditor.themes.mozilla sourceeditor.defaults.undolimit 200 event name constants these constants provide the names of the editor events for which you can li...
...And 25 more matches
Parser API
note: this page describes spidermonkey-specific behavior and might be incomplete.
...this string is not meaningful to the parsing process, but is produced as part of the source location information in the returned ast nodes.
... note: expression closures are spidermonkey-specific.
...And 25 more matches
nsINavBookmarkObserver
moved(in print64 folder, in print64 parent, in print32 index); obsolete since gecko 1.9 void onitemadded(in long long aitemid, in long long aparentid, in long aindex, in unsigned short aitemtype, in nsiuri auri, in autf8string atitle, in prtime adateadded, in acstring aguid, in acstring aparentguid); void onitemchanged(in long long aitemid, in acstring aproperty, in boolean aisannotationproperty, in autf8string anewvalue, in prtime alastmodified, in unsigned short aitemtype, in long long aparentid, in acstring aguid, in acstring aparentguid); void onitemmoved(in long long aitemid, in long long aoldparentid, in long aoldindex, in long long anewparentid, in long anewindex, in unsigned short aitemtype, in acstring aguid, in acstring aoldparentguid, in acstring anewpare...
...in long long aparentid, in acstring aguid, in acstring aparentguid); void onseparatoradded(in print64 parent, in print32 index); obsolete since gecko 1.9 void onseparatorremoved(in print64 parent, in print32 index); obsolete since gecko 1.9 methods onbeforeitemremoved() obsolete since gecko 21.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) note: this method was removed in gecko 21.0 as part of bug 826409.
... this method notifies this observer that an item is about to be removed.
...And 25 more matches
Using Web Workers - Web APIs
worker()) that runs a named javascript file — this file contains the code that will run in the worker thread; workers run in another global context that is different from the current window.
... note: see the web workers api landing page for reference documentation on workers and additional guides.
... note: notice that onmessage and postmessage() need to be hung off the worker object when used in the main script thread, but not when used in the worker.
...And 25 more matches
<input type="email"> - HTML: Hypertext Markup Language
WebHTMLElementinputemail
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.
...more specifically, there are three possible value formats that will pass validation: an empty string ("") indicating that the user did not enter a value or that the value was removed.
...upport the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum number of characters the input should accept minlength the minimum number of characters long the input can be and still be considered valid multiple whether or not to allow multiple, comma-separated, e-mail addresses to be entered pattern a regular expression the input's contents must match in order to be valid placeholder an exemplar value to display in the input field whenever it is empty readonly a boolean attribute indicating whether or not the contents of the input should be read-only size a number indica...
...And 25 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
if the content, layout, and functionality need to change greatly for different devices, it may not be such a good approach.
... fluid grids the best place to start is with fluid measurements for our application layout — essentially, this means using a combination of percentages and ems/rems to size your containers and text, not fixed widths such as pixels.
... note: you can find the snapshot app on github; check out the code and help improve it.
...And 25 more matches
Enhanced Extension Installation - Archive of obsolete content
it forces it to have write access to the firefox directory in order to be installed, which may not always be the case.
... there is no clean uninstall procedure, as the -install-global-extension flag was designed only as a means to install items for all user profiles, not as a means for third party installers to register their components.
... the system for installation, upgrade and uninstall is not robust enough.
...And 24 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
draft this page is not complete.
... due to deprecation of enableprivilege this functionality can not be used in web pages.
... note: if you're developing components in c++ or other compiled languages, be sure to include binaries for every platform.
...And 24 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.
...in february 2000 iplanet e-commerce solutions (a sun-netscape alliance) released source code through mozilla.org for the personal security manager and network security services software; this source code included support for the ssl protocol, but due to the rsa patent and related legal issues it did not originally contain code for rsa or other cryptographic algorithms.
...s/mime support is also under development, but may not be available in mozilla until after the 1.0 release.
...And 24 more matches
Elements - Archive of obsolete content
please do not edit only on the basis of another xbl specification.
... notes in the current stable releases of mozilla products (e.g.
...keep in mind that the binding is still required to have an id even though you're not referencing it.
...And 24 more matches
UI pseudo-classes - Learn web development
:checked, :indeterminate, and :default: respectively target checkboxes and radio buttons that are checked, in an indeterminate state (neither checked or not checked), and the default selected option when the page loads (e.g.
...some of the others are aimed at solving very specific niche problems, or simply not very well supported in browsers yet.
... 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 controlling validation constraints in our next article — client-side form validation — but for now we'll keep things simple with regards to form validation, so it doesn't confuse things.
...And 24 more matches
Document and website structure - Learn web development
basic sections of a document webpages can and will look pretty different from one another, but they all tend to share similar standard components, unless the page is displaying a fullscreen video or game, is part of some kind of art project, or is just badly structured: header: usually a big strip across the top with a big heading, logo, and perhaps a tagline.
... this usually stays the same from one webpage to another.
...like the header, this content usually remains consistent from one webpage to another — having inconsistent navigation on your website will just lead to confused, frustrated users.
...And 24 more matches
What is JavaScript? - Learn web development
(okay, not everything, but it is amazing what you can achieve with a few lines of javascript code.) the three layers build on top of one another nicely.
...px; display: inline-block; cursor: pointer; } and finally, we can add some javascript to implement dynamic behaviour: const para = document.queryselector('p'); para.addeventlistener('click', updatename); function updatename() { let name = prompt('enter a new name'); para.textcontent = 'player 1: ' + name; } try clicking on this last version of the text label to see what happens (note also that you can find this demo on github — see the source code, or run it live)!
... note: many of the above demos won't work in an older browser — when experimenting, it's a good idea to use a modern browser like firefox, chrome, edge or opera to run your code in.
...And 24 more matches
Displaying Places information using views
note: starting in gecko 2.0, you can't use the place attribute with menus.
...for simple queries whose uris do not change over the life of the view, you might specify the place attribute directly in the xul.
...note that in the latter case it is not sufficient to call setattribute on the element; use the element's place property instead.
...And 24 more matches
Optimizing Applications For NSPR
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.
... multiplatform do not call any blocking system call from a local thread.
...therefore, if you call a blocking system call from the primordial thread, it is going to block more than just the primordial thread and the system may not function correctly.
...And 24 more matches
NSS API Guidelines
the areas which need the most work (both here and throughout the code) is: the relationship of the certificate library with just about every other component (most noticeably pkcs #12, pkcs #7, and pkcs #11) splitting low key and high key components more clearly the crypto wrappers (pkcs #11 wrappers) and high key pkcs #12 and pkcs #5 libraries nss compiles into the libraries described below.
... low cert lib/certdb cdbhdl.h, certdb.h, cert.h, certt.h certhi provides high-level certificate-related functions, that do not access the certificate database, nor individual certificate data directly.
... note: it's not necessary all eight files exist.
...And 24 more matches
attr() - CSS: Cascading Style Sheets
WebCSSattr
note: the attr() 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.
...it is not reparsed, and in particular the characters are used as-is instead of css escapes being turned into different characters.
... relative url are resolved relatively to the original document, not relatively to the style sheet.
...And 24 more matches
Event reference
dom events are sent to notify code of interesting things that have taken place.
...events can represent everything from basic user interactions to automated notifications of things happening in the rendering model.
... focus events event name fired when focus an element has received focus (does not bubble).
...And 24 more matches
New Security Model for Web Services - Archive of obsolete content
if the file is not there, access is denied.
...these scripts may legitimately require access to external resources, but permitting them to access internal resources permits the compromise of these resources that would normally not be available to applications outside of the firewall.
... same source restriction by restricting sandboxed scripts to access only resources in the domain from which they were loaded, any script loaded from one domain into another is prevented from accessing resources in the domain into which it has been loaded.
...And 23 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
caveats: aol time warner's compuserve browser, also based on netscape gecko, does not support xpinstall.
... netscape communicator 4.x does not support xpinstall.
...the use of javascript as the install logic is not unprecedented in netscape browsers.
...And 23 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
(see the note below on why it runs "as soon as possible" and not "immediately".) more on why you might want to do this later.
... note: the specified amount of time (or the delay) is not the guaranteed time to execution, but rather the minimum time to execution.
... the callbacks you pass to these functions cannot run until the stack on the main thread is empty.
...And 23 more matches
Inheritance in JavaScript - Learn web development
how do we create an object in javascript that inherits from another object?
...i\'m ' + this.name.first + '.'); }; note: in the source code, you'll also see bio() and farewell() methods defined.
...cher() constructor function the first thing we need to do is create a teacher() constructor — add the following below the existing code: function teacher(first, last, age, gender, interests, subject) { person.call(this, first, last, age, gender, interests); this.subject = subject; } this looks similar to the person constructor in many ways, but there is something strange here that we've not seen before — the call() function.
...And 23 more matches
Setting up your own test automation environment - Learn web development
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.
...to install selenium-webdriver, run the following command, making sure you are inside your project folder: npm install selenium-webdriver note: it is still a good idea to follow these steps even if you previously installed selenium-webdriver and downloaded the browser drivers.
... note: just to reiterate, the path you add to path needs to be the path to the directory containing the drivers, not the paths to the drivers themselves!
...And 23 more matches
Accessibility API cross-reference
the ipc mechanisms used by current generation api's are also not cross-platform, although communication for some cross-platform accessibility api of the future could be done through sockets.
...the roles it specifies have already informed the 'semantic elements' of html5 (such as main and footer), but there is not a one-to-one mapping between the aria roles and the semantics of html5.
...aria abstract roles should not be used by content authors.
...And 23 more matches
Storage access policy: Block cookies from trackers
this documentation describes the policy that we intend to ship to firefox release users, but may not match what is implemented in the current release version of firefox.
...firefox nightly may also contain experimental features that we don't yet plan to ship to release users; experimental features will not be included in this documentation, but may nevertheless impact the functionality of domains classified as trackers.
...as described above, note that nightly may include additional protections that end up getting removed or changed before they reach our release users.
...And 23 more matches
sample2
if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/.
...cation-----" #define ns_sig_header "-----begin signature-----" #define ns_sig_trailer "-----end signature-----" #define ns_cert_header "-----begin certificate-----" #define ns_cert_trailer "-----end certificate-----" /* missing publically from nss versions earlier than 3.13 */ #ifndef sec_error_base #define sec_error_base (-0x2000) typedef enum { sec_error_io = sec_error_base + 0, sec_error_token_not_logged_in = (sec_error_base + 155), sec_error_end_of_list } secerrorcodes; #endif /* port_errortostring introduced in nss 3.13.
...st char *progname, const char *dbdir, certname *subject, const char *subjectstr, const char *certreqfilename) { prbool validationfailed = pr_false; if (!subject) { pr_fprintf(pr_stderr, "%s -g -d %s -s: improperly formatted name: \"%s\"\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (!certreqfilename) { pr_fprintf(pr_stderr, "%s -g -d %s -s %s -r: certificate request file name not found\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (validationfailed) { fprintf(stderr, "\nusage: %s %s \n\n", progname, "-g -d <dbdirpath> -s <subject> -r <csr> \n"); exit(-1); } } /* * validate the options used for add cert to db command */ static void validateaddcerttodbcommand(const char *progname, const char *dbdir, const char *nicknamestr, const char *truststr, const c...
...And 23 more matches
JIT Optimization Strategies
note: this page is an in-progress documentation of jit optimization strategies planned to support the "jit coach" feature intended for inclusion in firefox developer tools.
...the function containing the arguments.length is allowed to use the arguments object in the following ways without disabling this optimization: access arguments.length access arguments.callee access individual 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.
...in particular, arguments cannot be returned from the function, or passed as an argument into calls (except for the apply case above).
...And 23 more matches
IAccessibleText
other-licenses/ia2/accessibletext.idlnot scriptable a structure containing a substring and the start and end offsets in the enclosing string.
...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.
...And 23 more matches
nsIHttpChannel
n acstring header, in acstring value, in boolean merge); void visitoriginalresponseheaders(in nsihttpheadervisitor avisitor); void visitrequestheaders(in nsihttpheadervisitor avisitor); void visitresponseheaders(in nsihttpheadervisitor avisitor); constants constant description referrer_policy_no_referrer_when_downgrade default; indicates not to pass on the referrer when downgrading from https to http referrer_policy_no_referrer indicates no referrer will be sent referrer_policy_origin only send the origin of the referring uri referrer_policy_origin_when_xorigin same as the default; only send the origin of the referring uri for cross-origin requests referrer_policy_unsafe_url always send...
... the referrer, even when downgrading from https to http attributes attribute type description allowpipelining boolean this attribute is a hint to the channel to indicate whether or not the underlying http transaction should be allowed to be pipelined with other transactions.
... note: an http redirect results in a new channel being created.
...And 23 more matches
nsINavHistoryQueryOptions
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).
...And 23 more matches
Reference Manual
null-dereference safeguards an nscomptr will also assert at runtime if you try to dereference it when it is void, e.g., nscomptr<nsifoo> foo; // note: default initialized to |0| foo->dosomething(); // ns_precondition: "you can't dereference a null nscomptr with operator->()" a similar precondition intervenes on behalf of operator*.
... reference-counting safeguards all of the operations that extract the underlying raw pointer out of an nscomptr use a c trick to implement another safety feature.
... the pointer returned cannot be addrefed, released, or deleted.
...And 23 more matches
Drag Operations - Web APIs
this document does not use the datatransferitem interface nor the datatransferitemlist interface.
...if this attribute were omitted or set to "false", the element would not be dragged, and instead the text would be selected.
... note: when an element is made draggable, text or other elements within it can no longer be selected in the normal way by clicking and dragging with the mouse.
...And 23 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
these should be on separate lines, starting with the string note.
... it is important to not use "extra" blank lines within a cue, for example between the timings line and the cue payload.
...comments are intended for those reading the file and are not seen by users.
...And 23 more matches
<input type="search"> - HTML: Hypertext Markup Language
WebHTMLElementinputsearch
mber of characters the input should accept minlength the minimum number of characters long the input can be and still be considered valid pattern a regular expression the input's contents must match in order to be valid placeholder an exemplar value to display in the input field whenever it is empty readonly a boolean attribute indicating whether or not the contents of the input should be read-only size a number indicating how many characters wide the input field should be spellcheck controls whether or not to enable spell checking for the input field, or if the default spell checking configuration should be used list the values of the list attribute is the id of a <datalist> element located in the same document.
...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.
...And 23 more matches
HTML elements reference - HTML: Hypertext Markup Language
WebHTMLElement
metadata for styles and scripts may be defined in the page or link to another file that has the information.
... <meta> the html <meta> element represents metadata that cannot be represented by other html meta-related elements, like <base>, <link>, <script>, <style> or <title>.
...usually, this is rendered visually by indentation (see notes for how to change it).
...And 23 more matches
Functions - JavaScript
the statement return specifies the value returned by the function: return number * number; primitive parameters (such as a number) are passed to functions by value; the value is passed to the function, but if the function changes the value of the parameter, this change is not reflected globally or in the calling function.
... such a function can be anonymous; it does not have to have a name.
...1 : n * fac(n - 1) } console.log(factorial(3)) function expressions are convenient when passing a function as an argument to another function.
...And 23 more matches
Assertions - JavaScript
do not forget to edit it as well, thanks!
...for example, /^a/ does not match the "a" in "an a", but does match the first "a" in "an a".
...for example, /t$/ does not match the "t" in "eater", but does match it in "eat".
...And 23 more matches
Working with objects - JavaScript
you access the properties of an object with a simple dot-notation: objectname.propertyname like all javascript variables, both the object name (which could be a normal variable) and property name are case sensitive.
...r.make = 'ford'; mycar.model = 'mustang'; mycar.year = 1969; the above example could also be written using an object initializer, which is a comma-delimited list of zero or more pairs of property names and associated values of an object, enclosed in curly braces ({}): var mycar = { make: 'ford', model: 'mustang', year: 1969 }; unassigned properties of an object are undefined (and not null).
... mycar.color; // undefined properties of javascript objects can also be accessed or set using a bracket notation (for more details see property accessors).
...And 23 more matches
Web audio codec guide - Web media technologies
common codecs the list below denotes the codecs most commonly used on the web and which containers (file types) support them.
...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 23 more matches
Understanding WebAssembly text format - WebAssembly
note: this is potentially overkill if you are a web developer who just wants to load a wasm module into a page and use it in your code (see using the webassembly javascript api), but it is more useful if for example, you want to write wasm modules to optimize the performance of your javascript library, or build your own webassembly compiler.
... if we convert our module to binary now (see converting webassembly text format to wasm), we’ll see just the 8 byte module header described in the binary format: 0000000: 0061 736d ; wasm_binary_magic 0000004: 0100 0000 ; wasm_binary_version adding functionality to your module ok, that’s not very interesting, let’s add some executable code to this module.
...it is worth noting here that: the absence of a (result) means the function doesn’t return anything.
...And 23 more matches
Tabbed browser - Archive of obsolete content
furthermore another meaning of 'browser' in this document and in some firefox source is "the tabbrowser element" in a firefox xul window.
... // gbrowser is only accessible from the scope of // the browser window (browser.xul) gbrowser.addtab(...); if gbrowser isn't defined your code is either not running in the scope of the browser window or running too early.
... if your code does not have access to the main window because it is run in a sidebar or dialog, you first need to get access to the browser window you need before you can use gbrowser.
...And 22 more matches
Layout System Overview - Archive of obsolete content
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.
...(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 css formatting requirements present two distinct layout models: 1) the in-flow model, where the geometry of an element is influenced by the geometry of the elements that precede it, and 2) the positioned model, where the geometry of an element is not influenced by the geometry of the elements that precede it, or in any case, is influenced more locally.
...And 22 more matches
LiveConnect Overview - Archive of obsolete content
note: because java is a strongly typed language and javascript is weakly typed, the javascript runtime engine converts argument values into the appropriate data types for the other language when you use liveconnect.
...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, if the helloworld class is directly in the classpath and not in a package, you can access it as follows: var red = new packages.helloworld(); the liveconnect java, sun, and netscape objects provide shortcuts for commonly used java packages.
...And 22 more matches
Strategies for carrying out testing - Learn web development
b grade: older/less capable browsers — known not to be capable.
... note: yahoo first made this approach popular, with their graded browser support approach.
...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.
...And 22 more matches
mach
mach itself is python 3 compliant, but modules used by mach likely are not python 3 compliant - so stick to python 2.7.
... note: mach tab completion will not work when running mach in a source directory older than firefox 24.
... for zsh, you can call the built-in bashcompinit function before sourcing: autoload bashcompinit bashcompinit source /path/to/mozilla-central/python/mach/bash-completion.sh frequently asked questions why should i not use mach?
...And 22 more matches
Exact Stack Rooting
since c++ does not reliably distinguish between storage classes, we have to put this burden on the user.
...do not use js_setprivate.
...the private field is frequently used to store things that are not gcpointers, so the gc cannot automatically handle this slot.
...And 22 more matches
Using XPCOM Utilities to Make Things Easier
since these macros expand into "generic" implementations, they may not offer as much flexibility as you have when you are writing your own implementation.
... the module macros include one set of macros that define the exported nsgetmodule entry point, the required nsimodule implementation code and another that creates a generic factory for your implementation class.
... note that all of the macros described in this section are similar but are used in slightly different situations.
...And 22 more matches
nsIChannel
note: as of gecko 19.0, this parameter changed from long to int64_t.
... note: the content type can often be wrongly specified (for example wrong file extension, wrong mime type, wrong document type stored on a server and so on.), and the caller most likely wants to verify with the actual data.
... notificationcallbacks nsiinterfacerequestor the notification callbacks for the channel.
...And 22 more matches
nsINavHistoryObserver
methods onbeforedeleteuri() obsolete since gecko 21.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) note: this method was removed in gecko 21.0 as part of bug 826409.
... note: the page does not necessarily have to have ever existed for this function to be called.
... delete notifications aren't quite 100% accurate.
...And 22 more matches
nsIWindowWatcher
inherits from: nsisupports last changed in gecko 0.9.6 usage notes: this component has an activewindow property.
...this component should not keep a (xpcom) reference to any windows; the implementation will claim no ownership.
... windows must notify this component when they are created or destroyed, so only a weak reference is kept.
...And 22 more matches
DirectoryEntrySync - Web APIs
this interface has been abandonned: it was on a standard track and it proves not a good idea.
... do not use it anymore.
...if you try to create a directory using a full path that includes parent directories that do not exist yet, you get an error.
...And 22 more matches
WebGL best practices - Web APIs
webgl is a complicated api, and it's often not obvious what the recommended ways to use it are.
... this page tackles recommendations across the spectrum of expertise, and not only highlights dos and don'ts, but also details why.
...when using webgl extensions, if possible, try to make them optional by gracefully adapting to the case there they are not supported.
...And 22 more matches
Advanced techniques: Creating and sequencing audio - Web APIs
note: you can find the source code on github as step-sequencer; see the step-sequencer running live also.
...when they are enabled the note will sound.
...ociated web audio api feature "sweep" oscillator, periodic wave oscillatornode, periodicwave "pulse" multiple oscillators oscillatornode "noise" random noise buffer, biquad filter audiobuffer, audiobuffersourcenode, biquadfilternode "dial up" loading a sound sample to play audiocontext.decodeaudiodata(), audiobuffersourcenode note: this instrument was not created to sound good, it was created to provide demonstration code and represents a very simplified version of such an instrument.
...And 22 more matches
<input type="number"> - HTML: Hypertext Markup Language
WebHTMLElementinputnumber
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.
...the text must not include carriage returns or line feeds.
...And 22 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
WebHTMLElementvideo
note: sites that automatically play audio (or videos with an audio track) can be an unpleasant experience for users, so should be avoided when possible.
... to disable video autoplay, autoplay="false" will not work; the video will autoplay if the attribute is there in the <video> tag at all.
... autopictureinpicture a boolean attribute which if true indicates that the element should automatically toggle picture-in-picture mode when the user switches back and forth between this document and another document or application.
...And 22 more matches
Using the application cache - HTML: Hypertext Markup Language
the browser does not cache pages without the manifest attribute, unless such pages are listed in the manifest file.
... you do not need to list all pages you want cached in the manifest file, the browser implicitly adds every page that the user visits and that has the manifest attribute set to the application cache.
... some browsers (e.g., firefox) display a notification bar the first time a user loads an application that uses the application cache.
...And 22 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
draft this page is not complete.
... preference description value nglayout.debug.disable_xul_cache (not present in firefox 3.5+) ordinarily, firefox will cache xul documents after they have been read in once, to speed subsequent displays.
... true browser.dom.window.dump.enabled (not present in firefox 3.5+) enables use of the dump method for debugging.
...And 21 more matches
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
moreover, code using eval is harder to parse for a human mind, is often pretty complex, and relies on assumptions that are not necessarily true in the future or even now.
... add-on authors are strongly encouraged to update their code to eliminate all instances of eval, no matter if the add-on is to be hosted in the mozilla add-ons gallery or not.
...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!
...And 21 more matches
Install script template - Archive of obsolete content
fication: http://mozilla.org/projects/plugins/plugin-identifier.html **/ // define some global variables var plugin_file = "npmyplugin.dll"; // this plugin consists of an xpt file because it is scriptable // http://mozilla.org/projects/plugins/scripting-plugins.html var component_file = "npmypluginscriptable.xpt"; var plugin_size = 2000; // (dll file) reserve a little extra so it is not required to update too often var component_size = 10; // (xpi file) reserve a little extra so it is not required to update too often var software_name="cult3d mozilla viewer"; // plids (http://mozilla.org/projects/plugins/plugin-identifier.html) are coined by vendors.
...codes when we try and do a secondary installation var errblock2 = 0; // global variable containing our secondary install location var secondaryfolder; //special error values used by the cycore developers (www.cycore.com) who helped make this install script var exceptionoccurederror = -4711; var winregisnullerror = -4712; var invalidrootkeyerror = -4713; var registrykeynotwritableerror = -4714; //initinstall block //the installation is initialized here -- if we fail here, cancel the installation // initinstall is quite an overloaded method, but i have invoked it here with three strings // which are globally defined err = initinstall(software_name, plid, version); if (err != 0) { // call initinstall again in case illegal characters in plid err = initinstall...
... browser block var pluginsfolder = getfolder("plugins"); //verify disk space if(verifydiskspace(pluginsfolder, plugin_size+component_size)) { // start installing plugin shared library reseterror(); // install the plugin shared library to the current browser's plugin directory errblock1 = addfile (plid, version, plugin_file, pluginsfolder, null); if (errblock1!=0) { logcomment("could not add " + plugin_file + " to " + pluginsfolder + ":" + errblock1); cancelinstall(errblock1); } // start installing xpt file if this is a scriptable plugin // install to the plugins directory -- this works well in mozilla 1.0 clients // in mozilla 1.0 clients, the components directory can be avoided for xpt files errblock1 = addfile (plid, version, component_file, pluginsfolder, null); if...
...And 21 more matches
panel - Archive of obsolete content
ArchiveMozillaXULpanel
it does not have any window decorations.
... warning: for firefox versions between 3.6 and 4.0, placing an iframe, browser or editor inside a panel is not supported.
... consumeoutsideclicks type: boolean controls whether or not the event that caused the popup to be automatically dismissed (or "rolled up") should be consumed or be dispatched as a normal event.
...And 21 more matches
Mozilla release FAQ - Archive of obsolete content
no guarantee of factuality in this faq is made, and it is maintained by pat gunn, who is not affiliated with netscape.
...webpages mozilla project homepage netscape developer program website mozillazine (news service) mozilla evangelism effort mozdev projects irc server: irc.mozilla.org channel #mozillazine note that recent versions of mozilla include an irc client.
...here are a few that are specific to the mozilla newsgroups: fe = front end -- the part of mozilla that handles the interface be = back end -- the part of mozilla that does all the behind-the-scenes stuff nspr = netscape portable runtime -- an abstraction layer over the local os gtk = a free gui toolkit native to unix qt = another gui toolkit xp = cross platform xpfe = cross-platform frontend based on nglayout m[number] = milestone release [number] (no longer used) i'm wondering how to do xxx with navigator 3.x...
...And 21 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
tamper detection allows the recipient of information to verify that it has not been modified in transit.
...in the context of network interactions, authentication involves the confident identification of one party by another party.
... client and server authentication are not the only forms of authentication that certificates support.
...And 21 more matches
Using the Right Markup to Invoke Plugins - Archive of obsolete content
if the flash activex control is not installed, ie will then go to the url referenced by the codebase attribute and retrieve the activex control.
...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.
...And 21 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.
... it is worth noting that autoplay with sound is allowed if: the user has interacted with the domain.
... note: playing part of your file at zero volume could also work if the browser allows you to change volume (see below).
...And 21 more matches
Getting started with HTML - Learn web development
html (hypertext markup language) is not a programming language.
...the enclosing tags can make content into a hyperlink to connect to another page, italicize words, and so on.
... for example, consider the following line of text: my cat is very grumpy if we wanted the text to stand by itself, we could specify that it is a paragraph by enclosing it in a paragraph (<p>) element: <p>my cat is very grumpy</p> note: tags in html are case-insensitive.
...And 21 more matches
Introduction to events - Learn web development
note: event handlers are sometimes called event listeners — they are pretty much interchangeable for our purposes, although strictly speaking, they work together.
... note: web events are not part of the core javascript language — they are defined as part of the apis built into the browser.
... the example output is as follows: it's not just web pages another thing worth mentioning at this point is that events are not unique to javascript — most programming languages have some kind of event model, and the way the model works often differs from javascript's way.
...And 21 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
you'll notice that the array is successfully updated every time you press the button (the todo objects' completed properties are toggled between true and false), but svelte is not aware of that.
... sometimes svelte cannot detect changes to variables being watched.
... note: if foo is a top level variable, you can easily tell svelte to update obj whenever foo is changed with the following reactive statement: $: foo, obj = obj.
...And 21 more matches
Chrome registration
note: with gecko 1.9.2 and older, mozilla reads chrome/*.manifest files from applications.
... note: scripts (including those found in xbl) loaded from skin packages will not execute.
... locale packagename localename path/to/files skin packagename skinname path/to/files note: the characters @ # ; : ?
...And 21 more matches
Debugging on Mac OS X
debugging firefox on macos 10.14+ macos 10.14 introduced notarization and hardened runtime features for improved application security.
... macos 10.15 went further, requiring applications to be notarized with hardened runtime enabled in order to launch (ignoring workarounds.) when run on earlier macos versions, notarization and hardened runtime settings have no effect.
... official builds at this time, official builds of firefox 69 and later are notarized.
...And 21 more matches
NSS tools : signtool
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.
...if the -c# option is not used with either the -j or the -z option, the default compression value used by both the -j and -z options is 6.
...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 multiple file types or classes to include.
...And 21 more matches
Component Internals
another, even more basic view of this relationship of components to the files and interfaces that define them is shown in onion peel view of xpcom component creation in the next chapter.
...another application may delay this startup until xpcom is needed for the first time.
... xpcom sends a notification that it's beginning startup.
...And 21 more matches
nsIWindowsRegKey
key hkey this attribute exposes the native hkey and is available to provide c++ consumers with the flexibility of making other windows registry api calls that are not exposed via this interface.
... warning: setting the key does not close() the old key.
...this interface is not restricted to using only these root keys.
...And 21 more matches
Drawing and Event Handling - Plugins
a windowless plug-in does not require a native window.
... note: windowless plug-ins were not supported on the x window system platform prior to gecko 1.9 alpha 7 (bug 137189).
... note: when a plug-in is drawn to a window, the plug-in is responsible for preserving state information and ensuring that the original state is restored.
...And 21 more matches
background-size - CSS: Cascading Style Sheets
spaces not covered by a background image are filled with the background-color property, and the background color will be visible behind background images that have transparency/translucency.
...*/ /* the width of the image (height becomes 'auto') */ background-size: 50%; background-size: 3.2em; background-size: 12px; background-size: auto; /* two-value syntax */ /* first value: width of the image, second value: height */ background-size: 50% auto; background-size: 3em 25%; background-size: auto 6px; background-size: auto auto; /* multiple backgrounds */ background-size: auto, auto; /* not to be confused with `auto auto` */ background-size: 50%, 25%, 25%; background-size: 6px, auto, contain; /* global values */ background-size: inherit; background-size: initial; background-size: unset; the background-size property is specified in one of the following ways: using the keyword values contain or cover.
...negative values are not allowed.
...And 21 more matches
<input type="tel"> - HTML: Hypertext Markup Language
WebHTMLElementinputtel
unlike <input type="email"> and <input type="url"> , the input value is not automatically validated to a particular format before the form can be submitted, because formats for telephone numbers vary so much around the world.
... note: browsers that don't support type tel fall back to being a standard text input.
...s a valid input minlength the minimum length that is considered valid for the field's contents pattern a regular expression the entered value must match to pass constraint validation placeholder an example value to display inside the field when it has no value readonly a boolean attribute which, if present, indicates that the field's contents should not be user-editable size the number of characters wide the input field should be onscreen list the values of the list attribute is the id of a <datalist> element located in the same document.
...And 21 more matches
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
draft this page is not complete.
... tools for extension developers fixme: are we sure we'll talking about venkman since it's not well maintained fixme: we maybe should talk about firebug and chromebug fixme: and what about console 2 and docked-js console?
...it works like typical debuggers, and is useful not only for developing extensions, but also for general web development.
...And 20 more matches
Intercepting Page Loads - Archive of obsolete content
note: performance is very important when it comes to add-ons and page loads.
...we store the handler function in a private variable because later we want to remove it when we do not need it anymore.
...you can close the tab, redirect the tab to about:blank or another page, or tell the browser to stop loading this page, but in general you don't want to do this because it will be visible to the user and it will look like a bug.
...And 20 more matches
Fundamental text and font styling - Learn web development
text content effectively behaves like a series of inline elements, being laid out on lines adjacent to one another, and not creating line breaks until the end of the line is reached, or unless you force a line break manually using the <br> element.
... note: if the above paragraph leaves you feeling confused, then no matter — go back and review our box model article, to brush up on the box model theory, before carrying on.
... note: bear in mind that the text inside an element is all affected as one single entity.
...And 20 more matches
Debugging HTML - Learn web development
debugging isn't scary when writing code of some kind, everything is usually fine, until that dreaded moment when an error occurs — you've done something wrong, so your code doesn't work — either not at all, or not quite how you wanted it to.
... html and debugging html is not as complicated to understand as rust.
... html is not compiled into a different form before the browser parses it and shows the result (it is interpreted, not compiled).
...And 20 more matches
Images in HTML - Learn web development
in this article we'll look at how to use it in depth, including the basics, annotating it with captions using <figure>, and detailing how it relates to css background images.
... prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, familiarity with html fundamentals (as covered in getting started with html.) objective: to learn how to embed simple images in html, annotate them with captions, and how html images relate to css background images.
... note: you should read a quick primer on urls and paths to refresh your memory on relative and absolute urls before continuing.
...And 20 more matches
Functions — reusable blocks of code - Learn web development
previous overview: building blocks next another essential concept in coding is functions, which allow you to store a piece of code that does a single task inside a defined block, and then call that code whenever you need it using a single short command — rather than having to type out the same code multiple times.
...in fact, we've been using functions all the way through the course so far; we've just not been talking about them very much.
... pretty much anytime you make use of a javascript structure that features a pair of parentheses — () — and you're not using a common built-in language structure like a for loop, while or do...while loop, or if...else statement, you are making use of a function.
...And 20 more matches
Package management basics - Learn web development
without modern build tools, dependencies like this might be included in your project using a simple <script> element, but this might not work right out of the box and you will likely need some modern tooling to bundle your code and dependencies together when they are released on the web.
...this is not too painful for a couple of dependencies, but in larger projects with many dependencies this kind of thing can become really challenging to keep track of.
... in theory you may not need a package manager and you could manually download and store your project dependencies, but a package manager will seamlessly handle installing and uninstalling packages.
...And 20 more matches
Mozilla DOM Hacking Guide
mozilla gives you the opportunity not only to use very powerful and complete dom support, but also to work on a world-class implementation of one of the greatest internet technologies ever created.
...the goals of class info are twofold: interface flattening, and implementing behaviors that are not possible with idl alone.
...this is because, if we had a setlocation() method, it would take an nsidomlocation parameter, and not a url string.
...And 20 more matches
XPCOM array guide
MozillaTechXPCOMGuideArrays
this array is read-only, and the interface does not provide any methods that will allow adding and removing members.
...note that this class differs from the other array types by using unsigned indices.
... nsisupportsarray xpcom object yes no yes* no reference counted, strong (*) note: concrete c++ arrays can be made read-only by declaring them const.
...And 20 more matches
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: 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.
...And 20 more matches
nsIPrincipal
void checkmayload(in nsiuri uri, in boolean report); void disablecapability(in string capability, inout voidptr annotation); native code only!
... void enablecapability(in string capability, inout voidptr annotation); native code only!
... void getpreferences(out string prefbranch, out string id, out string subjectname, out string grantedlist, out string deniedlist, out boolean istrusted); boolean iscapabilityenabled(in string capability, in voidptr annotation); native code only!
...And 20 more matches
Node - Web APIs
WebAPINode
most notable are document, element, and documentfragment.
...these include attr, characterdata (which text, comment, and cdatasection are all based on), processinginstruction, documenttype, notation, entity, and entityreference.
... in some cases, a particular feature of the base node interface may not apply to one of its child interfaces; in that case, the inheriting node may return null or throw an exception, depending on circumstances.
...And 20 more matches
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
we’ll find out which specifications you also need to take notice of if you want to learn flexbox, and find out why flexbox is different to some other modules.
... note: css versions 1 and 2 were a single monolithic specification where all of css was defined in one large document.
...this specification details how alignment works in all layout — not just flexbox.
...And 20 more matches
Value definition syntax - CSS: Cascading Style Sheets
a component can be a keyword, some characters considered as a literal, or a value of a given css data type or of another css property.
...they are not shown in the value definition, and are implicitly defined.
... data type not sharing the same name of a property.
...And 20 more matches
Index - HTTP
WebHTTPHeadersIndex
(by languages, we mean natural languages, such as english, and not programming languages.) using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the content-language response header.
...caching directives are unidirectional, meaning that a given directive in a request is not implying that the same directive is to be given in the response.
... 21 connection http, headers, reference, web the connection general header controls whether or not the network connection stays open after the current transaction finishes.
...And 20 more matches
Image file type and format guide - Web media technologies
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.
... apng is ideal for basic animations that do not need to synchronize to other activities or to a sound track, such as progress indicators, activity throbbers, and other animated sequences.
... note: you should typically avoid using bmp for web site content, as it's not a generally-accepted use of the format.
...And 20 more matches
Introduction to using XPath in JavaScript - XPath
note that, if the xpathexpression contains a namespace prefix, this will result in a domexception being thrown with the code namespace_err.
... note: xpath defines qnames without a prefix to match only elements in the null namespace.
...to match default elements in a non-null namespace, you either have to refer to a particular element using a form such as ['namespace-uri()='http://www.w3.org/1999/xhtml' and name()='p' and @id='_myid'] (this approach works well for dynamic xpath's where the namespaces might not be known) or use prefixed name tests, and create a namespace resolver mapping the prefix to the namespace.
...And 20 more matches
Preferences - Archive of obsolete content
note: this article doesn't cover all available methods for manipulating preferences; please refer to the xpcom reference pages listed in resources section for the complete list of methods.
... the interfaces dealing with preferences are fairly well documented, so using the methods not mentioned here should be straightforward.
...var value = prefs.getboolpref("typeaheadfind"); // get a pref (accessibility.typeaheadfind) prefs.setboolpref("typeaheadfind", !value); // set a pref (accessibility.typeaheadfind) complex types as noted in the previous section, each entry in the preferences database (prefs.js) must have a string, an integer, or a boolean value.
...And 19 more matches
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
extension code using internal linkage will need to migrate to use frozen linkage because internal linkage will not be available in firefox 3.
...nsstringapi.h" on windows, if you see the following error, you are including a header you shouldn't be: nsstringfwd.h(60) : fatal error c1001: internal compiler error to debug this error, make in the failing directory, adding the /showincludes directive to figure out what is being included incorrectly: make -c directory/that/failed os_cppflags=-showincludes the frozen string api is similar but not identical to the nonfrozen string api.
... the frozen string api does not have (or need) nsxpidlstring: - nsxpidlstring value; + nsstring value; ptr->gettermethod(getter_copies(value)); - const prunichar *strvalue = value; + // nsstring doesn't cast directly to prunichar*, use .get()+ const prunichar *strvalue = value.get(); the frozen string api doesn't accept a length for .truncate().
...And 19 more matches
tabbrowser - Archive of obsolete content
note: starting in firefox 3 (xulrunner/gecko 1.9), this is only used in the main firefox window and cannot be used in other xul windows by third-party applications or extensions.
...contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocumentviewer, securityui, selectedbrowser, selectedtab, sessionhistory, tabcontainer, tabs, visibletabs, webbrowserfind, webnavigation, webprogress methods addprogresslistener, addtab, addtabsprogresslistener,appendgroup, getbrowseratindex, getbrowserindexfordocument, getbrowserfordocument, getbrowserfortab, geticon, getnotificationbox, gettabforbrowser, gettabmodalpromptbox, goback, gobackgroup, goforward, goforwardgroup, gohome, gotoindex, loadgroup, loadonetab, loadtabs, loaduri, loaduriwithflags, movetabto, pintab, reload, reloadalltabs, reloadtab, reloadwithflags, removealltabsbut, removecurrenttab, removeprogresslistener, removetab, removetabsprogresslistener,replacegroup, selecttabatindex, seticon, showonlyth...
... onbookmarkgroup not in firefox type: script code this code executes when the user chooses the "bookmark this group of tabs" command.
...And 19 more matches
textbox - Archive of obsolete content
note that decimal numbers are stored as floats.
... disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
...And 19 more matches
Implementation Status - Archive of obsolete content
mozilla xforms is not actively maintained any more since about 2010!
...the sections are marked with their current status: supported, partial support, in progress, and not currently supported.
...document structure section title status notes bugs 3.1 namespaces supported 3.2.1 common attributes supported 3.2.2 linking attributes supported 3.2.3 single-node binding attributes supported 3.2.4 node-set binding attributes supported 3.2.5 model item property attributes partial in some cases a loop error can occur on valid bindings 302168; 3.3.1 model support...
...And 19 more matches
CSS and JavaScript accessibility best practices - Learn web development
objective: to gain familiarity with using css and javascript appropriately in your web documents to maximise accessibility and not detract from it.
...to put it another way, it is important that you consider some best practice advice to make sure that your use of css and javascript doesn't ruin the accessibility of your documents.
...e web: <p>visit the <a href="https://www.mozilla.org">mozilla homepage</a>.</p> some very simple link styling is shown below: a { color: #ff0000; } a:hover, a:visited, a:focus { color: #a60000; text-decoration: none; } a:active { color: #000000; background-color: #a60000; } the standard link conventions are underlined and a different color (default: blue) in their standard state, another color variation when the link has previously been visited (default: purple), and yet another color when the link is activated (default: red).
...And 19 more matches
The HTML5 input types - Learn web development
note: most of the features discussed in this article have wide support across browsers.
... we'll note any exceptions.
... you can also use the multiple attribute in combination with the email input type to allow several email addresses to be entered in the same input (separated by commas): <input type="email" id="email" name="email" multiple> on some devices — notably, touch devices with dynamic keyboards like smart phones — a different virtual keypad might be presented that is more suitable for entering email addresses, including the @ key.
...And 19 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
{todo.name} (id: {todo.id}) </li> {:else} nothing to do here!
...} </label> </div> <div class="btn-group"> <button type="button" class="btn"> edit <span class="visually-hidden">{todo.name}</span> </button> <button type="button" class="btn btn__danger"> delete <span class="visually-hidden">{todo.name}</span> </button> </div> </div> </li> {:else} <li>nothing to do here!</li> {/each} </ul> notice how we are using curly braces to embed javascript expressions in html attributes, like we did with the checked and id attributes of the checkbox.
... working with props with a hardcoded list of todos, our todos component is not very useful.
...And 19 more matches
Eclipse CDT Manual Setup
setup time some points in the rest of this document below are old and taken care of by the mach commands described above (although some of the project configuration is not done automatically yet).
...if that is not the case, then get your build going now so that it can be running while you continue with the instructions below.
...if relative paths are used to specify the source file or any of its include paths (common in mozilla), and if you fail to take steps to make sure the build output specifies which directory the compiler is invoked from, this will not be possible.
...And 19 more matches
Download
contenttype string the mime type of the download, for example "text/plain", or null if the mime type is not available.
... note: you shouldn't rely on this property being equal to totalbytes to determine whether the download is completed.
... you should use the individual state properties instead, since this value may not be updated after the last piece of data is transferred.
...And 19 more matches
NSS tools : certutil
the certificate database should already exist; if one is not present, this command option will initialize one by default.
...if this argument is not used, certutil prompts for a filename.
...some smart cards (for example, the litronic card) do not let you remove a public key you have generated.
...And 19 more matches
WebReplayRoadmap
we would like to use web replay to radically improve not just the debugging experience but the entire web development experience.
... this requires scanning the recording and the console will not update immediately.
... object watching (not yet implemented) it would be nice to log the changes to a specific object or one of its properties, so that the points of those changes can be seeked to later.
...And 19 more matches
Redis Tips
time complexity - each command's complexity is given in big-o notation.
... if you have not, here is a fantastic on-line, interactive redis tutorial: http://try.redis.io/ for reference later on, you'll want the source of all things redis: https://redis.io you'll want to run a redis-server on your machine, and use the redis-cli at the command-line for hacking.
... node.js redis client: https://github.com/mranney/node_redis npm install redis python redis client: https://github.com/andymccurdy/redis-py there are some gotchas with the python api: https://github.com/andymccurdy/redis-py#api-reference select statement not implemented del is 'delete' in python zadd argument order is wrong setex argument order is wrong the default redis port is 6379.
...And 19 more matches
imgIDecoderObserver
1.0 66 introduced gecko 12.0 inherits from: imgicontainerobserver last changed in gecko 1.7 we make the distinction here between "load" and "decode" notifications.
... load notifications are fired as the image is loaded from the network or filesystem.
... decode notifications are fired as the image is decoded.
...And 19 more matches
Mail event system
mozilla mail requires an event system to notify different subsystems that data has changed.
...this interface is not (should not be) mail-related.
...when a notification is fired on a folder, all of the folder's folder listeners and the mail session itself is notified.
...And 19 more matches
Accessibility documentation index - Accessibility
5 aria annotations aria, accessibility, wai-aria, annotations, comments, details, suggestions wai-aria version 1.3 sees the addition of a set of new features, collectively known as aria annotations, which allow the creation of accessible annotations inside web documents.
... 7 aria live regions aria, accessibility, arialive using javascript, it is possible to dynamically change parts of a page without requiring the entire page to reload — for instance, to update a list of search results on the fly, or to display a discreet alert or notification which does not require user interaction.
... while these changes are usually visually apparent to users who can see the page, they may not be obvious to users of assistive technologies.
...And 19 more matches
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
WebHTMLElementaudio
note: sites that automatically play audio (or videos with an audio track) can be an unpleasant experience for users, so should be avoided when possible.
...if the server does not give credentials to the origin site (by not setting the access-control-allow-origin: http header), the image will be tainted, and its usage restricted.
...if the server does not give credentials to the origin site (through access-control-allow-credentials: http header), the image will be tainted and its usage restricted.
...And 19 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
WebHTMLElementimg
the image is in a format not supported by the user agent.
... 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 images (saving bandwidth, privacy reasons) the image is invalid or an unsupported type in these cases, the browser may replace the image with the text in the element's alt attribute.
...And 19 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
the control is intended to simply represent a local date and time, not necessarily the user's local date and time.
...some mobile browsers (particularly on ios) do not currently implement this correctly.
...another option is to use separate date and time inputs, each of which is more widely supported than datetime-local.
...And 19 more matches
<link>: The External Resource Link element - HTML: Hypertext Markup Language
WebHTMLElementlink
the rel stands for "relationship", and is probably one of the key features of the <link> element — the value denotes how the item being linked to is related to the containing document.
... other usage notes: a <link> element can occur either in the <head> or <body> element, depending on whether it has a link type that is body-ok.
...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.
...And 19 more matches
Link types - HTML: Hypertext Markup Language
list of the defined link types and their significance in html link type description allowed in these elements not allowed in these elements alternate if the element is <link> and the rel attribute also contains the stylesheet type, the link defines an alternative style sheet; in that case the title attribute must be present and not be the empty string.
... otherwise, the link defines an alternative page, of one of these types: for another medium, like a handheld device (if the media attribute is set) in another language (if the hreflang attribute is set), in another format, such as a pdf (if the type attribute is set) a combination of these <a>, <area>, <link> <form> archives defines a hyperlink to a document that contains an archive link to this one.
... note: although recognized, the singular archive is incorrect and must be avoided.
...And 19 more matches
Proxy Auto-Configuration (PAC) file - HTTP
in chrome (versions 52 to 73), you can disable this by setting pachttpsurlstrippingenabled to false in policy or by launching with the --unsafe-pac-url command-line flag (in chrome 74, only the flag works, and from 75 onward, there is no way to disable path-stripping; as of chrome 81, path-stripping does not apply to http urls, but there is interest in changing this behavior to match https); in firefox, the preference is network.proxy.autoconfig_url.include_path.
...the port number is not included in this parameter.
... notes: the javascript function should always be saved to a file by itself but not be embedded in a html file or any other file.
...And 19 more matches
context-menu - Archive of obsolete content
likewise, any items that were previously in the menu but are not bound to the current context are automatically removed from the menu.
... the page context first of all, you may not need to specify a context at all.
... when a top-level item does not specify a context, the page context applies.
...And 18 more matches
package.json - Archive of obsolete content
the package.json file contains manifest data for your add-on, providing not only descriptive information about the add-on for presentation in the add-ons manager, but other metadata required of add-ons.
... note: jpm supports nodejs people fields.
... note: this is deprecated along with cfx; it's not available when using jpm.
...And 18 more matches
The Essentials of an Extension - Archive of obsolete content
the enclosing brackets are just notation, and they're just common practice.
...the text is spaced to look like a table, but that is not necessary.
...notably, we can have entries that are os-specific.
...And 18 more matches
Menu - Archive of obsolete content
ArchiveMozillaJetpackUIMenu
note: this page documents the jetpack prototype, which has since been replaced by the add-on sdk.
... clear() removes all items from the menu, even items not added by the feature.
...(note that any falsey value will suffice, including undefined, null, and the empty string.
...And 18 more matches
Tamarin build documentation - Archive of obsolete content
note that additional command-line arguments are only available in the debug configuration.
...(gnu make 3.80 does not work.
...its options are '104u', '105' or '106' (note: no '.') if you don't pass the --mac-sdk switch you will get no sdk in your build.
...And 18 more matches
Custom toolbar button - Archive of obsolete content
(for seamonkey 1.x, see the page custom toolbar button:seamonkey.) you do not need any special technical skills or tools, and almost all the information you need is on this page.
... introduction the technique described here does not involve any hacking.
...note that this extension is very simplified.
...And 18 more matches
Writing Skinnable XUL and CSS - Archive of obsolete content
css files that import another skin file are calledderived skin files.
... css files that don't import another skin file are calledbase skin files.
... there is one notable exception to this rule.
...And 18 more matches
toolbar - Archive of obsolete content
note: gecko 2.0 adds support for external toolbars.
... these are toolbars that are not children of a toolbox element.
... note: starting in gecko 1.9.1, toolbar items are moved from the toolbarpalette and added to the toolbar when a toolbar is first displayed.
...And 18 more matches
Properly Using CSS and JavaScript in XHTML Documents - Archive of obsolete content
xhtml is xml, not html one of the primary misunderstandings about xhtml is that it is just another version of html.
... 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.
...in particular: raw < and & characters are not allowed except inside of cdata sections (<![cdata[ ...
...And 18 more matches
RDF in Mozilla FAQ - Archive of obsolete content
unfortunately, not here!
...var ds = rdf.getdatasource("http://www.mozilla.org/some-rdf-file.rdf"); // note that ds will load asynchronously, so assertions will not // be immediately available alternatively, you can create one directly using the xpcom component manager, as the following code fragment illustrates: // create an rdf/xml datasource using the xpcom component manager var ds = components .classes["@mozilla.org/rdf/datasource;1?name=xml-datasource"] .createinstance(components.interfa...
...note that this will happen asynchronously.
...And 18 more matches
The Business Benefits of Web Standards - Archive of obsolete content
strict html (as opposed to the often-used transitional html markup), forces the designer not to use presentation tags in the html documents, naturally enforcing the separation of content from presentation.
...this translates into better user experience, according to usability guru jakob nielsen, who notes that users tend to close a web page when it takes more than 10 seconds to load.
...the number of sites which do not include proper titles and descriptions in the meta is surprising.
...And 18 more matches
Windows Media in Netscape - Archive of obsolete content
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.
...while the progid cannot be used to create a windows media player object that exposes all its properties and methods, it is useful for rapid detections.
...netscape 7.1 works with both windows media player 6.4 and with windows media players 7 and 9, but they have unique classids: windows media player 6.4 has this classid:22d6f312-b0f6-11d0-94ab-0080c74c7e95 windows media players 7 and 9 have this classid: 6bf52a52-394a-11d3-b153-00c04f79faa6 windows media player 6.4 and windows media player 7 and up are not backwards compatible in terms of apis (and thus have different classids).
...And 18 more matches
Basic native form controls - Learn web development
note: the features discussed in this article are supported in all browsers, which is not the case for all form controls.
... note: html form text fields are simple plain text input controls.
... this means that you cannot use them to perform rich editing (bold, italic, etc.).
...And 18 more matches
JavaScript basics - Learn web development
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.
... note: both of the features you used in this exercise are parts of the document object model (dom) api, which has the capability to manipulate documents.
...it's worth noting that these features are common to all programming languages.
...And 18 more matches
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.
... onsecuritychange notification called for security progress.
... note: these notifications will only occur if a security package is installed.
...And 18 more matches
Promise
a promise object represents a value that may not be available yet.
... internally, a promise can be in one of three states: pending, when the final value is not available yet.
... note: you should always handle, forward, or report errors (rejection reasons).
...And 18 more matches
Sqlite.jsm
since sqlite.jsm manages statements for you, it can perform intelligent actions like purging all cached statements not in use, freeing memory in the process.
... note: the sqlite.jsm javascript code module can only be used from chrome -- that is, from within the application itself or an add-on.
...if the path does not exist, a new sqlite database will be created.
...And 18 more matches
Memory reporting
sometimes counter-based reporters are unavoidable, particularly when writing memory reporters for third-party code that cannot be modified.
... size_t mystring::sizeofexcludingthis(mozilla::mallocsizeof amallocsizeof) const { return amallocsizeof(mbuffer); } size_t mystring::sizeofincludingthis(mozilla::mallocsizeof amallocsizeof) const { return amallocsizeof(this) + sizeofexcludingthis(amallocsizeof); } (note that sizeofexcludingthis and sizeofincludingthis aren't overrides of methods on a global base class that is common to all reporters.
...that said, note that for some classes these methods may be virtual.) mfbt/memoryreporting.h defines mozilla::mallocsizeof as follows: typedef size_t (*mallocsizeof)(const void* p); functions with this signature measure the size of p by asking the heap allocator how big it is (via moz_malloc_usable_size).
...And 18 more matches
Garbage collection
(some cells are shared across all compartments in a zone.) an object may not hold a direct pointer to an object in another compartment.
...zones mainly serve as boundaries for gcs: the garbage collector collects at the level of a zone, not an individual compartment.
... objects from different zones cannot be stored in the same arena.
...And 18 more matches
nsITransport
this interface does not in any way specify 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).
...this means that if the stream has no data and 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.
...And 18 more matches
nsIWebProgress
however, in some cases a nsiwebprogress instance may not have an associated dom window.
... the parent-child relationship of nsiwebprogress instances is not made explicit by this interface, but the relationship may exist in 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.
...And 18 more matches
Timing element visibility with the Intersection Observer API - Web APIs
the intersection observer api makes it easy to be asynchronously notified when elements of interest become more or less obscured by a shared ancestor node or element, including the document itself.
... although many aspects of this example will not match real world usage (in particular, the articles all have the same text and aren't loaded from a database, and there are just a handful of simple text-only ads that are selected from an array), this should provide enough understanding of the api to quickly learn how to apply the intersection observer api to your own site.
... there's a good reason why the notion of tracking visibility of ads is being used in this example.
...And 18 more matches
RTCPeerConnection - Web APIs
d; pointer-events: all;} constructorrtcpeerconnection() the rtcpeerconnection() constructor returns a newly-created rtcpeerconnection, which represents a connection between the local device and a remote peer.propertiesalso inherits properties from: eventtargetcantrickleicecandidatesthe read-only rtcpeerconnection property cantrickleicecandidates returns a boolean which indicates whether or not the remote peer can accept trickled ice candidates.connectionstate the read-only connectionstate property of the rtcpeerconnection interface indicates the current state of the peer connection by returning one of the string values specified by the enum rtcpeerconnectionstate.currentlocaldescription read only the read-only property rtcpeerconnection.currentlocaldescription returns an rtcsessiondes...
...however, browsers are not required to provide any default ice servers at all.iceconnectionstate read only the read-only property rtcpeerconnection.iceconnectionstate returns an enum of type rtciceconnectionstate which state of the ice agent associated with the rtcpeerconnection.icegatheringstate read only the read-only property rtcpeerconnection.icegatheringstate returns an enum of type rtcicegatheringstate that describ...
...if it has not yet been set, this is null.peeridentity read only the read-only rtcpeerconnection property peeridentity returns a javascript promise that resolves to an rtcidentityassertion which contains a domstring identifying the remote peer.pendinglocaldescription read only the read-only property rtcpeerconnection.pendinglocaldescription returns an rtcsessiondescription object describing a pending configuration change for the local end of the connection.
...And 18 more matches
Inputs and input sources - Web APIs
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.
...it can also be useful if your app uses the notion of "main hand" and "off hand" for determining the functionality of a controller; in a game, for example, the main hand controller may be the player's weapon while the off hand controller might be used to control the positioning of a shield.
... gamepad record each input source has a gamepad property which, if not null, is a gamepad object describing the various controls and widgets available on the controller.
...And 18 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
the function is not passed any arguments, and no return value is expected.
...this syntax is not recommended for the same reasons that make using eval() a security risk.
... note: passing additional arguments to setinterval() in the first syntax does not work in internet explorer 9 and earlier.
...And 18 more matches
Web accessibility for seizures and physical reactions - Accessibility
certain visual patterns, especially stripes, can also cause physical reactions even though they are not animated.
... the fact that static images may cause seizures and other disorders is documented in such articles as “gamma oscillations and photosensitive epilepsy”, where it is noted “certain visual images, even in the absence of motion or flicker, can trigger seizures in patients with photosensitive epilepsy” the epilepsy foundation, in its article, "shedding light on photosensitivity, one of epilepsy's most complex conditions" talks about static images and patterns.
...selim benbadis of usf's comprehensive epilepsy program notes, "the only thing that is really documented is flashing lights, which can trigger seizures in patients with photosensitive epilepsy.
...And 18 more matches
Variable fonts guide - CSS: Cascading Style Sheets
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.
... a note about font families, weights, and variants you might notice that we have been talking about having a specific font file for every weight and style (i.e.
...And 18 more matches
Cross-browser audio basics - Developer guides
ated 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.
... here we define an <audio> element with multiple sources — we do this as not all browsers support the same audio formats.
... if the <audio> element is not supported then <audio> and <source> will be ignored.
...And 18 more matches
<input type="time"> - HTML: Hypertext Markup Language
WebHTMLElementinputtime
support is good in modern browsers, with safari being the sole major browser not yet implementing it; in safari, and any other browsers that don't support <time>, it degrades gracefully to <input type="text">.
...ibute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options max the latest time to accept, in the syntax described under time value format min the earliest time to accept as a valid input readonly a boolean attribute which, if present, indicates that the contents of the time input should not be user-editable step the stepping interval to use both for user interfaces purposes and during constraint validation unlike many data types, time values have a periodic domain, meaning that the values reach the highest possible value, then wrap back around to the beginning again.
...any values in the list that are not compatible with the type are not included in the suggested options.
...And 18 more matches
Expressions and operators - JavaScript
note that the return values are always based on the operands’ values before the operation.
...in most cases, if the two operands are not of the same type, javascript attempts to convert them to an appropriate type for the comparison.
...these operators do not attempt to convert the operands to compatible types before checking equality.
...And 18 more matches
Functions - JavaScript
if the function changes the value of an argument, this change is not reflected globally or in the calling function.
... */ console.log(mycar.brand); the this keyword does not refer to the currently executing function, so you must refer to function objects by name, even within the function body.
...function expressions are not hoisted onto the beginning of the scope, therefore they cannot be used before they appear in the code.
...And 18 more matches
Comparing Reflect and Object methods - JavaScript
please note that if a method does not exist in an api, it is marked as n/a.
...returns a typeerror if the property was not successfully defined on the object.
... reflect.defineproperty() returns true if the property was defined on the object and false if it was not.
...And 18 more matches
WebAssembly - JavaScript
unlike most other global objects, webassembly is not a constructor (it is not a function object).
... webassembly.validate() validates a given typed array of webassembly binary code, returning whether the bytes are valid webassembly code (true) or not (false).
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jswebassemblychrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
...And 18 more matches
Classes and Inheritance - Archive of obsolete content
unlike languages like c++ and java, javascript does not have native support for classical 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.
...moreover, if the constructor does not return a value, the result of the call defaults to the value of this.
...And 17 more matches
tabs - Archive of obsolete content
usage open a tab you can open a new tab, specifying various properties including location: var tabs = require("sdk/tabs"); tabs.open("http://www.example.com"); track tabs you can register event listeners to be notified when tabs open, close, finish loading dom content, or are made active or inactive: var tabs = require("sdk/tabs"); // listen for tab openings.
... var tabs = require('sdk/tabs'); tabs.on('ready', function () { console.log('first: ' + tabs[0].title); console.log('last: ' + tabs[tabs.length-1].title); }); you can access the currently active tab: var tabs = require('sdk/tabs'); tabs.on('activate', function () { console.log('active: ' + tabs.activetab.url); }); track a single tab given a tab, you can register event listeners to be notified when the tab is closed, activated or deactivated, or when the page hosted by the tab is loaded or retrieved from the "back-forward cache": var tabs = require("sdk/tabs"); function onopen(tab) { console.log(tab.url + " is open"); tab.on("pageshow", logshow); tab.on("activate", logactivate); tab.on("deactivate", logdeactivate); tab.on("close", logclose); } function logshow(tab) { ...
... console.log(tab.url + " is loaded"); } function logactivate(tab) { console.log(tab.url + " is activated"); } function logdeactivate(tab) { console.log(tab.url + " is deactivated"); } function logclose(tab) { console.log(tab.url + " is closed"); } tabs.on('open', onopen); manipulate a tab you can get and set various properties of tabs (but note that properties relating to the tab's content, such as the url, will not contain valid values until after the tab's ready event fires).
...And 17 more matches
StringView - Archive of obsolete content
however, this is slow and error-prone, due to the need for multiple conversions (especially if the binary data is not actually byte-format data, but, for example, 32-bit integers or floats).
...nstartidx + nlength : ninptlen); break typeswitch; default: /* the input argument is an array or another serializable object: a new typedarray will be created.
... /* (npart - 252 << 30) may be not safe in ecmascript!
...And 17 more matches
Modularization techniques - Archive of obsolete content
if the object does not support the given interface, it will return ns_nointerface.
...this means that even though interface b inherits from nsisupports, performing a queryinterface() on it may not return the same interface.
...st); // manually unregister a factory for a class static nsresult unregisterfactory(const nscid &aclass, nsifactory *afactory); // manually unregister a dynamically loaded factory for a class static nsresult unregisterfactory(const nscid &aclass, const char *alibrary); // unload dynamically loaded factories that are not in use static nsresult freelibraries(); }; there are several ways a factory can make its way into the repository.
...And 17 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.
...detecting private browsing mode determining whether or not the user is currently in private browsing mode is simple.
...var pbs = components.classes["@mozilla.org/privatebrowsing;1"] .getservice(components.interfaces.nsiprivatebrowsingservice); var inprivatebrowsingmode = pbs.privatebrowsingenabled; if (!inprivatebrowsingmode) { /* save private information */ } in the above example, we only save the user's private information if not in private browsing mode.
...And 17 more matches
XUL Events - Archive of obsolete content
the event is not sent until the focus is moved to another element.
...you should not use this event in xul to respond to user actions; the command event should be used instead.
... attribute: ondblclick dommousescroll this event is sent when the mouse wheel is moved, whether it results in content being scrolled or not.
...And 17 more matches
OpenClose - Archive of obsolete content
note that the open property applies to the menu or button, not to the menupopup.
... there are several situations when opening a menu is not allowed.
... if the menu is a child of another menu and the parent menu is not open.
...And 17 more matches
XUL Structure - Archive of obsolete content
http://localhost/~username/ ), regardless of whether they are html or xul or another document type, are limited in the type of operations they can perform, for security reasons.
...obviously, web pages do not get these privileges, unless they are signed with a digital certificate and the user has granted permission to perform these operations.
...registered packages are not required to use overlays, of course.
...And 17 more matches
Cascade and inheritance - Learn web development
at some point, you will be working on a project and you will find that the css you thought should be applied to an element is not working.
...which rule is styling your element may not be the one you expect, so you need to understand how these mechanisms work.
...this can also cause some behavior that you might not expect.
...And 17 more matches
Legacy layout methods - Learn web development
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.
...if we want the two <div>s to be floated alongside one another, we need to set their widths to total 100% of the width of their parent element or smaller so they can fit alongside one another.
...cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div> body { width: 90%; max-width: 900px; margin: 0 auto; } div:nth-of-type(1) { width: 48%; float: left; } div:nth-of-type(2) { width: 48%; float: right; } you'll notice here that we are using percentages for all the widths — this is quite a good strategy, as it creates a liquid layout, one that adjusts to different screen sizes and keeps the same proportions for the column widths at smaller screen sizes.
...And 17 more matches
Choosing the right approach - Learn web development
asynchronous callbacks generally found in old-style apis, involves a function being passed into another function as a parameter, which is then invoked when an asynchronous operation has been completed, so that the callback can in turn do something with the result.
... this is the precursor to promises; it's not as efficient or flexible.
...droidfirefox for androidopera for androidsafari on iossamsung internetsettimeoutchrome full support 30edge full support 12firefox full support 1 full support 1 full support 52notes notes setinterval now defined on windoworworkerglobalscope mixin.ie full support 4opera full support 4safari full support 1webview android full support 4.4chrome android full support ...
...And 17 more matches
Manipulating documents - Learn web development
e> </head> <body> <section> <img src="dinosaur.png" alt="a red tyrannosaurus rex: a two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth."> <p>here we will add a link to the <a href="https://www.mozilla.org/">mozilla homepage</a></p> </section> </body> </html> the dom on the other hand looks like this: note: this dom tree diagram was created using ian hickson's live dom viewer.
...you will also encounter various terms used to describe the type of node, and their position in the tree in relation to one another: element node: an element, as it exists in the dom.
... child node: a node directly inside another node.
...And 17 more matches
A first splash into JavaScript - Learn web development
note: many of the code features you'll see in javascript are the same as in other programming languages — functions, loops, etc.
... thinking like a programmer one of the hardest things to learn in programming is not the syntax you need to learn, but how to apply it to solve real world problems.
... allow them to enter another guess.
...And 17 more matches
Introduction to the server side - Learn web development
it can even allow interaction with users of the site, sending notifications and updates via email or through other channels.
...the response contains a status line indicating whether or not the request succeeded (e.g.
...if the file cannot be retrieved for some reason, an error status is returned (see client error responses and server error responses).
...And 17 more matches
Website security - Learn web development
note: this is an introductory topic, designed to help you start thinking about website security, but it is not exhaustive.
...as you read, note how threats are most successful when the web application either trusts, or is not paranoid enough about the data coming from the browser.
... note: xss vulnerabilities have been historically more common than any other type of security threat.
...And 17 more matches
Software accessibility: Where are we today?
these operating systems were not designed with the needs of people with disabilities in mind.
...in answer to this problem, many small accessibility hardware and software vendors created products and software which helped people who could not perform one of the four basic tasks to use common computer applications.
...this need not be the case.
...And 17 more matches
HTTP Cache
this document only contains what cannot be found or may not be clear directly from the idl files comments.
... 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.
...And 17 more matches
IPDL Tutorial
class pluginparent : public ppluginparent { public: pluginparent(const nscstring& pluginpath) { // launch child plugin process sendinit(pluginpath); } ~pluginparent() { sendshutdown(); } protected: bool recvready() { mobservers.notify("ready for action"); } }; here's how the ppluginchild might be used by a c++ implementor in the plugin process: class pluginchild : public ppluginchild { protected: void recvinit(const nscstring& pluginpath) { mpluginlibrary = pr_loadlibrary(pluginpath.get()); sendready(); } void recvshutdown() { pr_unloadlibrary(mpluginlibrary); } private: prlibrary* mpluginlibrary...
... 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(nscstring[] args); in c++ this is translated into a nstarray reference: virtual bool recvinvokemethod(nstarray<nscstring>& args); ipdl's generated data structures can be used in several protocols if they are defined in a separ...
...these files must be added to the ipdl.mk makefile like regular .ipdl files, and they use the same syntax (except they cannot declare protocols).
...And 17 more matches
NSPR Error Handling
pr_pending_interrupt_error the operation terminated because another thread has interrupted it with pr_interrupt.
... pr_not_implemented_error the preceding function has not been implemented.
... pr_io_timeout_error the i/o operation has not completed in the time specified for the preceding function.
...And 17 more matches
NSS tools : modutil
if the token has not been initialized, this option initializes the password.
...true means to verify that the module is in fips mode, while false means to verify that the module is not in fips mode.
...the default nss pkcs #11 module cannot be deleted.
...And 17 more matches
Introduction to the JavaScript shell
note: starting with spidermonkey 44 (firefox 44 / thunderbird 44 / seamonkey 2.41), the standard, web-compatible javascript version is used by default (and not js1.7+ anymore).
...from a bash console when using a pre-compiled binary, try <path to your firefox's run-mozilla.sh>/run-mozilla.sh ./js -- that worked for me] if you'd like to run the javascript code in the file foo.js, you can use this command: js foo.js to run foo.js then drop into the interactive shell, do this: js -f foo.js -i reference note: because the javascript shell is used as a test environment for the javascript engine, the available options and built-in functions can change over time.
... -c, --compileonly tells the shell to compile the program but not run it.
...And 17 more matches
imgIContainer
you can only be guaranteed that querying this will not throw if status_decode_complete is set on the imgirequest.
... exceptions thrown ns_error_not_available if the animated state cannot be determined.
...this may be a platform-native, optimized frame, so you cannot inspect its pixel data.
...And 17 more matches
nsIDownloadManager
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.
... cancleanup boolean whether or not there are downloads that can be cleaned up (removed) that is downloads that have completed, have failed or have been canceled.
... constants constant value description download_notstarted -1 the download has not been started yet.
...And 17 more matches
Storage
note: storage is not the same as the dom:storage feature which can be used by web pages to store persistent data or the session store api (an xpcom storage utility for use by extensions).
...it does not cover sql or "regular" sqlite.
... opening a connection javascript example of opening my_db_file_name.sqlite in the profile directory: components.utils.import("resource://gre/modules/services.jsm"); components.utils.import("resource://gre/modules/fileutils.jsm"); let file = fileutils.getfile("profd", ["my_db_file_name.sqlite"]); let dbconn = services.storage.opendatabase(file); // will also create the file if it does not exist likewise, the c++ would look like this: nscomptr<nsifile> dbfile; rv = ns_getspecialdirectory(ns_app_user_profile_50_dir, getter_addrefs(dbfile)); ns_ensure_success(rv, rv); rv = dbfile->append(ns_literal_string("my_db_file_name.sqlite")); ns_ensure_success(rv, rv); nscomptr<mozistorageservice> dbservice = do_getservice(moz_storage_service_contractid, &rv); ...
...And 17 more matches
Index
the activity manager works in conjunction with the interactive status bar to give the user notifications concerning what thunderbird is doing and how thunderbird has handled user requests.
...pizzarro <rhp@netscape.com> 10 autoconfiguration in thunderbird administration, enterprise author: ben bucksch please do not change this document without consulting the author 11 autoconfig file format no summary!
... (see this document for info about that.) for the addressbook card pane, the icon will show is on disk at: <profile home>/nim/<value of pref aim.session.screenname>/picture/<screenname for card>.gif if aim.session.screenname is not set, the icon will not appear.
...And 17 more matches
Debugger.Frame - Firefox Developer Tools
note that frames only become inactive at times that are predictable for the debugger: when the debuggee runs, or when the debugger removes frames from the stack itself.
... visible frames when inspecting the call stack, debugger does not reveal all the frames that are actually present on the stack: while it does reveal all frames running debuggee code, it omits frames running the debugger’s own code, and omits most frames running non-debuggee code.
... (note that the debuggee is not considered an “immediate caller” of handler methods it triggers.
...And 17 more matches
Applying styles and colors - Web APIs
note: when you set the strokestyle and/or fillstyle property, the new value becomes the default for all shapes being drawn from then on.
...there is nothing too spectacular happening here.
... because the strokestyle and fillstyle properties accept css rgba color values, we can use the following notation to assign a transparent color to them.
...And 17 more matches
DOMException - Web APIs
some apis define their own sets of names, so this is not necessarily a complete list.
... note: because historically the errors were identified by a numeric value that corresponded with a named variable defined to have that value, some of the entries below indicate the legacy code value and constant name that were used in the past.
... indexsizeerror the index is not in the allowed range.
...And 17 more matches
Perceivable - Accessibility
note: to read the w3c definitions for perceivable and its guidelines and success criteria, see principle 1: perceivable - information and user interface components must be presentable to users in ways they can perceive.
... note: also see the wcag description for guideline 1.1: text alternatives.
...note that if the audio/video serves as an alternative to existing text content, you don't need to provide another text alternative.
...And 17 more matches
position - CSS: Cascading Style Sheets
WebCSSposition
the offset does not affect the position of any other elements; thus, the space given for the element in the page layout is the same as if position were static.
... this value creates a new stacking context when the value of z-index is not auto.
... this value creates a new stacking context when the value of z-index is not auto.
...And 17 more matches
<input type="text"> - HTML: Hypertext Markup Language
WebHTMLElementinputtext
mber of characters the input should accept minlength the minimum number of characters long the input can be and still be considered valid pattern a regular expression the input's contents must match in order to be valid placeholder an exemplar value to display in the input field whenever it is empty readonly a boolean attribute indicating whether or not the contents of the input should be read-only size a number indicating how many characters wide the input field should be spellcheck controls whether or not to enable spell checking for the input field, or if the default spell checking configuration should be used list the values of the list attribute is the id of a <datalist> element located in the same document.
...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.
...And 17 more matches
Object initializer - JavaScript
objects can be initialized using new object(), object.create(), or using the literal notation (initializer notation).
... 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.
...And 17 more matches
Performance fundamentals - Web Performance
as your brain infers, motion is not jerky and discrete, but rather "updates" smoothly and continuously.
... note: humans usually cannot perceive differences in framerate above 60hz.
... memory usage memory usage is another key metric.
...And 17 more matches
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
note: as of gecko 2.0, gecko supports svg animation using smil.
... element notes structure module svg implemented.
...al) recently implemented presentation attributes: direction, unicode-bidi, font-variant, text-decoration svgtspanelement recently implemented bindings: selectsubstring recently implemented attributes: textlength, lengthadjust tref this feature, present in early draft of the spec, has been removed from it and is therefor not implemented (bug 273171).
...And 17 more matches
Extension Versioning, Update and Compatibility - Archive of obsolete content
as a rough overview this is a version string split by periods, some examples: 2.0 1.0b1 3.0pre1 5.0.1.2 note: before firefox 1.5 the more basic firefox version format was used: major.minor.release.build[+] where only digits were allowed.
... firefox 3 note in applications based on gecko 1.9 you can also use a targetapplication entry with an id toolkit@mozilla.org and minversion and maxversion that match the toolkit version of the running application.
... note: before firefox 1.5 the preference app.extensions.version could be used to override the version that the application believed itself to be to allow normally incompatible extensions to install.
...And 16 more matches
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
(for seamonkey 2, firefox, thunderbird and sunbird, see the page: custom toolbar button) you do not need any special technical skills or tools, and almost all the information you need is on this page.
... introduction the technique described here does not involve any hacking.
...note that this extension is very simplified.
...And 16 more matches
prefwindow - Archive of obsolete content
on other platforms, the preferences are not applied until the dialog is closed.
...normally, you would not set this attribute as it will be set automatically such that the default pane is the same as the one showing when the preferences dialog was last closed.
... important note for xulrunner-based applications: the preferences system - part of the toolkit - still relies on two browser.* preferences.
...And 16 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.
... attributes disabled type: boolean indicates whether the element is disabled or not.
...And 16 more matches
tree - Archive of obsolete content
ArchiveMozillaXULtree
unlike other elements, the data to display inside the tree is not specified using tags, but is determined from a view object.
...however, the treeitems are not displayed directly; they are used only as data to the content view.
...dom treeitems are not created.
...And 16 more matches
Creating hyperlinks - Learn web development
almost any web content can be converted to a link so that when clicked or otherwise activated the web browser goes to another web address (url).
... note: a url can point to html files, text files, images, text documents, video and audio files, or anything else that lives on the web.
... for example, the bbc homepage contains a many links that point not only to multiple news stories, but also different areas of the site (navigation functionality), login/registration pages (user tools), and more.
...And 16 more matches
From object to iframe — other embedding technologies - Learn web development
these were considered the height of coolness in the mid to late 90s, and there was evidence that having a webpage split up into smaller chunks like this was better for download speeds — especially noticeable with network connections being so slow back then.
... 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.
...ength); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; iframes in detail so, that was easy and fun, right?
...And 16 more matches
Video and audio content - Learn web development
this kind of technology worked ok, but it had a number of problems, including not working well with html/css features, security issues, and accessibility issues.
...we'll not be looking at javascript here — just the basic foundations that can be achieved with html.
... note: before you begin here, you should also know that there are quite a few ovps (online video providers) like youtube, dailymotion, and vimeo, and online audio providers like soundcloud.
...And 16 more matches
Deploying our app - Learn web development
note: cache busting is a new term that we haven't met before in the module.
... the above tasks also break down into further tasks; note that most web development teams will have their own terms and processes for at least some part of the post-development phase.
... this is where our code, github, and netlify need to be set up to talk to one another, so that each time we update our github code repository, netlify will automatically pick up the changes, run the build tasks, and finally release a new update.
...And 16 more matches
Configuring Build Options
note: do not make substantive changes to this document without consulting benjamin smedberg <benjamin@smedbergs.us> or one of the build-config peersthis document details how to configure firefox builds.
... most of the time a mozconfig file is not required.
...build options, including options not usable from the command-line, may appear in "confvars.sh" files in the source tree.
...And 16 more matches
Gecko Keypress Event
when the accel key is down, the charcode of a keypress event may be replaced with a character from a latin keyboard layout only when the original character is not an ascii character.
... windows the charcode is replaced only when ctrl is down but alt is not down.
... if the os-provided character cannot be entered without using the ctrl key, then, gecko does not replace the character.
...And 16 more matches
Gecko Profiler FAQ
therefore the gecko profiler is not a suitable tool for finding hotspots within a single function.
... in this view, the timestamps of individual samples / stacks will not be meaningful.
... profiler.firefox.com does not have a comparison view at the moment.
...And 16 more matches
AsyncTestUtils extended framework
d the following code to the top of your test file to import everything you need: load("../../mailnews/resources/loghelper.js"); load("../../mailnews/resources/asynctestutils.js"); load("../../mailnews/resources/messagegenerator.js"); load("../../mailnews/resources/messagemodifier.js"); load("../../mailnews/resources/messageinjection.js"); if the directory where you are adding the tests does not have a head_*.js file that has the two following lines, add them at the top of your test file (before the lines shown above): load("../../mailnews/resources/maildirservice.js"); load("../../mailnews/resources/mailtestutils.js"); at the bottom of the test file, add the following: var tests =[ // list your tests here ]; function run_test() { configure_message_injection({mode: "local"});...
... sometimes in your tests you need to wait for an operation to complete that does not occur synchronously (that is, it is not done when the function call you made to initiate the operation returns control to you).
... a function that does not return anything (or returns undefined) and is not a generator is treated like a function that returned true.
...And 16 more matches
Midas
notes since an entire document becomes editable, authors often load the editable document into an iframe and do the bulk of the scripting in the parent document.
... examples this example shows the basic structure described in the notes section : <html> <head> <title>simple edit box</title> </head> <body> <iframe id="midasform" src="about:blank" onload="this.contentdocument.designmode='on';" ></iframe> </body> </html> methods document.execcommand executes the given command.
...if there isn't a selection, nothing will happen.
...And 16 more matches
Python binding for NSS
thus when deciding if the nss/nspr api should be rigidly followed or a more pythonic api provided the pythonic implementation wins because python programmers do not want to write c programs in python, rather they want their python code to feel like python code with the richness of full python.
...this allows other python threads to execute during the time a nss/nspr function is progress in another thread.
... project history red hat utilizes both nss and python in many of it's projects, however it was not previously possible to call nss directly from python.
...And 16 more matches
NSS tools : modutil
MozillaProjectsNSStoolsmodutil
if the token has not been initialized, this option initializes the password.
...true means to verify that the module is in fips mode, while false means to verify that the module is not in fips mode.
...the default nss pkcs #11 module cannot be deleted.
...And 16 more matches
Property cache
shape integers do not exist anymore.
...spidermonkey mainly uses type inference to determine which properties are being accessed; in cases where type inference does not find the exact shape of the object being accessed, spidermonkey uses a pic (polymorphic inline caches) to store the result of the lookup.
...it caches the results of part 2, if the property is simple enough for optimized access, or a pointer to the js::shape if not.
...And 16 more matches
SpiderMonkey 1.8.5
note that version 1.8.5 is outdated.
...it's the same language, just not as fast.
... multithreaded js programs that race against the same objects are now explicitly not supported.
...And 16 more matches
SpiderMonkey 1.8.7
draft in progress - this is a draft, and right now it's mostly just a copy of the 1.8.5 release notes.
...it's the same language, just not as fast.
...see the 1.8.5 release notes for information on migrating from earlier versions.
...And 16 more matches
Places Developer Guide
it encompasses history, bookmarks, tags, favicons, and annotations.
... nsinavbookmarksservice.unfiledbookmarksfolder - items that have been "starred", but not places in any folder.
... other bookmarks apis note: this document covers the toolkit places services.
...And 16 more matches
nsIMsgFolder
inputstream getofflinefilestream(in nsmsgkey msgkey, out pruint32 offset, out pruint32 size); void downloadmessagesforoffline(in nsisupportsarray messages, in nsimsgwindow window); nsimsgfolder getchildwithuri(in acstring uri, in boolean deep, in boolean caseinsensitive); void downloadallforoffline(in nsiurllistener listener, in nsimsgwindow window); void enablenotifications(in long notificationtype, in boolean enable, in boolean dbbatching); boolean iscommandenabled(in acstring command); boolean matchorchangefilterdestination(in nsimsgfolder folder,in boolean caseinsensitive); boolean confirmfolderdeletionforfilter(in nsimsgwindow msgwindow); void alertfilterchanged(in nsimsgwindow msgwindow); void throwalertmsg...
...(in string msgname, in nsimsgwindow msgwindow); astring getstringwithfoldernamefrombundle(in string msgname); void notifycompactcompleted(); long comparesortkeys(in nsimsgfolder msgfolder); [noscript] void getsortkey(out octet_ptr key, out unsigned long length); boolean callfilterplugins(in nsimsgwindow amsgwindow); acstring getstringproperty(in string propertyname); void setstringproperty(in string propertyname, in acstring propertyvalue); boolean isancestorof(in nsimsgfolder folder); boolean containschildnamed(in astring name); nsimsgfolder getchildnamed(in astring aname); nsimsgfolder findsubfolder(in acstring escapedsubfoldername); void addfolderlistener(in nsifolderlistener listene...
...r); void removefolderlistener(in nsifolderlistener listener); void notifypropertychanged(in nsiatom property, in acstring oldvalue, in acstring newvalue); void notifyintpropertychanged(in nsiatom property, in long oldvalue, in long newvalue); void notifyboolpropertychanged(in nsiatom property, in boolean oldvalue, in boolean newvalue); void notifypropertyflagchanged(in nsimsgdbhdr item, in nsiatom property, in unsigned long oldvalue, in unsigned long newvalue); void notifyunicharpropertychanged(in nsiatom property, in astring oldvalue, in astring newvalue); void notifyitemadded(in nsisupports item); void notifyitemremoved(in nsisupports item); void notifyfolderevent(in nsiatom event); void listdescendent...
...And 16 more matches
nsIXPConnect
js/src/xpconnect/idl/nsixpconnect.idlnot scriptable provides the xpconnect service.
..., in string afunctionname, in print32 alinenumber, in nsistackframe acaller); void debugdump(in short depth); void debugdumpevalinjsstackframe(in pruint32 aframenumber, in string asourcetext); void debugdumpjsstack(in prbool showargs, in prbool showlocals, in prbool showthisprops); void debugdumpobject(in nsisupports acomobj, in short depth); [noscript,notxpcom] prbool definedomquickstubs(in jscontextptr cx, in jsobjectptr proto, in pruint32 flags, in pruint32 interfacecount, [array, size_is(interfacecount)] in nsiidptr interfacearray); jsval evalinsandboxobject(in astring source, in jscontextptr cx, in nsixpconnectjsobjectholder sandbox, in prbool returnstringonly); native code only!
... void flagsystemfilenameprefix(in string afilenameprefix, in prbool awantnativewrappers); void garbagecollect(); [noscript,notxpcom] void getcaller(out jscontextptr ajscontext, out jsobjectptr aobject); jsval getcowforobject(in jscontextptr ajscontext, in jsobjectptr aparent, in jsobjectptr awrappedobj); native code only!
...And 16 more matches
nsIAbCard/Thunderbird3
note: this interface has been overhauled completely for thunderbird 3.
...same as home, but with `work' instead of `home' other contact: faxnumber, faxnumbertype pagernumber, pagernumbertype cellularnumber, cellularnumbertype jobtitle, department, company _aimscreenname dates: anniversaryyear, anniversarymonth, anniversaryday birthyear, birthmonth, birthday webpage1 (work), webpage2 (home) custom1, custom2, custom3, custom4 notes integral properties: lastmodifieddate popularityindex prefermailformat (see nsiabprefermailformat) boolean properties: allowremotecontent inherits from: nsiabitem method overview nsivariant getproperty(in autf8string name, in nsivariant defaultvalue); [noscript] astring getpropertyasastring(in string name); [noscript] autf8string g...
... defaultvalue the value to return if the property does not exist.
...And 16 more matches
Web Console remoting - Firefox Developer Tools
for example: ["pageerror", "consoleapi", "networkactivity", "fileactivity"] the web console actor does not start any listeners by default.
... ] } notice that the consoleactor is also available as a global actor.
... "networkactivity", "fileactivity" ] } the reply is: { "startedlisteners": [ "pageerror", "consoleapi", "networkactivity", "fileactivity" ], "nativeconsoleapi": true, "from": "conn0.console9" } the reply tells which listeners were started and it includes a flag nativeconsoleapi which tells if the window.console object was overridden by the scripts in the page or not.
...And 16 more matches
Fullscreen API - Web APIs
note: support for this api varies somewhat across browsers, with many requiring vendor prefixes and/or not implementing the latest specification.
...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.
...And 16 more matches
Migrating from webkitAudioContext - Web APIs
it was first implemented in webkit, and some of its older parts were not immediately removed as they were replaced in the specification, leading to many sites using non-compatible code.
...as the specification evolved and changes were made to the spec, some of the old implementation pieces were not removed from the webkit (and blink) implementations due to backwards compatibility reasons.
... new engines implementing the web audio spec (such as gecko) will only implement the official, final version of the specification, which means that code using webkitaudiocontext or old naming conventions in the web audio specification may not immediately work out of the box in a compliant web audio implementation.
...And 16 more matches
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
this syntax is not recommended for the same reasons that make using eval() a security risk.
...note that in either case, the actual delay may be longer than intended; see reasons for delays longer than specified below.
... note: passing additional parameters to the function in the first syntax does not work in internet explorer 9 and below.
...And 16 more matches
Getting Started - Developer guides
httprequest = new xmlhttprequest(); } else if (window.activexobject) { // ie 6 and older httprequest = new activexobject("microsoft.xmlhttp"); } note: for illustration purposes, the above is a somewhat simplified version of the code to be used for creating an xmlhttp instance.
...at this stage, you need to tell the xmlhttp request object which javascript function will handle the response, by setting the onreadystatechange property of the object and naming it after the function to call when the request changes state, like this: httprequest.onreadystatechange = nameofthefunction; note that there are no parentheses or parameters after the function name, because you're assigning a reference to the function, rather than actually calling it.
...}; 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.
...And 16 more matches
Meta programming - JavaScript
here, an object that is proxied will not return undefined when getting undefined properties, but will instead return the number 42.
... if target is not extensible, object.getprototypeof(proxy) method must return the same value as object.getprototypeof(target).
... handler.setprototypeof() object.setprototypeof() reflect.setprototypeof() if target is not extensible, the prototype parameter must be the same value as object.getprototypeof(target).
...And 16 more matches
Arrow function expressions - JavaScript
arrow function expressions are ill suited as methods, and they cannot be used as constructors.
... we can remove the surrounding parentheses elements.map(element => { return element.length; }); // [8, 6, 7, 9] // when the only statement in an arrow function is `return`, we can remove `return` and remove // the surrounding curly brackets elements.map(element => element.length); // [8, 6, 7, 9] // in this case, because we only need the length property, we can use destructuring parameter: // notice that the `length` corresponds to the property we want to get whereas the // obviously non-special `lengthfoobarx` is just the name of a variable which can be changed // to any valid variable name you want elements.map(({ length: lengthfoobarx }) => lengthfoobarx); // [8, 6, 7, 9] // this destructuring parameter assignment can also be written as seen below.
... however, note that in // this example we are not assigning `length` value to the made up property.
...And 16 more matches
Lexical grammar - JavaScript
u+200d zero width joiner <zwj> placed between characters that would not normally be connected in order to cause the characters to be rendered using their connected form in certain languages (wikipedia).
... \r u+2028 line separator <ls> wikipedia u+2029 paragraph separator <ps> wikipedia comments comments are used to add hints, notes, suggestions, or warnings to javascript code.
...notice that we don't need to end the comment until we're done.
...And 16 more matches
Strict mode - JavaScript
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.
... fixes mistakes that make it difficult for javascript engines to perform optimizations: strict mode code can sometimes be made to run faster than identical code that's not strict mode.
...it doesn't apply to block statements enclosed in {} braces; attempting to apply it to such contexts does nothing.
...And 16 more matches
SVG documentation index - SVG: Scalable Vector Graphics
WebSVGIndex
14 svg conditional processing attributes intermediate, needsexample, property, reference, svg the svg conditional processing attributes are all the attributes that can be specified on some svg elements to control whether or not the element on which it appears should be rendered.
... 20 accumulate needscompattable, needsexample, svg, svg attribute this attribute controls whether or not the animation is cumulative.
...the attribute does not specify any processing restrictions; it can be considered metadata.
...And 16 more matches
Namespaces crash course - SVG: Scalable Vector Graphics
the problem with mixing content from different xml dialects in a single xml document is that the elements defined by one dialect may have the same name as elements defined by another.
...in fact how does the user agent tell when xml content is something it knows about, and not just a meaningless xml file containing arbitrary element names unknown to it?
... contrary to popular opinion, the answer to this question is not "it can tell from the doctype declaration".
...And 16 more matches
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
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...
...t (at least for <image>; bug 1240357) rendering model change notes svg root and <foreignobject> not overflow:hidden in ua style sheet implementation status unknown allow overflow: auto; to clip and show scroll bars implementation status unknown allow overflow: scroll; to show scroll bars on <svg> elements implementation status unknown basic data types and interfaces change notes dommatrix or dommatrixreadonly instead of svgmatrix implementation status unknown domrect or domrectreadonly instead of svgrect implementation status unknown dompoint or dompointreadonly instead of svgpoint implementation status unknown members of svgstylable and svglangspace available in sv...
...the methods ispointinfill() and ispointinstroke() are not implemented yet (bug 1325319).
...And 16 more matches
WebAssembly
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jswebassemblychrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0compileerrorchrome full support 57edge full support 16firefox full support ...
...52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full ...
...And 16 more matches
jpm - Archive of obsolete content
installing jpm globally npm install jpm --global depending on your setup, you might need to run this as an administrator: sudo npm install jpm --global installing jpm locally if you do not wish to, or are unable to, install jpm globally, you may instead install it locally: cd $home && npm install jpm to run jpm from a terminal when installed locally, you must add the directory "$home/node_modules/.bin/" to your terminal's path first.
...note that unlike cfx, jpm is available in every command prompt you start, as long as you installed it with the --global flag.
... install a different version of firefox as of firefox 48, it is not possible to use unsigned add-ons (i.e.
...And 15 more matches
Introduction to XUL - Archive of obsolete content
preamble 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.
...the intention is not to implement a generic cross-platform application framework.
...though the former term seems more concrete than the other, and therefore is not an exact replacement, no one is completely certain why we have both.
...And 15 more matches
RDF Modifications - Archive of obsolete content
when the datasource is modified, the datasource will notify any observers of the change.
... the template builder uses these notifcations to update the template as necessary based on the new or removed 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.
...And 15 more matches
Document Object Model - Archive of obsolete content
the various dom objects have functions which may be accessed in script, however, it is important to note that the dom is an api that is accessible by javascript.
...for example, the following two lines which open a new window are functionally equivalent: window.open("test.xul","_new"); open("test.xul","_new"); when you declare a function or a variable at the top level of a script, that is outside another function, you are actually declaring a property of the global object.
... function gettext(){ return "message"; } alert(gettext()); alert(window.gettext()); thus, if you want to access variables or call a function declared in a script used by another window, you just need to access it using the other window's window object.
...And 15 more matches
XUL element attributes - Archive of obsolete content
when multiple datasources are used, one may override an assertion from another.
...when multiple datasources are used, one may override an assertion from another.
... collapsed type: boolean if true, then the element is collapsed and does not appear.
...And 15 more matches
Accessible multimedia - Learn web development
previous overview: accessibility next another category of content that can create accessibility problems is multimedia — video, audio, and image content need to be given proper textual alternatives so they can be understood by assistive technologies and their users.
... this article on the other hand looks at another general class of content that arguably isn't as easy to ensure accessibility for — multimedia.
...it looks like so in firefox and chrome: however, there are problems with these controls: they are not keyboard accessible in most browsers, i.e.
...And 15 more matches
Responsive design - Learn web development
note: see this simple liquid layout: example, source code.
... note: see this simple fixed-width layout: example, source code.
... note: the screenshots above are taken using the responsive design mode in firefox devtools.
...And 15 more matches
Introducing asynchronous JavaScript - Learn web development
while each operation is being processed, nothing else can happen — rendering is paused.
...you can try it for yourself: <button>click me</button> note: it is important to remember that alert(), while being very useful for demonstrating a synchronous blocking operation, is terrible for use in real world applications.
...that means that the following (pseudocode) wouldn't work: let response = fetch('myimage.png'); let blob = response.blob(); // display your image blob in the ui somehow that's because you don't know how long the image will take to download, so when you come to run the second line it will throw an error (possibly intermittently, possibly every time) because the response is not yet available.
...And 15 more matches
Fetching data from the server - Learn web development
previous overview: client-side web apis next another very common task in modern websites and applications is retrieving individual data items from the server to update sections of a webpage without having to load an entire new page.
... originally page loading on the web was simple — you'd send a request for a website to a server, and as long as nothing went wrong, the assets that made the web page would be downloaded and displayed on your computer.
... note: in the early days, this general technique was known as asynchronous javascript and xml (ajax), because it tended to use xmlhttprequest to request xml data.
...And 15 more matches
Basic math in JavaScript — numbers and operators - Learn web development
everybody loves math okay, maybe not.
... note: actually, javascript has a second number type, bigint, used for very, very large integers.
... for example, try typing these lines into your console: let mynumber = '74'; mynumber + 3; you end up with the result 743, not 77, because mynumber is actually defined as a string.
...And 15 more matches
Getting started with React - Learn web development
react is not a framework – it's not even exclusive to the web.
... use cases unlike the other frameworks covered in this module, react does not enforce strict rules around code conventions or file organization.
... while react can be used for small pieces of an interface, it's not as easy to "drop into" an application as a library like jquery, or even a framework like vue — it is more approachable when you build your entire app with react.
...And 15 more matches
Creating our first Vue component - Learn web development
note: if you need to check your code against our version, you can find a finished version of the sample vue app code in our todo-vue repository.
... objective: to learn how to create a vue component, render it inside another component, pass data into it using props, and save its state.
...note that the component file name and its representation in javascript is always in upper camel case (e.g.
...And 15 more matches
Obsolete Build Caveats and Tips
in reality, you should probably not need to do this, since that code is very obsolete.
... this note below seems redundant as this is true by default https://msdn.microsoft.com/en-us/library/dh8che7s%28v=vs.110%29.aspx note: starting with gecko 7.0, you should no longer include "-zc:wchar_t-" in the command line when building on windows.
...to get this code, do the following: # pull the mozilla source to the folder 191src/ - may take a while # as hundreds of megabytes of history is downloaded to .hg hg clone https://hg.mozilla.org/releases/mozilla-1.9.1/ 191src cd 191src note: starting with gecko 5.0, you can actually build firefox without a .mozconfig file.
...And 15 more matches
Following the Android Toasts Tutorial from a JNI Perspective
toasts do not have to be created with jni; they are exposed by the nativewindow feature on firefox for android, see toast documentation.
...the sig's will be represented as javascript strings in jni.jsm, and the sig's of the types are as follows: java type signature boolean z byte b char c class/object lclass name in slash notation here; double d float f int i long j short s void v array of type [sig here method format (sig of type of each argument here)sig of the return type here declaring a class/object is done in a special way.
... for example, if the class is blah.foo.bar then the signature of this will be this in slash notation with an l and ; around it.
...And 15 more matches
Handling Mozilla Security Bugs
note that the focus of this new structure is restricted solely to addressing actual security vulnerabilities arising from problems in mozilla code.
...some of these products may be used by large populations of end users, many of whom may not often upgrade or check for recent security fixes.
... as noted above, information about security bugs can be held confidential for some period of time; there is no pre-determined lmit on how long that time period might be.
...And 15 more matches
Avoiding leaks in JavaScript XPCOM components
using xpcom in javascript (also known as xpconnect) is an environment where memory management issues are not obvious.
... basics of memory management creating objects that are not a fixed size for the lifetime of the program (global variables) or a fixed size for the lifetime of a function (stack variables) requires a system for dynamic memory allocation: a system that allocates memory from a space called the heap.
... the requirements for such a memory allocation system are: memory should be returned to the heap when the program no longer needs it (or soon thereafter) so that the amount of memory consumed by the program does not increase.
...And 15 more matches
nsIContentViewer
to create an instance, use: var contentviewer = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsicontentviewer); method overview void clearhistoryentry(); void close(in nsishentry historyentry); void destroy(); [noscript,notxpcom,nostdcall] nsiviewptr findcontainerview(); void getbounds(in nsintrectref abounds); native code only!
... [noscript,notxpcom] nsidocumentptr getdocument(); void hide(); void init(in nsiwidgetptr aparentwidget, [const] in nsintrectref abounds); native code only!
... [noscript,notxpcom,nostdcall] void setnavigationtiming(in nsdomnavigationtimingptr atiming); void setpagemode(in boolean apagemode, in nsiprintsettings aprintsettings); void show(); void stop(); void unload(); obsolete since gecko 1.8 attributes attribute type description container nsisupports domdocument nsidomdocument ...
...And 15 more matches
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.
... by @mozilla.org/observer-service;1 as a service: var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); method overview void addobserver( in nsiobserver anobserver, in string atopic, in boolean ownsweak); nsisimpleenumerator enumerateobservers( in string atopic ); void notifyobservers( in nsisupports asubject, in string atopic, in wstring somedata ); void removeobserver( in nsiobserver anobserver, in string atopic ); methods addobserver() registers a given listener for a notifications regarding the specified topic.
...And 15 more matches
nsIOutputStream
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.
... note: this method may be called more than once, but subsequent calls are ignored.
...And 15 more matches
Working with windows in chrome code
var ww = components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getservice(components.interfaces.nsiwindowwatcher); var win = ww.openwindow(null, "chrome://myextension/content/about.xul", "aboutmyextension", "chrome,centerscreen", null); window object note the win variable in the above section, which is assigned the return value of window.open.
... note however, that the open() call returns before the window is fully loaded, so some calls, like win.document.getelementbyid() will fail.
...with xpcnativewrappers turned on (which is the default in firefox 1.5+), your extension can safely access the dom of the content document, but not the content javascript.
...And 15 more matches
Introduction to the File and Directory Entries API - Web APIs
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.
... while firefox supports blob storage for indexeddb, chrome currently does not (chrome is still implementing support for blob storage in indexeddb).
... audio or photo editor with offline access or local cache (great for performance and speed) the app can write to files in place (for example, overwriting just the id3/exif tags and not the entire file).
...And 15 more matches
Checking when a deadline is due - Web APIs
the main example application we will be referring to in this article is to-do list notifications, a simple to-do list application that stores task titles and deadline times and dates via indexeddb, and then provides users with notifications when deadline dates are reached, via the notification, and vibration apis.
... you can download the to-do list notifications app from github and play around with the source code, or view the app running live.
...if they do, we want to let the user know with some kind of notification.
...And 15 more matches
WebGL model view projection - Web APIs
note: this article is also available as an mdn content kit.
...any data which extends outside of the clip space is clipped off and not rendered.
... note: the code for each webglbox example is available in this github repo and is organized by section.
...And 15 more matches
ARIA: button role - Accessibility
<div id="savechanges" tabindex="0" role="button" aria-pressed="false">save</div> the above example creates a simple button which is first in the focus order, though <button> or <input> with type="button" should be used for buttons: <button id="savechanges">save</button> note: if using role="button" instead of the semantic <button> or <input type="button"> elements, you will need to make the element focusable and have to define event handlers for click and keydown events, including the enter and space keys, in order to process the user's input.
...a toggle button is a two-state button that can be either off (not pressed) or on (pressed).
...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.
...And 15 more matches
Operable - Accessibility
note: to read the w3c definitions for operable and its guidelines and success criteria, see principle 2: operable — user interface components and navigation must be operable.
... success criteria how to conform to the criteria practical resource 2.1.1 keyboard (a) all functionality should be accessible using keyboard controls, unless it cannot be done using the keyboard (e.g.
... this is very important so that keyboard users do not get trapped on specific sections of your apps.
...And 15 more matches
Viewport concepts - CSS: Cascading Style Sheets
your viewport is everything that is currently visible, notably, the "what is a viewport section", and perhaps some of the navigation menu.
... the size of the viewport depends on the size of the screen, whether the browser is in fullscreen mode or not, and whether or not the user zoomed in.
... content outside the viewport, such as the see also section in this document, is likely to not be visible onscreen until scrolled into view.
...And 15 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
which side this is will 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.
... hexadecimal string notation hexadecimal string notation represents a color using hexadecimal digits to represent each of the color components (red, green, and blue).
...if you use the single-digit notation, the final color is computed by using each component's digit twice; that is, "#d" becomes "#dd" when drawing.
...And 15 more matches
<input type="checkbox"> - HTML: Hypertext Markup Language
WebHTMLElementinputcheckbox
a checkbox allows you to select single values for submission in a form (or not).
... note: radio buttons are similar to checkboxes, but with an important distinction — radio buttons are grouped 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.
... note: if a checkbox is unchecked when its form is submitted, there is no value submitted to the server to represent its unchecked state (e.g.
...And 15 more matches
<input type="password"> - HTML: Hypertext Markup Language
WebHTMLElementinputpassword
the element is presented as a one-line plain text editor control in which the text is obscured so that it cannot be read, usually by replacing each character with a symbol such as the asterisk ("*") or a dot ("•").
... note: any forms involving sensitive information like passwords (e.g.
... note: the line feed (u+000a) and carriage return (u+000d) characters are not permitted in a password value.
...And 15 more matches
JavaScript data types and data structures - JavaScript
programming languages all have built-in data structures, but these often differ from one language to another.
...variables in javascript are not directly associated with any particular value type, and any variable can be assigned (and re-assigned) values of all types: let foo = 42; // foo is now a number foo = 'bar'; // foo is now a string foo = true; // foo is now a boolean data and structure types the latest ecmascript standard defines nine types: six data types that are primitives, checked by typeof operator: undefined : typeof instance === "undefined" boolean : typeof instance ==...
...special primitive type having additional usage for its value: if object is not inherited, then null is shown; object : typeof instance === "object".
...And 15 more matches
Indexed collections - JavaScript
javascript does not have an explicit array data type.
...let arr = new array(arraylength) // ...results in the same array as this let arr = array(arraylength) // this has exactly the same effect let arr = [] arr.length = arraylength note: in the above code, arraylength must be a number.
...a for...in loop will not find any property on the array.
...And 15 more matches
Memory Management - JavaScript
in contrast, javascript automatically allocates memory when objects are created and frees it when they are not used anymore (garbage collection).
... memory life cycle regardless of the programming language, the memory life cycle is pretty much always the same: allocate the memory you need use the allocated memory (read, write) release the allocated memory when it is not needed anymore the second part is explicit in all languages.
... allocation in javascript value initialization in order to not bother the programmer with allocations, javascript will automatically allocate memory when values are initially declared.
...And 15 more matches
Autoplay guide for media and Web Audio APIs - Web media technologies
autoplay blocking is not applied to <video> elements when the source media does not have an audio track, or if the audio track is muted.
...inaudible media are not affected by autoplay blocking.
... note: put another way, playback of any media that includes audio is generally blocked if the playback is programmatically initiated in a tab which has not yet had any user interaction.
...And 15 more matches
Content type - SVG: Scalable Vector Graphics
if not provided, the angle value is assumed to be in degrees.
... the format of an rgb value in hexadecimal notation is a "#" immediately followed by either three or six hexadecimal characters.
... the three-digit rgb notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros.
...And 15 more matches
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
firefox allows all of this by default, and if you don't pay attention to the details we describe here, your toolbar may not be as easy to customize as the rest.
... setting the image for a toolbar button is done with css: #xulschoolhello-hello-world-button { list-style-image: url("chrome://xulschoolhello/skin/hello-world.png"); } it's not really that simple to set the image for a toolbar button, because we need to consider the appearance of the button on different systems, and also consider the different button states, but we'll get into that further ahead.
...in most cases this is not what you want as default behavior, because it would be very hard for the user to discover your buttons.
...And 14 more matches
JavaScript Object Management - Archive of obsolete content
the first step to good javascript object management is having a namespace, or a javascript object that contains our code and data, that you know will not conflict with firefox code or other extensions.
... */ if (typeof 〈namespace〉 == "undefined") { var 〈namespace〉 = {}; }; note: the naming standard that we normally follow is that the first part of the namespace corresponds to the development group (or company), and the second to the specific project.
... notice how the 〈namespace〉 namespace is declared using var.
...And 14 more matches
CSS3 - Archive of obsolete content
each module being standardized independently, the standard css consists of css2.1 amended and extended by the completed modules, not necessary all with the same level number.
... 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.
... new pseudo-classes: :target, :enabled and :disabled, :checked, :indeterminate, :root, :nth-child and :nth-last-child, :nth-of-type and :nth-last-of-type, :last-child, :first-of-type and :last-of-type, :only-child and :only-of-type,:empty, and :not.
...And 14 more matches
Space Manager Detailed Design - Archive of obsolete content
the primary goal of the space manager is to provide information about those bands of space to support the css notion of floated elements.
...the class is only used in the layout module and cannot be exported outside of that module (nor does it need to be).
... it is not a general purpose class, and is not intended to be subclasses .
...And 14 more matches
Venkman Introduction - Archive of obsolete content
(note that venkman displays usage data when it starts up: "recorded local startup x, global yyy." this data comes from a counter built in to the application.
... stop button waiting for execution also note that when you are currently executing javascript and click the stop button, the javascript stops immediately.
... if you are not running javascript and click the stop button, it will display "...", as in the figure 4, to indicate that the debugger will stop at the next instruction, but doesn't have anywhere to stop yet.
...And 14 more matches
MenuItems - Archive of obsolete content
note that the image element is on a child level underneath the menu or menuitem, and it will have the class menu-iconic-icon.
... hence, -moz-image-region is not applied to the menu itself, but one level lower: <menuitem id="add-bookmark" class="menuitem-iconic" label="add bookmark" image="addbookmark.png"/> #add-bookmark { list-style-image: url('addbookmark.png'); } #add-bookmark .menu-iconic-icon { -moz-image-region: rect(0px, 16px, 16px, 0px) !important; } #add-bookmark:hover .menu-iconic-icon { -moz-image-region: rect(16px, 16px, 32px, 0px) !important; } this behavior is fundamentally different to other html elements, such as <li> or <div> where list-style-image and -moz-image-region can be applied at the same element level.
...if the checkbox is on, the toolbar is shown, whereas if the checkbox is off, the toolbar is not shown.
...And 14 more matches
Element Positioning - Archive of obsolete content
an example is shown below: example 1: source view <button label="ok" width="100" height="40"/> however, it is not recommended that you do this.
... it is not very portable and may not fit in with some themes.
...note that the css global skin of the xul application may also specify a min-width for the buttons and other elements, thus if simply setting the width property does not set the button width as you expect, try also to modify the button min-width property.
...And 14 more matches
Manifest Files - Archive of obsolete content
this latter chrome directory is normally the one used since the application directory might not have sufficient permissions to write into it.
... note: starting in gecko 2.0, only the file named chrome.manifest is read automatically; if you need to read multiple manifest files, use the manifest command in that file to import additional manifests.
...you can specify multiple packages by including another line in the manifest file.
...And 14 more matches
listbox - Archive of obsolete content
ment.createelement('listitem'); var cell = document.createelement('listcell'); cell.setattribute('label', gems[i].gem); row.appendchild(cell); cell = document.createelement('listcell'); cell.setattribute('label', gems[i].price ); row.appendchild(cell); thelist.appendchild(row); } attributes disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
... in the case of form elements, it will not be submitted.
...And 14 more matches
menuitem - Archive of obsolete content
this attribute does not apply to menus directly on the menubar.
... checked type: boolean indicates whether the element is checked or not.
... note: if the checked attribute is set to true, and you persist its value via the persist attribute, mozilla will fail to persist its value when the menuitem is unchecked because of bug 15232.
...And 14 more matches
Extentsions FAQ - Archive of obsolete content
use wm_copydata how to creating an extension that can replace html code on a specific page that does not use greasemonkey?
... not the best answer but a good starting point for the question asker to do some research towards the answer.
... why does his extension not able to read the contents of a folder and then produce a segmentation fault after his extension reads preferences in thunderbird?
...And 14 more matches
CSS values and units - Learn web development
note: you'll also see css values referred to as data types.
... note: yes, css values tend to be denoted using angle brackets, to differentiate them from css properties (e.g.
... <number> a <number> represents a decimal number — it may or may not have a decimal point with a fractional component, for example 0.255, 128, or -1.2.
...And 14 more matches
Practical positioning examples - Learn web development
our simple example will look like this once we are finished: note: you can see the finished example running live at info-box.html (source code).
... you might be thinking "why not just create the separate tabs as separate webpages, and just have the tabs clicking through to the separate pages to create the effect?" this code would be simpler, yes, but then each separate "page" view would actually be a newly-loaded webpage, which would make it harder to save information across views, and integrate this feature into a larger ui design.
... note: some web developers take things even further, only having one page of information loaded at once, and dynamically changing the information shown using a javascript feature such as xmlhttprequest.
...And 14 more matches
Supporting older browsers - Learn web development
however, there will be visitors to your site who use older browsers, or browsers which do not support the methods you have used.
... 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.
...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.
...And 14 more matches
HTML text fundamentals - Learn web development
the rain lashed down on the ...</p> <h2>chapter 2: the eternal silence</h2> <p>our protagonist could not so much as a whisper out of the shadowy figure ...</p> <h3>the specter speaks</h3> <p>several more hours had passed, when all of a sudden the specter sat bolt upright and exclaimed, "please have mercy on my soul!"</p> it's really up to you what the elements involved represent, as long as the hierarchy makes sense.
... this is because there are no elements to give the content structure, so the browser does not know what is a heading and what is a paragraph.
...if headings are not available, they will be forced to listen to the whole document read out loud.
...And 14 more matches
Useful string methods - Learn web development
previous overview: first steps next now that we've looked at the very basics of strings, let's move up a gear and start thinking about what useful operations we can do on strings with built-in methods, such as finding the length of a text string, joining and splitting strings, substituting one character in a string for another, and more.
... retrieving a specific string character on a related note, you can return any character inside a string by using square bracket notation — this means you include square brackets ([]) on the end of your variable name.
... inside the square brackets you include the number of the character you want to return, so for example to retrieve the first letter you'd do this: browsertype[0]; remember: computers count from 0, not 1!
...And 14 more matches
Object prototypes - Learn web development
previous overview: objects next prototypes are the mechanism by which javascript objects inherit features from one another.
... note: this article covers traditional javascript constructors and classes.
... note: it's important to understand that there is a distinction between an object's prototype (available via object.getprototypeof(obj), or via the deprecated __proto__ property) and the prototype property on constructor functions.
...And 14 more matches
Client-Server Overview - Learn web development
as a result url parameters/get requests are not used for requests that update data on the server.
...the response contains an http response status code indicating whether or not the request succeeded (e.g.
... "200 ok" for success, "404 not found" if the resource cannot be found, "403 forbidden" if the user isn't authorised to see the resource, etc).
...And 14 more matches
Accessibility in React - Learn web development
unfortunately, these features are not very accessible to keyboard-only users.
...that means the element that we were focused on vanishes, and nothing is in focus at all.
... const editfieldref = useref(null); const editbuttonref = useref(null); these refs have a default value of null because they will not have value until we attach them to their respective elements.
...And 14 more matches
Componentizing our Svelte app - Learn web development
eventually, we will split up our app into the following components: alert.svelte: a general notification box for communicating actions that have occurred.
... note: in the process of creating our first couple of components, we will also learn different techniques to communicate between components, and the pros and cons of each.
...first of all, we need to import it — add the following line at the top of the todos.svelte <script> section: import filterbutton from './filterbutton.svelte' now, replace the filters <div> with a call to the filterbutton component, which takes the current filter as a prop — the below line is all you need: <filterbutton {filter} /> note: remember that when the html attribute name and variable matches, they can be replaced with {variable}, that's why we could replace <filterbutton filter={filter} /> with <filterbutton {filter} />.
...And 14 more matches
The Firefox codebase: CSS Guidelines
this document contains guidelines defining how css inside the firefox codebase should be written, it is notably relevant for firefox front-end engineers.
...if not, using a semantic class name is more descriptive and usually better.
... also, it is good practice to introduce a common class when the new element you are styling reuses some styles from another element, this allows the maintenance cost and the amount of code duplication to be reduced.
...And 14 more matches
Commenting IDL for better documentation
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.
...And 14 more matches
Creating localizable web applications
note: most of the code snippets used in the examples below come from an early version of the getpersonas.com website.
...for example, if not all the pages of your website are going to be localized, you may consider removing links to the english-only pages from the navigation (headers, footers, sidebars) in the localized versions.
...'rtl' : 'ltr' ?>"> </body> </html> notice that <body/> is given a class equal to the current locale.
...And 14 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.
...if you don't implement a function, you should still provide a stub that returns ckr_function_not_supported.
...And 14 more matches
GCIntegration - SpiderMonkey Redirect 1
done naively, this technique can lead to reachable object not being marked.
... {{ svg{source: "http://people.mozilla.org/~wmccloskey/incremental1.svg", embedding: "iframe", height:"130"} }} assume object b is already marked, as in the leftmost frame, while objects a and c have not been marked yet.
... to understand the problem more, let's consider some reasons why barriers are not needed in common areas of firefox: if a pointer is never changed after it's initialized, then there's no need for a write barrier.
...And 14 more matches
GC Rooting Guide
the main types of gc thing pointer are: js::value jsobject* jsstring* jsscript* jsid note that js::value and jsid can contain pointers internally even though they are not a normal pointer type, hence their inclusion in this list.
... if you do not your program will not work correctly - if it works at all.
...instead of this: jsobject* localobj = js_getobjectofsomesort(cx); you would write this: js::rootedobject localobj(cx, js_getobjectofsomesort(cx)); spidermonkey makes it easy to remember to use js::rooted<t> types instead of a raw pointer because all of the api methods that may gc take a js::handle<t>, as described below, and js::rooted<t> autoconverts to js::handle<t> but a bare pointer does not.
...And 14 more matches
SpiderMonkey Internals
so optimizations such as dense arrays and the property cache are, alas, not transparently tucked away in the jsarray.* and jsobj.* files.
...therefore, almost all functions in spidermonkey, api or not, take a jscontext pointer as their first argument.
... compiler the compiler consumes javascript source code and produces a script which contains bytecode, source annotations, and a pool of string, number, and identifier literals.
...And 14 more matches
Animated PNG graphics
MozillaTechAPNG
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 contents of the canvas are not necessarily available to the decoder.
...this implies that some errors may not be detected until partway through the animation.
...And 14 more matches
Creating the Component Code
moving another layer outward is the nsimodule.
... this interface provides yet another abstraction of the nsifactory object, and may allow for multiple nsifactory objects.
... the key to this interface is that the return type of getclassobject does not have to be an nsifactory.
...And 14 more matches
IAccessibleTable
other-licenses/ia2/accessibletable.idlnot scriptable this interface gives access to a two-dimensional table.
...however, in some cases that kind of implementation will not be possible.
... when the table cells are not direct children of a table, the object representing the cell can define a "table-cell-index" object attribute identifying the 0 based table cell index.
...And 14 more matches
mozIStorageConnection
note: this is not reliable if you are using asynchronous statements or if you are using the connection on multiple threads.
... note: this is not reliable if you are using asynchronous statements or if you are using the connection on multiple threads.
... note: this is not reliable if you are using asynchronous statements or if you are using the connection on multiple threads.
...And 14 more matches
nsICachingChannel
method overview boolean isfromcache(); obsolete since gecko 2.0 attributes attribute type description cacheasfile boolean specifies whether or not the data should be cached to a file.
... this may fail if the disk cache is not present.
... cacheforofflineuse boolean specifies whether or not the data should be placed in the offline cache, in addition to normal memory/disk caching.
...And 14 more matches
nsILoginManagerStorage
note: extensions that simply want to access/store logins should use the login manager service and nsiloginmanager interface instead.
... gecko 1.9.1 note default values for the nsiloginmetainfo properties are created if the specified login doesn't explicitly specify them.
...passing null should not match any logins, and should return 0.
...And 14 more matches
nsINavHistoryQuery
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 nsinavhistoryquery is not intended to be a super-general query mechanism.
... annotation autf8string the annotation name.
... annotationisnot boolean test for existance or non-existance of a given annotation.
...And 14 more matches
nsMsgMessageFlags
constants name value description read 0x00000001 indicates whether or not the message is read.
... replied 0x00000002 indicates whether or not the message has been replied to.
... marked 0x00000004 indicates whether or not the message has been flagged/starred expunged 0x00000008 indicates whether or not the message is deleted (but not compacted) hasre 0x00000010 indicates whether or not 're: ' should be added to the head of the subject to get the proper subject.
...And 14 more matches
Setting HTTP request headers
note: if you are making up your own http header, you must put a x- in front of the name.
... (in our example, our made up http header is x-hello and not hello because we correctly added the x- in front of our name.) no longer the case: http://tools.ietf.org/html/rfc6648 notifications the question that may be coming to your mind right now is, how do you get the nsihttpchannel when an http request is made.
...trapping other requests is done with notifications, which are a lot like events or signals found in other languages and frameworks.
...And 14 more matches
Edit fonts - Firefox Developer Tools
note: the updated font tools as shown in this article are available in firefox 63 onwards; if you are using an older version of firefox the tools will not look or behave quite the same, but they will be similar (most notably the font editor will not be available).
...in firefox 61 and 62, this section does not exist.
...empty elements 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.
...And 14 more matches
AddressErrors - Web APIs
properties addressline a domstring which, if present, indicates that the addressline property of the paymentaddress could not be validated.
... city a domstring which, if present, indicates that the city property of the paymentaddress could not be validated.
... country a domstring which, if present, indicates that the country property of the paymentaddress could not be validated.
...And 14 more matches
Drawing shapes with canvas - Web APIs
a path is a list of points, connected by segments of lines that can be of different shapes, curved or not, of different width and of different color.
... note: when the current path is empty, such as immediately after calling beginpath(), or on a newly created canvas, the first path construction command is always treated as a moveto(), regardless of what it actually is.
...if the shape has already been closed or there's only one point in the list, this function does nothing.
...And 14 more matches
DOMMatrixReadOnly - Web APIs
the original matrix is not modified.
...the original matrix is not modified.
...if the matrix cannot be inverted, the new matrix's components are all set to nan and its is2d property is set to false.
...And 14 more matches
Recommended Drag Types - Web APIs
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.
... note: in older code, you may find text/unicode or the text types.
...And 14 more matches
Intersection Observer API - Web APIs
deciding whether or not to perform tasks or animation processes based on whether or not the user will see the result.
...it uses a vendor-provided library to manage the advertisements placed periodically throughout the page, has animated graphics here and there, and uses a custom library that draws notification boxes and the like.
...the author of the web site may not even realize this is happening, since they may know very little about the inner workings of the two libraries they are using.
...And 14 more matches
RTCPeerConnection.createOffer() - Web APIs
specify false to keep the same credentials and therefore not restart ice.
... offertoreceiveaudio optional (legacy) a legacy boolean option which used to control whether or not to offer to the remote peer the opportunity to try to send audio.
... if this value is false, the remote peer will not be offered to send audio data, even if the local side will be sending audio data.
...And 14 more matches
Rendering and the WebXR frame animation callback - Web APIs
note that this code doesn't have a loop!
... instead, the frame rendering code—in this case, a function named mydrawframe()—is responsible for scheduling time to draw another frame by once again calling requestanimationframe().
... but not all displays run at 60 hz; nowadays, higher performance displays are beginning to use much higher refresh rates.
...And 14 more matches
Cognitive accessibility - Accessibility
another form it can take is depression, such as when mourning the loss of a loved one, or being momentarily saddened by a tweet or video they just saw online.
... in more than one way, such as by text-to-speech or by video; providing easily-understood content, such as text written using plain-language standards; focusing attention on important content; minimizing distractions, such as unnecessary content or advertisements; providing consistent web page layout and navigation; incorporating familiar elements, such as underlined links that are blue when not visited and purple when visited; dividing processes into logical, essential steps with progress indicators; making website authentication as easy as possible without compromising security; and making forms easy to complete, such as with clear error messages and simple error recovery.
...if the time limit is longer than 20 hours, accommodations are not required.
...And 14 more matches
Creating a cross-browser video player - Developer guides
note: you can see the example running live, or check out the source code on github.
...to anyone familiar with html5 markup and the <video> element, there should be nothing here that surprises you.
... note: ie9 behaves differently than most other browsers when a poster attribute is set.
...And 14 more matches
Audio and Video Delivery - Developer guides
note: the preload attribute may be ignored by some mobile browsers.
... note: the autoplay attribute may be ignored by some mobile browsers.
... note: play will be ignored by most browsers unless issued by a user-initiated event.
...And 14 more matches
Using HTML sections and outlines - Developer guides
therefore the outline algorithm should not be used to convey document structure to users.
...for example, <div class="navigation"> does not suggest any meaning about its content to a browser; only a human reading the html source can divine the meaning of a class like navigation.
...you can have primary and secondary menus, but you cannot nest a <nav> element inside another <nav> element.
...And 14 more matches
HTTP caching - HTTP
WebHTTPCaching
on the other side, it has to be configured properly as not all resources stay identical forever: it is important to cache a resource only until it changes, not longer.
... error responses: a 404 (not found) result page.
... no caching the cache should not store anything about the client request or server response.
...And 14 more matches
Cache-Control - HTTP
a given directive in a request does not mean the same directive should be in the response.
... cache-control: must-revalidate 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.
... 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 authorization is unset either has a status code of 301, 302, 307, 308, or 410 or has public, max-age or s-maxage in cache-control or has expires set public the response may be stored by any cache, even if the response is normally non-cacheable.
...And 14 more matches
Firefox user agent string reference - HTTP
windows, mac, linux or android), and whether or not it's a mobile phone.
...note that platform can consist of multiple "; "-separated tokens.
... for other products based on gecko, the string can take one of two forms, where the tokens have the same meaning except those noted below: mozilla/5.0 (platform; rv:geckoversion) gecko/geckotrail appname/appversion mozilla/5.0 (platform; rv:geckoversion) gecko/geckotrail firefox/firefoxversion appname/appversion appname/appversion indicates the application name and version.
...And 14 more matches
Object.create() - JavaScript
propertiesobject optional if specified and not undefined, an object whose enumerable own properties (that is, those properties defined upon itself and not enumerable properties along its prototype chain) specify property descriptors to be added to the newly-created object, with the corresponding property names.
...however, when attempting to actually use these objects, their differences quickly become apparent: > "oco is: " + oco // shows "oco is: [object object]" > "ocn is: " + ocn // throws error: cannot convert object to primitive value testing just a few of the many most basic built-in functions shows the magnitude of the problem more clearly: > alert(oco) // shows [object object] > alert(ocn) // throws error: cannot convert object to primitive value > oco.tostring() // shows [object object] > ocn.tostring() // throws error: ocn.tostring is not a function > oco.valueof() // shows {} > ocn.
...valueof() // throws error: ocn.valueof is not a function > oco.hasownproperty("p") // shows "true" > ocn.hasownproperty("p") // throws error: ocn.hasownproperty is not a function > oco.constructor // shows "object() { [native code] }" > ocn.constructor // shows "undefined" as said, these differences can make debugging even simple-seeming problems quickly go astray.
...And 14 more matches
Using the WebAssembly JavaScript API - WebAssembly
if you have already compiled a module from another language using tools like emscripten, or loaded and run the code yourself, the next step is to learn more about using the other features of the webassembly javascript api.
... note: if you are unfamiliar with the basic concepts mentioned in this article and need more explanation, read webassembly concepts first, then come back.
... note: you can find the sample code in our webassembly-examples github repo.
...And 14 more matches
Overview - Archive of obsolete content
the annotator uses content scripts to build user interfaces, get user input, and examine the dom of pages loaded by the user.
... we could represent the basic interactions between the main module and the various content scripts like this: user interface the annotator's main user interface consists of a widget and three panels.
... the widget is used to switch the annotator on and off, and to display a list of all the stored annotations.
...And 13 more matches
No Proxy For configuration - Archive of obsolete content
this feature was originally designed as a "blacklist" of sites or domains that was within the intranet, and should not be accessed via the proxy server.
... note for former-ie users: "*" is supported only at the beginning of domain filters (*.mozilla.org).
... limitations a domain, including sub-domains domain suffix "mozilla.org" does not block domains that end in the same string (amozilla.org) sub-domains domain suffix, starting with a dot ".mozilla.org" does not block the main domain (mozilla.org) a hostname (without domain) hostname-only (see problems below) "localhost" also blocks any possible domains that start with the entry ("www.otherdomain.localhost") a hostname (with domain) domain name "www.mozilla.org" does not block hostnames or domains that end in the same string (other-www.mozilla.org) an ip address ip address "1.2.3.4" does not block hostnames that resolve to ...
...And 13 more matches
Simple Storage - Archive of obsolete content
ode persistently stores some data: jetpack.future.import("storage.simple"); var mystorage = jetpack.storage.simple; mystorage.fribblefrops = [1, 3, 3, 7]; mystorage.heimelfarbs = { bar: "baz" }; and this code -- pretend it's in the same jetpack as the code above -- simply uses that data: mystorage.fribblefrops.foreach(function (elt) console.log(elt)); var bar = mystorage.heimelfarbs.bar; jetpack.notifications.show(bar.baz); that's all there is to it!
... note that these examples create a mystorage variable to emphasize the fact that jetpack.storage.simple is just a normal javascript object.
...it's a simple note-taking jetpack.
...And 13 more matches
Adding HTML Elements - Archive of obsolete content
note that mozilla does not actually download this url, but it does recognize it as being html.
... using html elements you can use any html tag although some such as head and body are not really useful.
...you should always use xul features if they are available and you probably should not use tables for layout in xul.
...And 13 more matches
Getting started with XULRunner - Archive of obsolete content
since we are not creating any binary xpcom components, we only need to download and install the xulrunner runtime package, not the sdk.
... the xulrunner download for windows is a zip file, not a true install.
... in ubuntu desktop and its variants (xubuntu, kubuntu, ...), from version 11.10 (oneiric ocelot), xulrunner is not longer maintained and doesn't exist in ubuntu repository.
...And 13 more matches
TCP/IP Security - Archive of obsolete content
because of this, a security control at a higher layer cannot provide protection for lower layers, because the lower layers perform functions of which the higher layers are not aware.
... also, some applications, particularly off-the-shelf software, may not be capable of providing such protection.
... while application layer controls can protect application data, they cannot protect tcp/ip information such as ip addresses because this information exists at a lower layer.
...And 13 more matches
Common Firefox theme issues and solutions - Archive of obsolete content
the purpose of this page is to provide provide theme developers with notes on how to fix common issues.
... it is a companion document to the amo editors guide common theme problems, which provides editors with "boilerplate" copy and paste review notes for common theme issues.
...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.
...And 13 more matches
The box model - Learn web development
if a box has an outer display type of inline, then: the box will not break onto a new line.
... the width and height properties will not apply.
... vertical padding, margins, and borders will apply but will not cause other inline boxes to move away from the box.
...And 13 more matches
Styling links - Learn web development
default styles the following example illustrates what a link will behave like by default (the css is simply enlarging and centering the text to make it stand out more.) <p><a href="#">a simple link</a></p> p { font-size: 2rem; text-align: center; } note: all the links in the examples in this page are fake links — a # (hash, or pound sign) is put in place of the real url.
... you'll notice a few things as you explore the default styles: links are underlined.
...this doesn't mean that you shouldn't style links at all, just that you should not stray too far from the expected behaviour.
...And 13 more matches
Introduction to web APIs - Learn web development
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.
... 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.
...And 13 more matches
Aprender y obtener ayuda - Learn web development
not know how to fix problem c.
... note: the above text should have given you an important fact — you aren't expected to remember everything!
...and there is also nothing wrong with creating your own code examples on your computer, or in an online code editor like jsbin, codepen, or glitch.
...And 13 more matches
Perceived performance - Learn web development
how a user perceives your performance is as important, or perhaps more important, than any objective statistic, but it's subjective, and not as readily measurable.
... perceived performance is user perspective, not a metric.
...such an approach is much better than just showing nothing, which will make it feel like it is taking a lot longer and possibly lead to your users thinking it is broken and giving up.
...And 13 more matches
Mozilla's Section 508 Compliance
the following is provided for informational purposes only and is not a legally binding voluntary product accessibility template (vpat).
... caveats: 1) although sidebar cannot be customized without a mouse, all sidebar functions that come with the browser are available through other means 2) java and in-page plugins cannot be used with the keyboard, so they must not be installed for keyboard-only users additional features for the keyboard: 1) find as you type allows for quick navigation to links and convenient text searching 2) browse with caret (f...
... (b) applications shall not disrupt or disable activated features of other products that are identified as accessibility features, where those features are developed and documented according to industry standards.
...And 13 more matches
JavaScript-DOM Prototypes in Mozilla
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).
... var obj = document.images[0]; here, obj will not really have any properties (except for the standard jsobject properties such as constructor, and the non-standard __parent__, __proto__, etc.), all the dom functionality of obj comes from obj's prototype (obj.__proto__) that xpconnect sets up when exposing the first image in document to javascript.
...And 13 more matches
WebRequest.jsm
it also documents two data structures that vary from one event to another: the opt_extrainfospec argument to addlistener() the properties of the argument passed to the listener.
... browser object the xul browser into which the resource will be loaded, or null if the resource will not be loaded into a xul browser.
... browser object the xul browser into which the resource will be loaded, or null if the resource will not be loaded into a xul browser.
...And 13 more matches
NSS environment variables
note: nss environment variables are subject to be changed and/or removed from nss.
...pkcs #11 module logger 3.6 nss_default_db_type string ("dbm", "sql", or "extern") determines the default database type to open if the app does not specify.
...in other words a connection will be dropped at initial handshake if a server or client do not support safe renegotiation.
...And 13 more matches
NSS Tools modutil
note that you cannot delete the netscape communicator internal pkcs #11 module.
...if the token has not been initialized, this option initializes the password.
... -undefault modulename specify the security mechanisms for which the named module will not be a default provider.
...And 13 more matches
certutil
the certificate database should already exist; if one is not present, this option will initialize one by default.
...if this argument is not used, certutil prompts for a filename.
...some smart cards (for example, the litronic card) do not let you remove a public key you have generated.
...And 13 more matches
Scripting Java
note that the ecma standard doesn't cover communication with java (or with any external object system for that matter).
... it's important to note that java imports java.lang.* implicitly, while rhino does not.
...because of this conflict, it's a good idea not to use importpackage on the java.lang package.
...And 13 more matches
SpiderMonkey Build Documentation
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.
... spidermonkey does not support building in your source directory.
... note: if you are on mac and getting an error similar to "checking whether the c compiler (gcc-4.2 ) works...
...And 13 more matches
TPS Tests
it's name stands for testing and profiling tool for sync (which is a misnomer, since it doesn't do any profiling), and it should not be confused with the similarly named tests in talos.
...even if you opt not to use restmail, do not use your personal firefox account, as tps will delete and replace the data in it many times, not to mention the first run is very likely to fail, since it expects a clean start).
... note: be prepared not to use your computer for 15 or so minutes after starting a full run of tps, as it will open and close a fairly large number of firefox windows.
...And 13 more matches
mozIAsyncFavicons
1.0 66 introduced gecko 6.0 inherits from: nsisupports last changed in gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) nsifaviconservice handles this interface, so you do not need to directly create a new service.
...note that the callback's adatalen will be 0, adata will be null, and amimetype will be empty -- only auri will be non-zero/null/empty.
... acallback this callback is always invoked to notify the result of the lookup.
...And 13 more matches
nsIHttpServer
(not supported) * @param function callback optional callback */ listen: function(port, opt, callback) { if (arguments.length == 2 && "function" == typeof opt) { callback = opt; } if (callback) { this.registerprefixhandler("/", callback); } let host = "localhost"; if (ty...
... * * @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 * (perhaps because the port is already in use or because the process does * not have privileges to do so) * @note * behavior is undefined if this method is called after stop() has been * called on this but before the provided callback function has been * called.
... * * @param callback * an asynchronous callback used to notify the user when this server is * stopped and all pending requests have been fully served * @throws ns_error_null_pointer * if callback is null * @throws ns_error_unexpected * if this server is not running */ void stop(in nsihttpserverstoppedcallback callback); /** * associates the local file represented by the string file with all requests * which match request.
...And 13 more matches
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 nsidommozsmsmessage amessage); void notifygetsmsfailed(in long arequestid, in long aerror); void notifygotnextmessage(in long arequestid, in nsidommozsmsmessage amessage); void notifygotsms(in long arequestid, in nsidommozsmsmessage amessage); void notifymarkedmessageread(in long arequestid, in bool aread); void notifymarkmessagereadfailed(in long arequestid, in l...
...ong aerror); void notifynomessageinlist(in long arequestid); void notifyreadmessagelistfailed(in long arequestid, in long aerror); void notifysmsdeleted(in long arequestid, in bool adeleted); void notifysmsdeletefailed(in long arequestid, in long aerror); void notifysmssendfailed(in long arequestid, in long aerror); void notifysmssent(in long arequestid, in nsidommozsmsmessage amessage); constants all sms related errors that could apply to smsrequest objects.
...And 13 more matches
Xray vision
any expandos are invisible, and if any properties of the object have been redefined, it sees the original implementation, not the redefined version.
... so in the example above, chrome code calling the content's window.confirm() would get the original version of confirm(), not the redefined version.
... it's worth emphasizing that even if content tricks chrome into running some unexpected code, that code does not run with chrome privileges.
...And 13 more matches
Mail and RDF
eventually we'll probably hang mail filters, annotations, etc, off of nodes in the graph.
...note that it does not actually know anything about the servers who's uris it returns.
...it also answers queries about various properties of folders such as the total number of messages, whether or not this folder is actually a root server, and so forth.
...And 13 more matches
BiquadFilterNode() - Web APIs
options optional options are as follows: type: one of "lowpass", "highpass", "bandpass", "lowshelf", "highshelf", "peaking", "notch", "allpass".
...please note that for this filter type, this value is not a traditional q, but is a resonance value in decibels.
... gain: not used.
...And 13 more matches
Using Fetch - Web APIs
this is just an http response, not the actual json.
... to extract the json body content from the response, we use the json() method (defined on the body mixin, which is implemented by both the request and response objects.) note: the body mixin also has similar methods to extract other types of body content; see the body section for more.
...s-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url body: json.stringify(data) // body data type must match "content-type" header }); return response.json(); // parses json response into native javascript objects } postdata('https://example.com/answer', { answer: 42 }) .then(data => { console.log(data); // json data parsed by `data.json()` call }); note that mode: "no-cors" only allows a limited set of headers in the request: accept accept-language content-language content-type with a value of application/x-www-form-urlencoded, multipart/form-data, or text/plain sending a request with credentials included to cause browsers to send a request with credentials included, even for a cross-origin call, add credentials: 'include' to the init ...
...And 13 more matches
FileSystemEntrySync - Web APIs
[ todo: specify what kind of metadata ] metadata getmetada () raises (fileexception); parameter none returns metadata exceptions this method can raise a fileexception with the following codes: exception description not_found_err the entry does not exist.
...[todo: what if the directory is not empty?
... you cannot do the following: move a directory inside itself or to any child at any depth move an entry into its parent if a name different from its current one isn't provided move a file to a path occupied by a directory or move a directory to a path occupied by a file move any element to a path occupied by a directory that is not empty.
...And 13 more matches
Writing WebSocket servers - Web APIs
a websocket server is nothing more than an application listening on any port of a tcp server that follows a specific protocol.
...this is not a tutorial in any specific language, but serves as a guide to facilitate writing your own server.
... note: read the latest official websockets specification, rfc 6455.
...And 13 more matches
window.postMessage() - Web APIs
broadly, one window may obtain a reference to another (e.g., via targetwindow = window.opener), and then dispatch a messageevent on it with targetwindow.postmessage().
...if at the time the event is scheduled to be dispatched the scheme, hostname, or port of targetwindow's document does not match that provided in targetorigin, the event will not be dispatched; only if all three match will the event be dispatched.
...always provide a specific targetorigin, not *, if you know where the other window's document should be located.
...And 13 more matches
ARIA: listbox role - Accessibility
when a list is tabbed to, the first item in the list will be selected if nothing else already is.
...all options that are not selected have aria-selected set to false.
... if an option is not selectable, omit the aria-selected.
...And 13 more matches
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
WebCSS:is
note: :matches() was renamed to :is() in csswg issue #3258.
... 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.
... /* 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 equivalent to the following */ header p:hover, main p:hover, footer p:hover { color: red; cursor: pointer; } /* backwards-compatible version with :-*-any() and :matches() (it is not possible to group selectors into single rule, because presence of invalid selector would invalidate whole rule.) */ :-webkit-any(header, main, footer) p:hover { color: red; cursor: pointer; } :-moz-any(header, main, footer) p:hover { color: red; cursor: pointer; } :matches(header, main, footer) p:hover { color: red; cursor: pointer; } syntax :is( <complex-selector-list> )where <...
...And 13 more matches
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
css grid layout does not have the same issues that tables did, our grid structure is defined in css rather than in the mark-up.
...however, these are not a substitute for correct ordering of the document source.
... the order property and grid placement do not affect ordering in non-visual media (such as speech).
...And 13 more matches
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
they are set using custom property notation (e.g., --main-color: black;) and are accessed using the var() function (e.g., color: var(--main-color);).
...like any other property, this is written inside a ruleset, like so: element { --main-bg-color: brown; } note that the selector given to the ruleset defines the scope that the custom property can be used in.
... note: custom property names are case sensitive — --my-color will be treated as a separate custom property to --my-color.
...And 13 more matches
Function.prototype.bind() - JavaScript
thus, presented below are two options for function.prototype.bind() polyfills: the first one is much smaller and more performant, but does not work when using the new operator.
... // does not work with `new (funca.bind(thisarg, args))` if (!function.prototype.bind) (function(){ var slice = array.prototype.slice; function.prototype.bind = function() { var thatfunc = this, thatarg = arguments[0]; var args = slice.call(arguments, 1); if (typeof thatfunc !== 'function') { // closest thing possible to the ecmascript 5 // internal iscallable function throw new typeerror('function.prototype.bind - ' + 'what is trying to be bound is not callable'); } return function(){ var f...
...uncargs = args.concat(slice.call(arguments)) return thatfunc.apply(thatarg, funcargs); }; }; })(); 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 bind() in implementations that do not natively support it.
...And 13 more matches
Object.defineProperty() - JavaScript
by default, values added using object.defineproperty() are immutable and not enumerable.
...a data descriptor is a property that has a value, which may or may not be writable.
...a descriptor must be one of these two flavors; it cannot be both.
...And 13 more matches
Object.freeze() - JavaScript
description nothing can be added to or removed from the properties set of a frozen object.
... any attempt to do so will fail, either silently or by throwing a typeerror exception (most commonly, but not exclusively, when in strict mode).
... for data properties of a frozen object, values cannot be changed, the writable and configurable attributes are set to false.
...And 13 more matches
RegExp - JavaScript
description literal notation and constructor there are two ways to create a regexp object: a literal notation and a constructor.
... the literal notation's parameters are enclosed between slashes and do not use quotation marks.
... the constructor function's parameters are not enclosed between slashes but do use quotation marks.
...And 13 more matches
this - JavaScript
description global context in the global execution context (outside of any function), this refers to the global object whether in strict mode or not.
... // in web browsers, the window object is also the global object: console.log(this === window); // true a = 37; console.log(window.a); // 37 this.b = "mdn"; console.log(window.b) // "mdn" console.log(b) // "mdn" note: you can always easily get the global object using the global globalthis property, regardless of the current context in which your code is running.
... since the following code is not in strict mode, and because the value of this is not set by the call, this will default to the global object, which is window in a browser.
...And 13 more matches
Authoring MathML - MathML
html becomes verbose when your document contains advanced structures like lists or tables but fortunately there are many generators from simple notations, wysiwyg editors and other content management systems to help writing web pages.
... mathematical notations are even more complex with structures like fractions, square roots or matrices that are likely to require their own tags.
... note that by design, mathml is well-integrated in html5 and in particular you can use usual web features like css, dom, javascript or svg.
...And 13 more matches
Populating the page: how browsers work - Web Performance
tls negotiation for secure connections established over https, another "handshake" is required.
... while making the connection secure adds time to the page load, a secure connection is worth the latency expense, as the data transmitted between the browser and the web server cannot be decrypted by a third party.
... <!doctype html> <html> <head> <meta charset="utf-8"/> <title>my simple page</title> <link rel="stylesheet" src="styles.css"/> <script src="myscript.js"></script> </head> <body> <h1 class="heading">my page</h1> <p>a paragraph with a <a href="https://example.com/about">link</a></p> <div> <img src="myimage.jpg" alt="image description"/> </div> <script src="anotherscript.js"></script> </body> </html> this response for this initial request contains the first byte of data received.
...And 13 more matches
simple-storage - Archive of obsolete content
if you'd like to store other types of values, you'll first have to convert them to strings or another one of these types.
... be careful to set properties on the storage object and not the module itself, as demonstrated below: // this is not good!
... var ss = require("sdk/simple-storage"); ss.foo = "i will not be saved!
...And 12 more matches
cfx - Archive of obsolete content
but note that the version must be 4.0b7 or later.
...but note that at present only firefox is supported.
... --no-run with this option cfx will not execute the command, but will print out the command that it would have used to execute the command.
...And 12 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
use of mozilla interfaces that are not exposed via xpcom (e.g.
... note: with the modern jit javascript engine in gecko and js-ctypes more extension code can be written only in javascript than ever before.
...i should also stress that you do not have to build mozilla or use the mozilla build system if you want to create c++ components for mozilla.
...And 12 more matches
Index of archived content - Archive of obsolete content
.htaccess ( hypertext access ) 2015 mdn fellowship program api navigator navigator.moznotification add-ons add-on sdk builder guides content scripts communicating with other scripts communicating using "port" communicating using "postmessage" cross-domain content scripts interacting with page scripts loading content scripts reddit example port self ...
... testing the add-on sdk two types of scripts working with events xul migration guide high-level apis addon-page base64 clipboard context-menu hotkeys indexed-db l10n notifications page-mod page-worker panel passwords private-browsing querystring request selection self simple-prefs simple-storage system tabs timers ui url widget ...
...ton/action ui/button/toggle ui/frame ui/id ui/sidebar ui/toolbar util/array util/collection util/deprecate util/list util/match-pattern util/object util/uuid window/utils release notes tools cfx cfx to jpm console jpm jpm-mobile jpmignore package.json tutorials add a context menu item add a menu item to firefox adding a button to the...
...And 12 more matches
Autodial for Windows NT - Archive of obsolete content
it is not present in early versions of windows until internet explorer is installed.
...if this service is running, and control panel | network connections | advanced | dialup preferences is set to enable autodial, then any application trying to access the internet will trigger the autodial feature whenever an internet address cannot be reached.
... most systems are not set up correctly for this to happen, and most users have no idea how all these details work.
...And 12 more matches
Simple Storage - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
...this code persistently stores some data: jetpack.future.import("storage.simple");var mystorage = jetpack.storage.simple;mystorage.fribblefrops = [1, 3, 3, 7];mystorage.heimelfarbs = { bar: "baz" }; and this code -- pretend it's in the same jetpack as the code above -- simply uses that data: mystorage.fribblefrops.foreach(function (elt) console.log(elt));var bar = mystorage.heimelfarbs.bar;jetpack.notifications.show(bar.baz); that's all there is to it!
... note that these examples create a mystorage variable to emphasize the fact that jetpack.storage.simple is just a normal javascript object.
...And 12 more matches
Anonymous Content - Archive of obsolete content
a sample xbl binding for the file widget might look as follows: <binding id="fileupload"> <content> <html:input type="text"/> <html:input type="button"/> </content> </binding> because this content is not visible to its parent element, it is said to be anonymous content.
...the anonymous content is not accessible via the childnodes list for the bound element, nor is it accessible using firstchild/nextsibling to iterate over the children of the bound element.
... the xbl:text value cannot occur by itself in the list.
...And 12 more matches
Box Objects - Archive of obsolete content
the layout tree holds the structure as the nodes are expected to be displayed there is not necessarily a one to one relationship between content and layout nodes.
...similarly, any element that has been hidden will not have a layout object either.
...box objects the layout objects are not accessible to the developer for manipulating.
...And 12 more matches
Broadcasters and Observers - Archive of obsolete content
example 1 : source view <command id="my_command" label="open"/> <button command="my_command"/> <checkbox label="open in a new window" command="my_command"/> in this example, the button does not have a label attribute, however it is attached to a command that does.
...a broadcaster would be used to hold, for instance, a flag to indicate whether the user was online or not.
...whenever the value of any of the attributes on the broadcaster changes, the observers are all notified and they update their own attributes to match.
...And 12 more matches
Trees and Templates - Archive of obsolete content
this means that elements will not be created for every row in the tree, making it more efficient.
...if you do use a content builder instead, note that the content won't generally get built until it is needed.
...notice how it has been placed on the treeitem in the example, even though it is not a direct descendant of the rule element.
...And 12 more matches
Archived Mozilla and build documentation - Archive of obsolete content
chromeless [this project may not be active — check github https://github.com/mozilla/chromeless] creating a firefox sidebar extension this article describes how to create a registered sidebar for firefox 2 or greater.
... whether or not the latest version of the code is compiling successfully and passing tests).
... 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.
...And 12 more matches
Old Proxy API - 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.
...the spidermonkey implementation may not reflect the latest specification draft.
...And 12 more matches
Overflowing content - Learn web development
why not hide overflowing content?
... why not scale the size of the container to fit all the content?
... wherever possible, css does not hide content.
...And 12 more matches
Introduction to CSS layout - Learn web development
normal flow normal flow is how the browser lays out html pages by default when you do nothing to control page layout.
... let's look at a quick html example: <p>i love my cat.</p> <ul> <li>buy cat food</li> <li>exercise</li> <li>cheer up friend</li> </ul> <p>the end!</p> by default, the browser will display this code as follows: note here how the html is displayed in the exact order in which it appears in the source code, with elements stacked up on top of one another — the first paragraph, followed by the unordered list, followed by the second paragraph.
... note: the direction in which block element contents are laid out is described as the block direction.
...And 12 more matches
Advanced form styling - Learn web development
unfortunately, the behavior of this property's original implementations was very different across browsers, making it not very usable.
... input { -webkit-appearance: none; appearance: none; } note: it is a good idea to always include both declarations — prefixed and unprefixed — when using a prefixed property.
...with aqua enabled, some form controls are not scalable.
...And 12 more matches
Tips for authoring fast-loading HTML pages - Learn web development
an optimized web page not only provides for a more responsive site for your visitors but also reduces the load on your web servers and internet connection.
... optimizing page load performance is not just for content which will be viewed by narrowband dial-up or mobile device visitors.
...this technique works best with elements that will have limited dimensions, and will not work for every use of a background image.
...And 12 more matches
Advanced text formatting - Learn web development
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).
...let's look at an example of a set of terms and definitions: soliloquy in drama, where a character speaks to themselves, representing their inner thoughts or feelings and in the process relaying them to the audience (but not to other characters.) monologue in drama, where a character speaks their thoughts out loud to share them with the audience and any other characters present.
...let's finish marking up our example: <dl> <dt>soliloquy</dt> <dd>in drama, where a character speaks to themselves, representing their inner thoughts or feelings and in the process relaying them to the audience (but not to other characters.)</dd> <dt>monologue</dt> <dd>in drama, where a character speaks their thoughts out loud to share them with the audience and any other characters present.</dd> <dt>aside</dt> <dd>in drama, where a character shares a comment only with the audience for humorous or dramatic effect.
...And 12 more matches
Video and Audio APIs - Learn web development
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.
...And 12 more matches
Arrays - Learn web development
we can also mix data types in a single array — we do not have to limit ourselves to storing only numbers in one array, and in another only strings.
... accessing and modifying array items you can then access individual items in the array using bracket notation, in the same way that you accessed the letters in a string.
...try this: shopping[0] = 'tahini'; shopping; // shopping will now return [ "tahini", "milk", "cheese", "hummus", "noodles" ] note: we've said it before, but just as a reminder — computers start counting from 0!
...And 12 more matches
JavaScript object basics - Learn web development
note: if you are having trouble getting this to work, try comparing your code against our version — see oojs-finished.html (also see it running live).
... dot notation above, you accessed the object's properties and methods using dot notation.
...next you write a dot, then the item you want to access — this can be the name of a simple property, an item of an array property, or a call to one of the object's methods, for example: person.age person.interests[1] person.bio() sub-namespaces it is even possible to make the value of an object member another object.
...And 12 more matches
Server-side web frameworks - Learn web development
this section discusses some of the functionality that is often provided by web frameworks (not every framework will necessarily provide all of these features!).
...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 to the filter() function as an argument with field name and match type separated by double underscores: team_level__exact).
... note: many other templating systems use a similar syntax, e.g.: jinja2 (python), handlebars (javascript), moustache (javascript), etc.
...And 12 more matches
React interactivity: Events and state - Learn web development
</button> note: this may seem counter-intuitive regarding best-practice advice that tends to advise against use of inline event handlers on html, but remember that jsx is actually part of your javascript.
...there are a couple of other things to note: the camel-cased nature of onclick is important — jsx will not recognize onclick (again, it is already used in javascript for a specific purpose, which is related but different — standard onclick handler properties).
... note: we decided to name our callback prop addtask to make it easy to understand what the prop will do.
...And 12 more matches
Getting started with Vue - Learn web development
while the vue core team maintains suggested libraries for these functions, they are not directly bundled into vue.
...it is recommended that you specify a version number when including vue on your site so that any framework updates do not break your live site without you knowing.) <script src="/static/external/29/29296ccacaa9ed35ed168fc51e36f54fd6f8db9c7786bbf38cc59a27229ba5c2.svg"></script> however, this approach has some limitations.
... note: if you don't have the above installed, find out more about installing npm and node.js here.
...And 12 more matches
Focus management with Vue refs - Learn web development
the last bit of functionality to look at is focus management, or put another way, how we can improve our app's keyboard accessibility.
...however, it also means you often should not edit your html elements directly through native browser apis (like document.getelementbyid) when using frameworks, because it results in the vdom and real dom going out of sync.
...it's important to note that a ref needs to be unique within a component.
...And 12 more matches
Implementing feature detection - Learn web development
therefore, you can detect whether the browser supports geolocation or not by using something like the following: if ("geolocation" in navigator) { navigator.geolocation.getcurrentposition(function(position) { // show the location on a map, perhaps using the google maps api }); } else { // give the user a choice of static maps instead perhaps } it is probably better to use an established feature detection library however, rather than writing your own all the...
...for browsers that don't, we could use a floated layout that works ok, although it is slightly more brittle and hacky, and not as cool-looking.
...note how the javascript representations of those properties that are stored inside the htmlelement.style object use lower camel case, not hyphens, to separate the words.
...And 12 more matches
How Mozilla's build system works
note: this document is not intended for developers who just want to build mozilla.
... creating new variables whose name is not uppercase (this includes defining functions).
... moz.build files cannot do the following: import modules.
...And 12 more matches
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
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.
...should not reflect the frame hierarchy.
...And 12 more matches
Application Translation with Mercurial
gaia-* denotes branches of firefox os, the operating system for mobile devices.
... firefox and fx-* denote branches of firefox for desktop, the browser for desktops and notebooks running, windows, mac os or linux.
... fennec and fennec-* denote branches of firefox for mobile, the firefox browser for the android operating system.
...And 12 more matches
DMD
note that stack information you get will likely be less detailed, due to being unable to symbolicate.
... you will be able to get function names, but not line numbers.
...note that on mac this step can take 30+ seconds.
...And 12 more matches
NSS Tools certutil
availability see the release notes for the platforms this tool is available on.
...if this argument is not used certificate database tool prompts for a filename.
...the key database should already exist; if one is not present, this option will initialize one by default.
...And 12 more matches
How to build an XPCOM component in JavaScript
this tutorial does not describe how and why xpcom works the way it does, or what every bit of the example code does.
... there are many interfaces already defined in mozilla applications, so you may not need to define a new one.
... 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.
...And 12 more matches
Using XPCOM Components
though not every api in mozilla is or should be "xpcomified", much if not all of the typical functionality that browsers provide is available in components that can be reused via browser extensions and/or gecko embedders.
... in addition to the cookiemanager component, for example, the webbrowserfind component is another part of a large set of web browsing interfaces you can use.
... entireword boolean attribute that specifies whether the entire word should be matched or not.
...And 12 more matches
IAccessible2
other-licenses/ia2/accessible2.idlnot scriptable please add a summary to this article.
...[propget] hresult attributes( [out] bstr attributes ); parameters attributes return value s_false returned if there is nothing to return, [out] value is null.
...it is not predefined by the iaccessible2 specification.
...And 12 more matches
nsIBrowserHistory
rkpageasfollowedlink(in nsiuri auri); obsolete since gecko 22.0 void markpageastyped(in nsiuri auri); obsolete since gecko 22.0 void registeropenpage(in nsiuri auri); obsolete since gecko 9.0 void removeallpages(); void removepage(in nsiuri auri); void removepages([array, size_is(alength)] in nsiuri auris, in unsigned long alength, in boolean adobatchnotify); void removepagesbytimeframe(in long long abegintime, in long long aendtime); void removepagesfromhost(in autf8string ahost, in boolean aentiredomain); void removevisitsbytimeframe(in long long abegintime, in long long aendtime); void unregisteropenpage(in nsiuri auri); obsolete since gecko 9.0 note: the markpageasfollowedlink and markpageastyped...
...for performance reasons this does not return the real number of entries.
... note: the count attribute was removed in gecko 15.0 because it was only used to determine if there were any entries at all anyway, so the nsinavhistoryservice.hashistoryentries attribute is better for this.
...And 12 more matches
nsIContentPrefService
useful for accessing and manipulating preferences in ways that are caller-specific or for which there is not yet a generic method, although generic functionality useful to multiple callers should generally be added to this unfrozen interface.
...you may specify null to add a generic observer that is notified of all preference changes.
... aobserver the name of an object implementing nsicontentprefobserver that will receive notifications of changes to the preference's value.
...And 12 more matches
nsIHTMLEditor
returninparagraphcreatesnewparagraph boolean a boolean indicating if a return key pressed in a paragraph creates another paragraph or just inserts a <br> at the caret.
...example: aproperty="font", aattribute="color" avalue if aattribute is not null, the value of the attribute.
...if aanonclass is not the empty string, it becomes the value of the attribute "_moz_anonclass" nsidomelement createanonymouselement( in astring atag, in nsidomnode aparentnode, in astring aanonclass, in boolean aiscreatedhidden ); parameters atag a string representing the desired type of the element to create.
...And 12 more matches
nsIIOService
note: nsiioservice may only be used from the main thread.
...when in offline mode, attempts to access the network will fail (although this does not necessarily correlate with whether there is actually a network available -- that's hard to detect without causing the dialer to come up).
... observers will be notified of changes to this attribute.
...And 12 more matches
nsILocalFile
followlinks prbool determines whether or not the nsilocalfile will automatically resolve symbolic links.
...this string is not intended for display to users.
... note: the value of the followlinks attribute is not encoded in the persistent descriptor.
...And 12 more matches
MailNews fakeserver
a handler will contain the following methods: <caption> handler methods </caption> name arguments returns notes [command] rest of sent line server's response the name is normalized to be uppercase.
... onerror command, rest of sent line server's response called if handler does not define the command function.
... onmultiline sent line server's response or nothing called when in multi-line mode.
...And 12 more matches
Working with data
note: if type.size is undefined, creating a new object this way will throw a typeerror exception.
...this will also work: `ctypes.int.array()(jsarr)` mycarr.addressofelement(0).contents; // outputs: 4 mycarr.addressofelement(1).contents; // outputs: 10 type casting you can type cast data from one type to another by using the ctypes.cast() function: var newobj = ctypes.cast(origobj, newtype); this will return a new object whose data block is shared with the original object, but whose type is newtype.
... example: cast an array this example shows how to cast an array of a certain type to another type.
...And 12 more matches
Introduction to DOM Inspector - Firefox Developer Tools
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 window that looks a little like the main mozilla browser.
... inspecting a document when the dom inspector opens, it may or may not load an associated document, depending on the host application.
...And 12 more matches
Debugger.Script - Firefox Developer Tools
each of the following is represented by a single jsscript object: the body of a function—that is, all the code in the function that is not contained within some nested function.
... note that spidermonkey may use the same debugger.script instances for equivalent functions or evaluated code—that is, scripts representing the same source code, at the same position in the same source file, evaluated in the same lexical environment.
... please note at the time of this writing, support for webassembly is very preliminary.
...And 12 more matches
BasicCardResponse - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbasiccardresponsechrome 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) and the dom.payments.request.supportedregions preference (needs to be set to a comma-delineated list of one or more 2-character iso country codes indicati...
... webview android no support nochrome android full support 57firefox android 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 the dom.payments.request.supportedregions preference (needs to be set to a comma-delineated list of one or more 2-character iso country codes indicati...
... samsung internet android full support 7.0billingaddresschrome 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).
...And 12 more matches
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
most whitespace characters are ignored, not all of them are.
... let’s take another really simple example.
... another text node (consisting only of tabs and spaces).
...And 12 more matches
Key Values - Web APIs
[3] firefox did not add support for the symbol key until firefox 37.
... note: this shouldn't be confused with the "mediapause" key value, which is used for media controllers, rather than to control applications and processes.
... note: this shouldn't be confused with the "mediaplay" key value, which is used for media controllers, rather than to control applications and processes.
...And 12 more matches
WebRTC connectivity - Web APIs
this article describes how the various webrtc-related protocols interact with one another in order to create a connection and transfer data and/or media among peers.
... note: this page needs heavy rewriting for structural integrity and content completeness.
... when a user starts a webrtc call to another user, a special description is created called an offer.
...And 12 more matches
Window - Web APIs
WebAPIWindow
the window interface is home to a variety of functions, namespaces, objects, and constructors which are not necessarily directly associated with the concept of a user interface window.
... note that properties which are objects (e.g.,.
... window.closed read only this property indicates whether the current window is closed or not.
...And 12 more matches
Using CSS animations - CSS: Cascading Style Sheets
css animations make it possible to animate transitions from one css style configuration to another.
...this does not configure the actual appearance of the animation, which is done using the @keyframes at-rule as described in defining the animation sequence using keyframes below.
... animation-direction configures whether or not the animation should alternate direction on each run through the sequence or reset to the start point and repeat itself.
...And 12 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
color.sethsv(h, s, v); color.a = a; return color; } function hslcolor(h, s, l) { var color = new color(); color.sethsl(h, s, l); return color; } function hslacolor(h, s, l, a) { var color = new color(); color.sethsl(h, s, l); color.a = a; return color; } color.prototype.copy = function copy(obj) { if(obj instanceof color !== true) { console.log('typeof parameter not color'); return; } this.r = obj.r; this.g = obj.g; this.b = obj.b; this.a = obj.a; this.hue = obj.hue; this.saturation = obj.saturation; this.value = obj.value; this.format = '' + obj.format; this.lightness = obj.lightness; }; color.prototype.setformat = function setformat(format) { if (format === 'hsv') this.format = 'hsv'; if (format === 'hsl') this.format =...
...- (y * 100 / size) | 0; var saturation = x * 100 / size | 0; if (this.picker_mode === 'hsv') this.color.sethsv(this.color.hue, saturation, value); if (this.picker_mode === 'hsl') this.color.sethsl(this.color.hue, saturation, value); this.color_picker.style.left = x + 'px'; this.color_picker.style.top = y + 'px'; this.updatealphagradient(); this.updatepreviewcolor(); this.notify('value', value); this.notify('lightness', value); this.notify('saturation', saturation); this.notify('red', this.color.r); this.notify('green', this.color.g); this.notify('blue', this.color.b); this.notify('hexa', this.color.gethexa()); notify(this.topic, this.color); }; colorpicker.prototype.updatehueslider = function updatehueslider(e) { var x = e.pagex - this.hue_area.o...
...this.hue_picker, x - 1); this.sethue(hue); }; colorpicker.prototype.updatealphaslider = function updatealphaslider(e) { var x = e.pagex - this.alpha_mask.offsetleft; var width = this.alpha_mask.clientwidth; if (x < 0) x = 0; if (x > width) x = width; this.color.a = (x / width).tofixed(2); this.updatesliderposition(this.alpha_picker, x - 1); this.updatepreviewcolor(); this.notify('alpha', this.color.a); notify(this.topic, this.color); }; colorpicker.prototype.sethue = function sethue(value) { this.color.sethue(value); this.updatepickerbackground(); this.updatealphagradient(); this.updatepreviewcolor(); this.notify('red', this.color.r); this.notify('green', this.color.g); this.notify('blue', this.color.b); this.notify('hexa', this.color.gethexa())...
...And 12 more matches
Visual formatting model - CSS: Cascading Style Sheets
if the viewport is smaller than the size of the document then the user agent needs to offer a way to scroll to the parts of the document that are not displayed.
... note: boxes are often referred to by their display type — e.g.
...note however that block boxes, block-level boxes and box containers are all subtly different; see the block boxes section below for more details.
...And 12 more matches
Constraint validation - Developer guides
note: html5 constraint validation doesn't remove the need for validation on the server side.
...if any of these do not satisfy the condition described here, the type mismatch constraint violation 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.
...And 12 more matches
HTML5 Parser - Developer guides
WebGuideHTMLHTML5HTML5 Parser
in html5, document.write() can only be called from a script that is created by a <script> tag that does not have the async or defer attributes set.
... some contexts from which you should not call document.write() include: scripts created using document.createelement() event handlers settimeout() setinterval() <script async src="..."> <script defer src="..."> if you use the same mechanism for loading script libraries for all browsers including ie, then your code probably will not be affected by this change.
...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 '>'.
...And 12 more matches
<input type="file"> - HTML: Hypertext Markup Language
WebHTMLElementinputfile
note: if multiple files are selected, the string represents the first selected file.
... note: capture was previously a boolean attribute which, if present, requested that the device's media capture device(s) such as camera or microphone be used instead of requesting a file input.
... attribute description webkitdirectory a boolean indicating whether or not to only allow the user to choose a directory (or directories, if multiple is also present) webkitdirectory the boolean webkitdirectory attribute, if present, indicates that only directories should be available to be selected by the user in the file picker interface.
...And 12 more matches
<input type="month"> - HTML: Hypertext Markup Language
WebHTMLElementinputmonth
you can set a default value for the input control by including a month and year inside the value attribute, like so: <label for="bday-month">what month were you born in?</label> <input id="bday-month" type="month" name="bday-month" value="2017-06"> one thing to note is that the displayed date format differs from the actual value; most user agents display the month and year in a locale-appropriate form, based on the set locale of the user's operating system, whereas the date value is always formatted yyyy-mm.
...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.
...And 12 more matches
<input type="range"> - HTML: Hypertext Markup Language
WebHTMLElementinputrange
<input> elements of type range let the user specify a numeric value which must be no less than a given value, and no more than another given value.
... the precise value, however, is not considered important.
...any values in the list that are not compatible with the type are not included in the suggested options.
...And 12 more matches
Standard metadata names - HTML: Hypertext Markup Language
WebHTMLElementmetaname
note: browsers may use this to identify the application.
... referrer: controls the http referer header for to requests sent from the document: values for the content attribute of <meta name="referrer"> no-referrer do not send a http referer header.
... notes: dynamically inserting <meta name="referrer"> (with document.write() or appendchild()) makes the referrer behaviour unpredictable.
...And 12 more matches
<script>: The Script element - HTML: Hypertext Markup Language
WebHTMLElementscript
see browser compatibility for notes on browser support.
... crossorigin normal script elements pass minimal information to the window.onerror for scripts which do not pass the standard cors checks.
... this attribute must not be used if the src attribute is absent (i.e.
...And 12 more matches
Content negotiation - HTTP
note: some disadvantages of http content negotiation are explained in a wiki page from whatwg.
... the 300 (multiple choices) or 406 (not acceptable) http response codes by the server (agent-driven negotiation or reactive negotiation), that are used as fallback mechanisms.
...the algorithm is server-specific and not defined in the standard.
...And 12 more matches
Using HTTP cookies - HTTP
WebHTTPCookies
get /sample_page.html http/2.0 host: www.example.org cookie: yummy_cookie=choco; tasty_cookie=strawberry note: here's how to use the set-cookie header in various server-side applications: php node.js python ruby on rails define the lifetime of a cookie the lifetime of a cookie can be defined in two ways: session cookies are deleted when the current session ends.
... for example: set-cookie: id=a3fwa; expires=wed, 31 oct 2021 07:28:00 gmt; note: when an expires date is set, the time and date set is relative to the client the cookie is being set on, not the server.
... restrict access to cookies there are a couple of ways to ensure that cookies are sent securely and are not accessed by unintended parties or scripts: the secure attribute and the httponly attribute.
...And 12 more matches
Promise - JavaScript
description a promise is a proxy for a value not necessarily known when the promise is created.
... not to be confused with: several other languages have mechanisms for lazy evaluation and deferring a computation, which they also call "promises", e.g.
... note: a promise is said to be settled if it is either fulfilled or rejected, but not pending.
...And 12 more matches
isNaN() - JavaScript
the isnan() function determines whether a value is nan or not.
... note, coercion inside the isnan function has interesting rules; you may alternatively want to use number.isnan(), as defined in ecmascript 2015.
... description the necessity of an isnan function unlike all other possible values in javascript, it is not possible to rely on the equality operators (== and ===) to determine whether a value is nan or not, because both nan == nan and nan === nan evaluate to false.
...And 12 more matches
Property accessors - JavaScript
property accessors provide access to an object's properties by using the dot notation or the bracket notation.
... there are two ways to access properties: dot notation and bracket notation.
... dot notation in the object.property syntax, the property must be a valid javascript identifier.
...And 12 more matches
delete operator - JavaScript
description unlike what common belief suggests (perhaps due to other programming languages like delete in c++), the delete operator has nothing to do with directly freeing memory.
... however, it is important to consider the following scenarios: if the property which you are trying to delete does not exist, delete will not have any effect and will return true.
... any property declared with var cannot be deleted from the global scope or from a function's scope.
...And 12 more matches
Mobile first - Progressive web apps (PWAs)
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!
...therefore, as well as splitting content into different views, and simplifying the interface and content on each view of your application for mobile as much as possible, it is also a good idea to not include visual effects such as shadows, animations, and gradients.
... control mechanisms control mechanisms are another large constraint on mobile devices.
...And 12 more matches
Same-origin policy - Web security
the same-origin policy is a critical security mechanism that restricts how a document or script loaded from one origin can interact with a resource from another origin.
...tuple" is a set of items that together comprise a whole — a generic form for double/triple/quadruple/quintuple/etc.) the following table gives examples of origin comparisons with the url http://store.company.com/dir/page.html: url outcome reason http://store.company.com/dir2/other.html same origin only the path differs http://store.company.com/dir/inner/another.html same origin only the path differs https://store.company.com/page.html failure different protocol http://store.company.com:81/dir/page.html failure different port (http:// is port 80 by default) http://news.company.com/dir/page.html failure different host inherited origins scripts executed from pages with an about:blank or javascri...
...pt: url inherit the origin of the document containing that url, since these types of urls do not contain information about an origin server.
...And 12 more matches
Content Scripts - Archive of obsolete content
in many ways these are like content scripts, but they're not the focus of this article.
...at this point, content scripts are able to interact with the dom content, but externally-referenced stylesheets and images may not have finished loading.
... note that tab.attach() doesn't accept contentscriptwhen, because it's generally called after the page has loaded.
...And 11 more matches
/loader - Archive of obsolete content
it can be loaded as a regular script tag in documents that have system principals (note: this does not appear to work as of 02.2016 due to "use strict" being added to the file): <script type='application/javascript' src='resource://gre/modules/commonjs/toolkit/loader.js'></script> this will expose a single loader object containing all of the api functions described in this document.
... for example, the sdk uses this feature to provide a global console object: let { loader } = require('toolkit/loader'); let loader = loader({ globals: { console: { log: dump.bind(dump, 'log: '), info: dump.bind(dump, 'info: '), warn: dump.bind(dump, 'warn: '), error: dump.bind(dump, 'error: ') } } }); be careful not to misuse this feature!
... in general it is not recommended to provide features via globals, it's almost always better to use pseudo-modules or, even better, modules.
...And 11 more matches
File I/O - Archive of obsolete content
only use these legacy interfaces if os.file is not available to you.
... note: file objects are nsifile.
... createinstance(components.interfaces.nsilocalfile); file.initwithpath("/home"); note: the path should be in the "native" form (for example"c:\\windows").
...And 11 more matches
Progress Listeners - Archive of obsolete content
progress listeners progress listeners allow extensions to be notified of events associated with documents loading in the browser and with tab switching events.
... note that if you just want to execute your code each time a page loads, you can use an an easier method, onpageload().
... note that onpageload does not fire for back button clicks.
...And 11 more matches
Adding windows and dialogs - Archive of obsolete content
this can only be used from the chrome, not from regular html javascript.
... it indicates that a chrome document is being opened, not a web page.
... this means that the document defines the whole window, and not only the inner content area.
...And 11 more matches
Handling Preferences - Archive of obsolete content
to open the preferences window in firefox, select the following from the main menu: on windows, tools > options on mac, firefox > preferences on linux, edit > preferences note: keep in mind the usage of the terms "preferences" and "options" in different platforms.
...each source is a js file that contains some special functions not available in regular code.
...in addition, certain preferences may be locked such that users cannot change them.
...And 11 more matches
Setting Up a Development Environment - Archive of obsolete content
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.
... the only notable additions is a file named makefile under src.
...that is because make can tell that the file in the bin directory is up to date, and nothing needs to be done.
...And 11 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
note this article is the version from 2003 with slight modifications (no images and no links to samples).
...if the data changes, it will not update unless you reload the web page.
...forms with nested selects in today's web pages it is common to see selects where content is dependent on the selection made on another select.
...And 11 more matches
Images, Tables, and Mysterious Gaps - Archive of obsolete content
however, these techniques may be relevant when the developer cannot assume that users have a modern browser, such as for html-based e-mail messages.
...there's nothing apparently wrong with that example.
... notice the added space beneath the image in figure 2.
...And 11 more matches
Templates - Archive of obsolete content
you'll notice that the buttons in the example get updated instantly.
...you may notice in the example above that the button has a uri attribute and an unusual value for the label attribute.
...if a particular one is not found, the value of the attribute will be set to an empty string.
...And 11 more matches
Using Spacers - Archive of obsolete content
if adding support for multiple languages, the text for one language may require more room than another.
...before we get into detail about boxes, we'll introduce another xul element that is useful for layout, the spacer.
...you'll notice that the cancel button in the dialogs has always set its width so that it fits the text inside it.
...And 11 more matches
Using the Editor from XUL - Archive of obsolete content
note that the <editor> element is really just an <iframe> which takes over some of the task of creating the editor from javascript.
... the contentwindow (another settable attribute on nsieditorshell) points to the xul element which is to become editable.
... note: since we already know this when we have an <editor></editor> tag, we should remove the need to call this.
...And 11 more matches
Sunbird Theme Tutorial - Archive of obsolete content
it does not cover advanced topics.
...but a theme cannot provide an extra button.
... to make a theme, you usually need these tools: a jar tool or zip tool an editor for plain text files software for creating and editing images note: some zip tools only work with files whose names have <tt>.zip</tt> at the end.
...And 11 more matches
Troubleshooting XForms Forms - Archive of obsolete content
it is not perfect, but it can spot a lot of errors.
...if you get errors there, do not expect your form to work.
... if the instance is not in the empty namespace (xmlns=""), then all binding expressions must use a prefix bound to the namespace.
...And 11 more matches
What is accessibility? - Learn web development
just as it is wrong to exclude someone from a physical building because they are in a wheelchair (modern public buildings generally have wheelchair ramps or elevators), it is also not right to exclude someone from a website because they have a visual impairment.
...providing accessible sites is part of the law in some countries, which can open up some significant markets that otherwise would not be able to use your services or buy your products.
...the key lesson here is to think beyond your own computer and how you use the web, and start learning about how others use it — you are not your users.
...And 11 more matches
CSS FAQ - Learn web development
LearnCSSHowtoCSS FAQ
note: see selectors for more information.
... /* heading default color is black */ h1 { color: red; } h1 { color: initial; } how do i derive one style from another?
... css does not exactly allow one style to be defined in terms of another.
...And 11 more matches
HTML forms in legacy browsers - Learn web development
and html5 <input> types don't fail when not supported: they fall back to type=text.
...there are so many cases where we want forms that are "nicer" or "with advanced functionality", but building efficient html forms is not a question of design or technology.
...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.
...And 11 more matches
How to structure a web form - Learn web development
warning: it's strictly forbidden to nest a form inside another form.
...if you do so, by default that control has nothing to do with any form unless you associate it with a form using the form attribute.
... this was introduced to let you explicitly bind a control with a form even if it is not nested inside it.
...And 11 more matches
Sending form data - Learn web development
an html form on a web page is nothing more than a convenient user-friendly way to configure an http request to send data to a server.
... note: to get a better idea of how client-server architectures work, read our server-side website programming first steps module.
... in this example, the data is sent to an absolute url — https://example.com: <form action="https://example.com"> here, we use a relative url — the data is sent to a different url on the same origin: <form action="/somewhere_else"> when specified with no attributes, as below, the <form> data is sent to the same page that the form is present on: <form> note: it's possible to specify a url that uses the https (secure http) protocol.
...And 11 more matches
Styling web forms - Learn web development
not all widgets are created equal when css is involved at present, some difficulties remain when using css with forms.
... note: there are some proprietary css pseudo-elements available that allow you to style internal components of these form controls, such as ::-moz-range-track, but these are not consistent across browsers, so can't be relied upon.
...by default, some widgets do not inherit font-family and font-size from their parents.
...And 11 more matches
Responsive images - Learn web development
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?
...you should note that we will be focusing on the html <img>s for this section, as seen in the content area of the example above — the image in the site header is only for decoration, and therefore implemented using css background images.
...you can see an example of this in our responsive.html example on github (see also the source code): <img srcset="elva-fairy-480w.jpg 480w, elva-fairy-800w.jpg 800w" sizes="(max-width: 600px) 480px, 800px" src="elva-fairy-800w.jpg" alt="elva dressed as a fairy"> the srcset and sizes attributes look complicated, but they're not too hard to understand if you format them as shown above, with a different part of the attribute value on each line.
...And 11 more matches
HTML table advanced features and accessibility - Learn web development
rather than have a screenreader read out the contents of many cells just to find out what the table is about, he or she can rely on a caption and then decide whether or not to read the table in greater detail.
... note: the summary attribute can also be used on the <table> element to provide a description — this is also read out by screenreaders.
... note: you can find our version on github — see timetable-caption.html (see it live also).
...And 11 more matches
HTML table basics - Learn web development
LearnHTMLTablesBasics
name mass (1024kg) diameter (km) density (kg/m3) gravity (m/s2) length of day (hours) distance from sun (106km) mean temperature (°c) number of moons notes terrestial planets mercury 0.330 4,879 5427 3.7 4222.6 57.9 167 0 closest to the sun venus 4.87 12,104 5243 8.9 2802.0 108.2 464 0 earth 5.97 12,756 5514 9.8 24.0 149.6 15 1 our world mars 0.642 6,792 3933 3.7 24.7 227.9 -65 2 the red planet ...
...one thing you'll notice is that the table does look a bit more readable there — this is because the table you see above on this page has minimal styling, whereas the github version has more significant css applied.
... when should you not use html tables?
...And 11 more matches
Build your own function - Learn web development
note: this example should work in all modern browsers fine, but the styling might look a bit funny in slightly older browsers.
... note: for function naming conventions, you should follow the same rules as variable naming conventions.
... the first line uses a dom api function called document.queryselector() to select the <html> element and store a reference to it in a constant called html, so we can do things to it later on: const html = document.queryselector('html'); the next section uses another dom api function called document.createelement() to create a <div> element and store a reference to it in a constant called panel.
...And 11 more matches
Third-party APIs - Learn web development
previous overview: client-side web apis next the apis we've covered so far are built into the browser, but not all apis are.
... note: you might want to just get all our code examples at once, in which case you can then just search the repo for the example files you need in each section.
... note: some apis handle access to their functionality slightly differently, requiring the developer to make an http request to a specific url pattern to retrieve data.
...And 11 more matches
Getting started with Svelte - Learn web development
the outcome of this approach is not only smaller application bundles and better performance, but also a developer experience that is more approachable for people that have limited experience of the modern tooling ecosystem.
... note: recently svelte has added official typescript support, one of its most requested features.
...extensions to the javascript language are minimal and carefully picked in order to not break javascript syntax nor alienate developers.
...And 11 more matches
Introduction to cross browser testing - Learn web development
as a web 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.
... remember that you are not your users — just because your site works on your macbook pro or high-end galaxy nexus, doesn't mean it will work for all your users — there's a whole lot of testing to be done!
... note: make the web work for everyone provides more useful perspective on the different browsers people use, their market share, and related cross browser compatibility issues.
...And 11 more matches
Multiprocess on Windows
gecko and apartments most code that runs on gecko's main thread is not thread safe.
...on the other hand, com's multithreaded apartment (mta) uses a much faster ipc mechanism that does not suffer from the same problems as the message queue.
... interceptors cannot replicate interfaces without access to the metadata that describes those interfaces.
...And 11 more matches
An overview of NSS Internals
(note that it's important to look at the number 11, as there are other pkcs standards with different numbers that define quite different topics.) a software or hardware module conforming to the pkcs#11 standard implements an interface of c calls, which allow querying the characteristics and offered services of the module.
... many (if not most) of the operations performed by nss involve the use of x.509 certificates (often abbreviated as “cert”, unfortunately making it easy to confuse with the term “computer emergency response team“).
... when checking whether a certificate is trusted or not, it's necessary to find a relevant trust anchor (root certificate) that represents the signing capability of a trusted third party, usually called a certificate authority (ca).
...And 11 more matches
Invariants
but note that a stack frame is not necessarily newer than the next stack frame down, thanks to generators!) an object's scope chain (found by chasing jsobject::fslots[jsslot_parent]) never forms a cycle.
...js_setparent can violate this, if the application is really that dumb, but generally every object is newer than its __parent__.) the tracejit must not trace into a function whose scope chain ends in a different global object.
...even if the function is native, there is serious trouble: js_newobject with null parent argument calculates the parent from cx->fp->scopechain, which can be stale if we're on trace.) the chain of properties starting at any jsshape and chasing jsshape::parent never forms a cycle and does not contain any duplicate jsscopeproperty::slot values other than -1.
...And 11 more matches
Mork
MozillaTechMork
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.
...rows need not be in a table, nor need they be in only one table.
... hex = [0-9a-fa-f]+ name = [a-za-z_?:] [a-za-z_?:+-]* value is a string terminated by ')' (not consumed) where '\' quotes the next metacharacter and '$' quotes the next two hexadecimal digits as a value (e.g., $20 is a space) the first line in the file is the header.
...And 11 more matches
Querying Places
not yet implemented -- see bug 320831.
...tribute prtime absoluteendtime attribute astring searchterms readonly attribute boolean hassearchterms attribute long minvisits attribute long maxvisits attribute boolean onlybookmarked attribute boolean domainishost attribute autf8string domain readonly attribute boolean hasdomain attribute boolean uriisprefix attribute nsiuri uri readonly attribute boolean hasuri attribute boolean annotationisnot attribute autf8string annotation readonly attribute boolean hasannotation readonly attribute unsigned long foldercount basic query configuration options const unsigned short group_by_day = 0 const unsigned short group_by_host = 1 const unsigned short group_by_domain = 2 const unsigned short group_by_folder = 3 const unsigned short sort_by_none = 0 const unsigned short sort_...
...sort_by_visitcount_descending = 8 const unsigned short sort_by_keyword_ascending = 9 const unsigned short sort_by_keyword_descending = 10 const unsigned short sort_by_dateadded_ascending = 11 const unsigned short sort_by_dateadded_descending = 12 const unsigned short sort_by_lastmodified_ascending = 13 const unsigned short sort_by_lastmodified_descending = 14 const unsigned short sort_by_annotation_ascending = 15 const unsigned short sort_by_annotation_descending = 16 const unsigned short results_as_uri = 0 const unsigned short results_as_visit = 1 const unsigned short results_as_full_visit = 2 (not yet implemented -- see bug 320831) attribute unsigned short sortingmode attribute autf8string sortingannotation attribute unsigned short resulttype attribute boolean excludeitems a...
...And 11 more matches
Using the Places history service
nsiautocompletesearch: url-bar autocomplete from history from 1.9.1 (firefox3.1) on, don't use any places service on (or after) quit-application has been notified, since the database connection will be closed to allow the last sync, and changes will most likely be lost.
... if database initialization completes correctly a "places-init-complete" topic is notified, at this point is possible to look for database status: var databasestatus = historyservice.databasestatus; switch (databasestatus) { case historyservice.database_status_ok: // database did already exist and has been correctly initialized.
... break; case historyservice.database_status_create: // database did not exist, a new one has just been created and initialized.
...And 11 more matches
nsDependentCString
this class does not own its data, so the creator of objects of this type must take care to ensure that a nstdependentstring continues to reference valid memory for the duration of its use.
...must not be null.
...must not be null.
...And 11 more matches
imgIRequest
note that this might not be the actual uri for the image (for example if http redirects happened during the load).
... constants constant value description status_none 0x0 nothing to report.
... status_load_partial 0x2 used internally by imgrequest to flag that a request is being cancelled as a result of a failure of a proxy holder and not an internal failure.
...And 11 more matches
nsIDOMEvent
inherits from: nsisupports last changed in gecko 16.0 (firefox 16.0 / thunderbird 16.0 / seamonkey 2.13) note: as of gecko 16.0, the nsiprivatedomevent interface was merged into this interface.
... void stopimmediatepropagation(); void stoppropagation(); attributes attribute type description bubbles boolean used to indicate whether or not an event is a bubbling event.
... cancelable boolean used to indicate whether or not an event can have its default action prevented.
...And 11 more matches
nsIMemory
return value if the memory cannot be allocated (because of an out-of-memory condition), null is returned.
...this may be null, in which case nothing happens.
...a particular nsimemory instance may choose not to implement this method.
...And 11 more matches
Address Book examples
note: thunderbird and seamonkey user interfaces now reference 'contacts' not 'cards' however, as the backend still uses the 'cards' terminology, that is what is used here this article provides examples on accessing and manipulating thunderbird address books.
... let card = collection.cardforemailaddress("foo@bar.invalid.com"); note: both of these functions may raise an ns_error_not_implemented exception if the collection has not implemented that function.
... formulate a boolean search string (see nsiabcard for built-in property names): var searchquery = "(or(primaryemail,bw,@v)(nickname,bw,@v)(and(ismaillist,=,true)(notes,bw,@v)))"; searchquery = searchquery.replace(/@v/g, encodeuricomponent("mystr") the search queries use lisp syntax with operators enumerated in nsabquerystringtoexpression.cpp.
...And 11 more matches
Mail composition back end
several (but not all) of these interfaces are specified in idl.
...also, i will talk about some features though they may not be complete as of yet.
...(note: this method could easily be broken in to a few different calls.
...And 11 more matches
Streams - Plugins
the seekable parameter specifies whether the stream is seekable (true) or not (false).
...if the stream is not seekable, these requests are fulfilled only when all the data has been read and stored in the cache.
... note: a plug-in can also use the npn_geturl method to request a stream for an arbitrary url.
...And 11 more matches
Console messages - Firefox Developer Tools
this is not shown by default: you can opt to see timestamps by selecting show timestamps in the console settings menu (gear icon in the console toolbar).
... icon not all console messages contain icons.
... message categories network network log messages are not shown by default.
...And 11 more matches
Guide to the Fullscreen API - Web APIs
presentation differences it's worth noting a key difference here between the gecko and webkit implementations at this time: gecko automatically adds css rules to the element to stretch it to fill the screen: "width: 100%; height: 100%".
...to get the same fullscreen behavior in webkit, you need to add your own "width: 100%; height: 100%;" css rules to the element yourself: #myvideo:-webkit-full-screen { width: 100%; height: 100%; } on the other hand, if you're trying to emulate webkit's behavior on gecko, you need to place the element you want to present inside another element, which you'll make fullscreen instead, and use css rules to adjust the inner element to match the appearance you want.
... notification when fullscreen mode is successfully engaged, the document which contains the element receives a fullscreenchange event.
...And 11 more matches
IDBTransaction - Web APIs
note: this feature is available in web workers.
...51" y="1" width="140" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="221" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">idbtransaction</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} transactions are started when the transaction is created, not when the first request is placed; for example consider this: var trans1 = db.transaction("foo", "readwrite"); var trans2 = db.transaction("foo", "readwrite"); var objectstore2 = trans2.objectstore("foo") var objectstore1 = trans1.objectstore("foo") objectstore2.put("2", "key"); objectstore1.put("1", "key"); after the code is executed the object store should contain the value "2", since trans2 ...
... firefox durability guarantees note that as of firefox 40, indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702.) previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk.
...And 11 more matches
Browser storage limits and eviction criteria - Web APIs
there are a number of web technologies that store data of one kind or another on the client-side (i.e., on your local disk).
... the process by which the browser works out how much space to allocate to web data storage and what to delete when that limit is reached is not simple, and differs between browsers.
... note: the information below should be fairly accurate for most modern browsers, but browser specifics are called out where known.
...And 11 more matches
KeyboardEvent - Web APIs
note: keyboardevent events just indicate what interaction the user had with a key on the keyboard at a low level, providing no contextual meaning to that interaction.
...keyboard events may not be fired if the user is using an alternate means of entering text, such as a handwriting system on a tablet or graphics tablet.
... keyboard location identifiers constant value description dom_key_location_standard 0x00 the key described by the event is not identified as being located in a particular area of the keyboard; it is not located on the numeric keypad (unless it's the numlock key), and for keys that are duplicated on the left and right sides of the keyboard, the key is, for whatever reason, not to be associated with that location.
...And 11 more matches
Using the Payment Request API - Web APIs
note: the code snippets from this section are from our feature detect support demo.
...it returns a promise that fulfills with a boolean indicating whether it is or not, for example: // dummy payment request to check whether payment can be made new paymentrequest(buildsupportedpaymentmethoddata(), {total: {label: 'stub', amount: {currency: 'usd', value: '0.01'}}}) .canmakepayment() .then(function(result) { if(result) { // real payment request var request = new paymentrequest(buildsupportedpaymentmethoddata(), ...
... request = new paymentrequest(buildsupportedpaymentmethodnames(), buildshoppingcartdetails()); }); } note: see our feature detect support demo for the full code.
...And 11 more matches
SVGPathSegList - Web APIs
exceptions: a domexception with code no_modification_allowed_err is raised when the list cannot be modified.
...the inserted item is the item itself and not a copy.
... exceptions: a domexception with code no_modification_allowed_err is raised when the list cannot be modified.
...And 11 more matches
Using the Screen Capture API - Web APIs
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.
... a logical display surface is one which is in part or completely obscured, either by being overlapped by another object to some extent, or by being entirely hidden or offscreen.
...this is done for security reasons, as the content that cannot be seen by the user may contain data which they do not want to share.
...And 11 more matches
Using readable streams - Web APIs
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.
...And 11 more matches
TreeWalker - Web APIs
since attributes are never children of other nodes, they do not appear when traversing over the document tree.
...since entities are not part of the document tree, they do not appear when traversing over the document tree.
... nodefilter.show_notation 2048 shows notation nodes.
...And 11 more matches
Fundamentals of WebXR - Web APIs
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 does not actually know how to load and manage models, render and texture them, and so forth.
...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.
...And 11 more matches
Alerts - Accessibility
examples of common problems include e-mail addresses which are not valid, or a name field which does not contain at least a first name or a surname.
... the form first, please read about the aria-required technique if you have not done so, as this technique expands upon that.
...put name="website" id="website"/> </fieldset> <label for="message">please enter your message (required):</label> <br /> <textarea name="message" id="message" rows="5" cols="80" aria-required="true"></textarea> <br /> <input type="submit" name="submit" value="send message"/> <input type="reset" name="reset" value="reset form"/> </form> checking for validity and notifying the user form validations consists of several steps: checking if the e-mail address or entered name are valid.
...And 11 more matches
Keyboard-navigable JavaScript widgets - Accessibility
these widgets are typically composed of <div> and <span> elements that do not, by nature, offer the same keyboard functionality that their desktop counterparts do.
...when set to -1, the element becomes focusable by script, but it does not become part of the keyboard focus order.
... the following table describes tabindex behavior in modern browsers: tabindex attribute focusable with mouse or javascript via element.focus() tab navigable not present follows the platform convention of the element (yes for form controls, links, etc.).
...And 11 more matches
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
this early specification did not contain all of the properties and values that the up-to-date specification has.
...��15) version of the specification is prefixed with an -ms prefix and the properties implemented in ie/edge (≤15) are as follows: grid-template-columns as -ms-grid-columns grid-template-rows as -ms-grid-rows grid-row-start as -ms-grid-row grid-column-start as -ms-grid-column align-self as -ms-grid-row-align justify-self as -ms-grid-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.
...And 11 more matches
image() - CSS: Cascading Style Sheets
the image() css function defines an <image> in a similar fashion to the <url> function, but with added functionality including specifying the image's directionality, specifying fallback images for when the preferred image is not supported, displaying just a part of that image defined by a media fragment, and specifying a solid color as a fallback in case none of the specified images are able to be rendered.
... bi-directional awareness the first, optional parameter of the image() notation is the directionality of the image.
...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.
...And 11 more matches
WAI ARIA Live Regions/API Support - Developer guides
these notes are for developers of screen readers.
...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.
...ccessibletext::get_oldtext to retrieve the offsets and removed text) text inserted text_changed::insert ia2_event_text_inserted (use iaccessibletext::get_newtext to retrieve the offsets and inserted 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.
...And 11 more matches
HTML attribute reference - HTML: Hypertext Markup Language
note: although browsers and email clients may still support this attribute, it is obsolete.
... note: this is a legacy attribute.
... note: this is a legacy attribute.
...And 11 more matches
<colgroup> - HTML: Hypertext Markup Language
WebHTMLElementcolgroup
if the attribute is not present: zero or more <col> element tag omission the start tag may be omitted, if it has a <col> element as its first child and if it is not preceded by a <colgroup> whose end tag has been omitted.
... the end tag may be omitted, if it is not followed by a space or a comment.
...if not present, its default value is 1.
...And 11 more matches
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
WebHTMLElementiframe
the html inline frame element (<iframe>) represents a nested browsing context, embedding another html page into the current one.
... referrerpolicy indicates which referrer to send when fetching the frame's resource: no-referrer: the referer header will not be sent.
... no-referrer-when-downgrade (default): the referer header will not be sent to origins without tls (https).
...And 11 more matches
<input type="radio"> - HTML: Hypertext Markup Language
WebHTMLElementinputradio
note: checkboxes are similar to radio buttons, but with an important distinction: radio buttons are designed for selecting one value out of a set, whereas checkboxes let you turn individual values on and off.
... note: if no radio button is selected when the form is submitted, the radio group is not included in the submitted form data at all, since there is no value to report.
... additional attributes in addition to the common attributes shared by all <input> elements, radio inputs support the following attributes: attribute description checked a boolean indicating whether or not this radio button is the currently-selected item in the group value the string to use as the value of the radio when submitting the form, if the radio is currently toggled on checked a boolean attribute which, if present, indicates that this radio button is the currently selected one in the group.
...And 11 more matches
<input type="week"> - HTML: Hypertext Markup Language
WebHTMLElementinputweek
you can set a default value for the input by including a value inside the value attribute, like so: <label for="week">what week would you like to start?</label> <input id="week" type="week" name="week" value="2017-w01"> one thing to note is that the displayed format may differ from the actual value, which is always formatted yyyy-www.
...rol.value = '2017-w45'; additional attributes in addition to the attributes common to <input> elements, week inputs offer the following attributes: attribute description max the latest year and week to accept as valid input min the earliest year and week to accept as valid input readonly a boolean which, if present, indicates that the user cannot edit the field's contents step the stepping interval (the distance between allowed values) to use for both user interface and constraint validation max the latest (time-wise) year and week number, in the string format discussed in the value section above, to accept.
... readonly a boolean attribute which, if present, means this field cannot be edited by the user.
...And 11 more matches
Global attributes - HTML: Hypertext Markup Language
global attributes may be specified on all html elements, even those not specified in the standard.
...for example, html5-compliant browsers hide content marked as <foo hidden>...</foo>, even though <foo> is not a valid html element.
...the attribute must take one of the following values: true or the empty string, which indicates that the element must be editable; false, which indicates that the element must not be editable.
...And 11 more matches
MIME types (IANA media types) - HTTP
important: browsers use the mime type, not the file extension, to determine how to process a url, so it's important that web servers send the correct mime type in the response's content-type header.
... if this is not correctly configured, browsers are likely to misinterpret the contents of files and sites will not work correctly, and downloaded files may be mishandled.
... mime types are case-insensitive but are traditionally written in lowercase, with the exception of parameter values, whose case may or may not have specific meaning.
...And 11 more matches
Link prefetching FAQ - HTTP
yes, link prefetching as outlined in this document does not violate any existing web standards.
...however, the exact mechanism employed by mozilla is not yet standardized.
...from this, we receive document start & stop notifications, and we approximate idle time as the period between the last document stop and the next document start.
...And 11 more matches
Redirections in HTTP - HTTP
besides the small performance hit of an additional round-trip, users rarely notice the redirection.
... others may or may not be changed to get.[1] reorganization of a web site.
... 308 permanent redirect method and body not changed.
...And 11 more matches
Closures - JavaScript
note that the displayname() function has no local variables of its own.
... run the code using this jsfiddle link and notice that the alert() statement within the displayname() function successfully displays the value of the name variable, which is declared in its parent function.
...however, because the code still works as expected, this is obviously not the case in javascript.
...And 11 more matches
Control flow and error handling - JavaScript
important: javascript before ecmascript2015 (6th edition) does not have block scope!
...in other words, block statements do not define a scope.
... for example, do not write code like this: // prone to being misread as "x == y" if (x = y) { /* statements here */ } if you need to use an assignment in a conditional expression, a common practice is to put additional parentheses around the assignment, like this: if ((x = y)) { /* statements here */ } falsy values the following values evaluate to false (also known as falsy values): false undefined nu...
...And 11 more matches
JSON.stringify() - JavaScript
if this value is null or not provided, all properties of the object are included in the resulting json string.
...if this parameter is not provided (or is null), no white space is used.
... description json.stringify() converts a value to json notation representing it: if the value has a tojson() method, it's responsible to define what data will be serialized.
...And 11 more matches
Media container formats (file types) - Web media technologies
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.
...not all of these are broadly supported by browsers, however; some combinations of container and codec are sometimes given their own file extensions and mime types as a matter of convenience, or because of their ubiquity.
...And 11 more matches
platform/xpcom - Archive of obsolete content
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 { unknown } = require('sdk/platform/xpcom'); var { cc, ci } = require('chrome') var observerservice = cc['@mozilla.org/observer-service;1'].
...however, the components.classes object commonly used to look up factories by contract id will not be updated at run time.
...ar xpcom = require('sdk/platform/xpcom'); var factory = xpcom.factory({ contract: contractid, component: helloworld, register: false, unregister: false, }); if you disable automatic registration in this way, you can use the register() function to register factories and services: xpcom.register(factory); you can use the corresponding unregister() function to unregister them, whether or not you have disabled automatic unregistration: xpcom.unregister(factory); you can find out whether a factory or service has been registered by using the isregistered() function: if (xpcom.isregistered(factory)) xpcom.unregister(factory); globals constructors factory(options) parameters options : object required options: name type component constructor ...
...And 10 more matches
Miscellaneous - Archive of obsolete content
name; // returns "firefox" for firefox services.appinfo.version; // returns "2.0.0.1" for firefox version 2.0.0.1 retrieving the version of an extension as specified in the extension's install.rdf components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("extension-guid@example.org", function(addon) { // this is an asynchronous callback function that might not be called immediately alert("my extension's version is " + addon.version); }); restarting firefox/thunderbird/seamonkey_2.0 for firefox 3 see onwizardfinish around here: http://mxr.mozilla.org/seamonkey/sou...pdates.js#1639 for firefox 2 see around here: http://mxr.mozilla.org/mozilla1.8/so...pdates.js#1631 bug 338039 tracks improving this situation by providing a simple method to restar...
...</div> <script type="text/javascript"> var elm = document.getelementbyid("scrollarea"); elm.addeventlistener("dommousescroll", function scroll(event){ //event.detail is positive for a downward scroll, negative for an upward scroll alert("scrolling " + event.detail + " lines"); }, false); </script> if you do not receive a dommousescroll event while holding any of the modifier keys (ctrl,shift,alt,meta) you should check the mousewheel.withcontrolkey.action and related preferences.
...if set, you will not receive dommousescroll events.
...And 10 more matches
Jetpack Processes - Archive of obsolete content
note: the jetpack service, provided by nsijetpackservice, is not included by default in firefox 4.
...these processes are relatively lightweight, do not have access to xpcom, and can innately do little other than compute.
...note: the above statement is not currently true, as js-ctypes is now provided to jetpack processes as of bug 588563.
...And 10 more matches
URIs and URLs - Archive of obsolete content
not all resources are network "retrievable"; e.g., human beings, corporations, and bound books in a library can also be considered resources.
... the resource is the conceptual mapping to an entity or set of entities, not necessarily the entity which corresponds to that mapping at any particular instance in time.
... thus, a resource can remain constant even when its content---the entities to which it currently corresponds---changes over time, provided that the conceptual mapping is not changed in the process.
...And 10 more matches
Return Codes - Archive of obsolete content
on windows nt, you may only need to restart the application as long as you did not replace operating system files.
... 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 no_certificate -205 extracted file is not signed or the file (and, therefore, its certificate) could not be found.
...And 10 more matches
Reading from Files - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes.
...naturally, if the file does not exist, an error will occur.
...And 10 more matches
Menus - Archive of obsolete content
submenus may be created by nesting one menu inside of another.
...however, the actual top level menus do not generally change for a given window.
...when another item is selected, the label of the item is set as the label of the menulist.
...And 10 more matches
PopupEvents - Archive of obsolete content
the preventdefault method will stop this from happening and the popup will not be opened.
...when calling either the openpopup or openpopupatscreen methods, the popup will not actually be open before that method returns.
... one possible use of the popupshown event is to open another menu.
...And 10 more matches
Anonymous Content - Archive of obsolete content
xbl content xbl can be used to automatically add a set of elements inside another element.
...although anonymous content is displayed on screen, you cannot get to it through a script in the normal way.
...notice that the content elements need the xul namespace (they appear preceded with xul:), because they are xul elements and aren't valid in xbl.
...And 10 more matches
Commands - Archive of obsolete content
if you did not use commands, you would need to figure out which field has the focus, then check to ensure that the operation is suitable for that element.
... in addition, the menu commands would need to be enabled and disabled depending on whether the focused element had selected text or not, and for paste operations, whether there is something suitable on the clipboard to paste.
...this means that code is all together and not scattered throughout the ui code.
...And 10 more matches
Popup Menus - Archive of obsolete content
also note that it is possible to open context menus without using the mouse, for example by pressing the menu key on a keyboard.
...you will also notice that the id has been set on the menupopup element itself.
...it does not draw on screen but instead is used as a placeholder where you would declare all of your popups.
...And 10 more matches
Skinning XUL Files by Hand - Archive of obsolete content
if you create a style in your custom stylesheet for a button with a particular id, for example, some of the more basic style information for buttons in the global skin may take precedence over your new style and cause it not to be applied.
... since the purpose of the global skin is to create a look for the entire application or chrome that can be changed dynamically, you should not create style information in a custom css file that controverts the global skin unless you really mean to.
...in a cascading stylesheet, the style definitions have the following basic form: element { style-attribute1: value; style-attribute2: value; style-attribute3: value; } for example, the following definition -- were it not in serious conflict with the many menu style definitions in the global skin -- makes all xul menus appear with a one pixel border, a light blue background, and 10 point fonts: menu { border: 1px; background-color: lightblue; font-size: 10pt; } in addition to these basic element style rules, css also provides for the application of style information to classes of elements, and element ids...
...And 10 more matches
XPCOM Interfaces - Archive of obsolete content
however, there are quite a number of things that cannot be performed directly with javascript.
...javascript does not have the capability to do such things.
... the file interface only describes the characteristics of a file, it does not implement it.
...And 10 more matches
XUL Questions and Answers - Archive of obsolete content
loading remote dtds for xml documents is currenty not supported in xul.
...he said the code will be open-source, but it is not released yet (as of oct 2006).
... a scheme is in development to allow servers to open up their site for cross-site access, but that's not yet done.
...And 10 more matches
menulist - Archive of obsolete content
none the text will be not be cropped using an ellipsis.
...if the text does not match any of the items in the list, the menu selection is cleared.
... disabled type: boolean indicates whether the element is disabled or not.
...And 10 more matches
tab - Archive of obsolete content
ArchiveMozillaXULtab
none the text will be not be cropped using an ellipsis.
...for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
...And 10 more matches
toolbarbutton - Archive of obsolete content
where not possible, make all toolbarbuttons focusable by -moz-user-focus: normal.
... checked type: boolean indicates whether the element is checked or not.
... none the text will be not be cropped using an ellipsis.
...And 10 more matches
tooltip - Archive of obsolete content
none the text will be not be cropped using an ellipsis.
...if this attribute is set to true, this will not happen and the tooltip will only hide when the user moves the mouse to another element.
... note that a context menu will never respect this attribute, always appearing relative to the mouse cursor.
...And 10 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
in addition, the jaxer “ajax server” (a project i work on at aptana) is an example of ssjs that uses not only spidermonkey, but also embeds the entire firefox browser engine in the application server such that you can do server-side dom manipulation and other ajaxy things server-side that rhino was not built to do.
...next we’ll take a look at another powerful feature in rhino, e4x processing.
... the act of creating an e4x object is quite simple, in the case of listing 3, we do this through the line var x = new xml( str ); from here, the xml is accessible via dot notation.
...And 10 more matches
Writing JavaScript for XHTML - Archive of obsolete content
the receiving browser considers the content to be html, and does not utilise its xml parser.
... (note that xhtml documents which behave correctly in both application/xhtml+xml and text/html environments are sometimes known as 'polyglot' documents.) to test the following examples locally, use firefox's extension switch.
... problem: nothing works after switching the mime type suddenly no inline script works anymore.
...And 10 more matches
Advanced styling effects - Learn web development
note: there is another item that can be set in the box-shadow value — another length value can be optionally set just before the color value, which is a spread radius.
...it is not very commonly used, but worth mentioning.
... you can apply filters to any element and not just images.
...And 10 more matches
Debugging CSS - Learn web development
perhaps you believe that a certain selector should match an element, but nothing happens, or a box is a different size than you expected.
... you can use this to do an a/b comparison, deciding if something looks better with a rule applied or not, and also to help debug it — for example if a layout is going wrong and you are trying to work out which property is causing the problem.
...perhaps you want to see if another color looks better, or wish to tweak the size of something?
...And 10 more matches
Beginner's guide to media queries - Learn web development
it will not apply when the page is loaded in a browser.
... @media print { body { font-size: 12pt; } } note: the media type here is different from the so-called mime type.
... note: there were a number of other media types defined in the level 3 media queries specification; these have been deprecated and should be avoided.
...And 10 more matches
CSS basics - Learn web development
like html, css is not a programming language.
... it's not a markup language either.
...(the term ruleset is often referred to as just rule.) note the names of the individual parts: selector this is the html element name at the start of the ruleset.
...And 10 more matches
What’s in the head? Metadata in HTML - Learn web development
previous overview: introduction to html next the head of an html document is the part that is not displayed in the web browser when the page is loaded.
...t the simple html document we covered in the previous article: <!doctype html> <html> <head> <meta charset="utf-8"> <title>my test page</title> </head> <body> <p>this is my page</p> </body> </html> the html head is the contents of the <head> element — unlike the contents of the <body> element (which are displayed on the page when loaded in a browser), the head's content is not displayed on the page.
...our aim here is not to show you how to use everything that can possibly be put in the head, but rather to teach you how to use the major elements that you'll want to include in the head, and give you some familiarity.
...And 10 more matches
Working with JSON - Learn web development
previous overview: objects next javascript object notation (json) is a standard text-based format for representing structured data based on javascript object syntax.
...this is not a big issue — javascript provides a global json object that has methods available for converting between the two.
... note: converting a string to a native object is called deserialization, while converting a native object to a string so it can be transmitted across the network is called serialization.
...And 10 more matches
Framework main features - Learn web development
typescript is not concerned with the writing of user interfaces, but it is a domain-specific language, and has significant differences to vanilla javascript.
...eact, the jsx from the previous snippet would be compiled into this: var subject = "world"; var header = react.createelement("header", null, react.createelement("h1", null, "hello, ", subject, "!") ); when ultimately rendered by the browser, the above snippet will produce html that looks like this: <header> <h1>hello, world!</h1> </header> handlebars the handlebars templating language is not specific to ember applications, but it is heavily utilized in ember apps.
... 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.
...And 10 more matches
Beginning our React todo list - Learn web development
note: if you need to check your code against our version, you can find a finished version of the sample react app code in our todo-react repository.
... we're not going to write per-component stylesheets, so first delete the app.css import from the top of app.js.
... we are also not going to be using the logo.svg file, so remove that import too.
...And 10 more matches
Understanding client-side JavaScript frameworks - Learn web development
we are not aiming to exhaustively teach you everything you need to know about react/reactdom, or vue, or some other specific framework; the framework teams' own docs (and other resources) do that job already.
... react tutorials note: react tutorials last tested in may 2020, with react/reactdom 16.13.1 and create-react-app 3.4.1.
... ember tutorials note: ember tutorials last tested in may 2020, with ember/ember cli version 3.18.0.
...And 10 more matches
Accessible Toolkit Checklist
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.
... alt+f4 closes windows, similar to escape but even works on dialogs without cancel button alt+space opens window menu with restore, move, size, minimize, maximize, close the move and size options must be usable with the arrow keys on the keyboard in windows, initial focus goes to first focusable widget that is not a clickable tabbed property sheet label making tab order definable.
... tab order must wrap, not have invisible items in tab order dynamically added items must not corrupt the tab cycle or make it disorderly tab cycle must be identical backwards and forwards the f6 and shift+f6 key combinations should cycle through panes in a window making focus visible on any widget, and focus must always be visible shift+f10 or context menu key should work like right click on focused item, and context menu should show just under and to the right of the current focus.
...And 10 more matches
Multiple Firefox profiles
for example, you might want to have some extensions installed for web development, but not for general-purpose web browsing.
...aurora contains experimental features, which are not yet at beta quality.
... from profile manager inside firefox if you already have firefox instance running, you can open another profile from the integrated profile manager on any platform: type about:profiles into the browser url search bar.
...And 10 more matches
Limitations of chrome scripts
however, these shims are not a substitute for migrating extensions: they are only a temporary measure, and will be removed eventually they can have a bad effect on responsiveness there are likely to be edge cases in which they don't work properly you can see all the places where your add-on uses compatibility shims by setting the dom.ipc.shims.enabledwarnings preference and watching the browser console as you use the ...
...for each pattern we've noted: whether a shim exists and what kind of behavior it provides how to update your add-on so you don't need the shim gbrowser.contentwindow, window.content...
...for example: // chrome code gbrowser.contentwindow; // null gbrowser.contentdocument; // null gbrowser.selectedbrowser.contentwindow; // null window.content; // null content; // null as a special note, docshells live in the content process, so they are also inaccessible: gbrowser.docshell; // null gbrowser.selectedbrowser.docshell; // null with the shim the shim will give you a cpow for the content object in these situations.
...And 10 more matches
Extending a Protocol
visually, it's going to look something like this (except for the operating system bit, which we are not actually going to do - just to illustrate what we could do): let's start by implementing the webidl above.
... sometimes, the parent will want to notify all its children of something.
... includes: this is kinda like "#includes" in c++, except it's not a preprocessor directive.
...And 10 more matches
Internationalized Domain Names (IDN) Support in Mozilla Browsers
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.
... there are many languages whose writing scripts are not based on latin alphabet at all.
...And 10 more matches
XPCOMUtils.jsm
if not // provided, the default factory is used, which returns // |(new mycomponent()).queryinterface(iid)| in its createinstance().
...when set to true, and only if 'value' // is not specified, the concatenation of the string "service," and the // object's contractid is passed as avalue parameter of addcategoryentry.
...}; note: the ability to register the component in a category only on specific applications by adding the apps field to a category entry was added in gecko 2.
...And 10 more matches
BloatView
note that this number does not reflect any memory held onto by the class, such as internal buffers, etc.
...for nsstring you'll see the size of the header struct, not the size of the string contents!) bytes leaked - the number of bytes per instance times the number of objects leaked: (bytes per-inst) x (objects rem).
...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.
...And 10 more matches
NSS Sample Code Sample1
as an alternative to token symmetric keys as a way to store large numbers of symmetric keys wrapping symmetric keys using an rsa key from another server unwrapping keys using your own rsa key pair the main part of the program shows a typical sequence of events for two servers that are trying to extablish a shared key pair.
...(this key will also be used for // storage of the keys, since nss does not support permanent symmetric // keys at the current time.) // 3.
...// note: currently nss does not support permanent symmetric keys.
...And 10 more matches
JSAPI Cookbook
note: the foss wiki page contains a few links to other libraries and programs that can make life easier when using spidermonkey and jsapi.
...ting function: // javascript var v = computesomevalue(); var isstring = typeof v === "string"; var isnumber = typeof v === "number"; var isnull = v === null; var isboolean = typeof v === "boolean"; var isobject = typeof v === "object" && v !== null; /* jsapi */ js::rootedvalue v(cx, computesomevalue()); bool isstring = v.isstring(); bool isnumber = v.isnumber(); bool isint32 = v.isint32(); // note: internal representation, not numeric value bool isnull = v.isnull(); bool isboolean = v.isboolean(); bool isobject = v.isobject(); // note: not broken like typeof === "object" is :-) to set a value use a correspondingly named member mutator function, or assign the result of the correspondingly named standalone function: // javascript var v; v = 0; v = 0.5; v = somestring; v = null; v = undef...
...*/ js::rootedvalue constructor_val(cx); if (!js_getproperty(cx, js_getglobalobject(cx), "person", &constructor_val)) return false; if (!constructor_val.isobject()) { js_reporterror(cx, "person is not a constructor"); return false; } js::rootedobject constructor(cx, &constructor_val.toobject()); /* step 2 - set up the arguments.
...And 10 more matches
SpiderMonkey 31
these release notes are incomplete.
... the download url is outdated and spidermonkey not release alone!
... if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010: msvc8/9 support has been dropped.
...And 10 more matches
Accessing the Windows Registry Using XPCOM
first, you must use createinstance() to get an object implementing this interface, not getservice().
... notice in the open() call that the root key to use is specified using the named constants available on the nsiwindowsregkey interface, in this case root_key_local_machine, which corresponds to hkey_local_machine in the windows registry.
... also notice that the path to the key has backslashes escaped, a necessity in javascript and c++ string constants.
...And 10 more matches
Building the WebLock UI
if the weblock component is being installed in mozilla or another gecko-based browser, then this third section shows you how to create the entry point in the browser for controlling the web locking.
...the "shell" for the xul file, then, looks like this: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <dialog id="weblock_ui" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="web lock manager" persist="screenx screeny" screenx="24" screeny="24"> </dialog> note that this part of the xul file also contains a stylesheet declaration, which imports css rules and applies them to particular parts of the interface.
...the web lock manager dialog does not deviate from the look of a standard dialog, so it can use a single declaration to import the "global" skin from the browser and make it available to the widgets you define in weblock.xul.
...And 10 more matches
Finishing the Component
the interfaces needed to block certain urls from loading are not frozen, and there is still some debate about how exactly this functionality should be exposed to embedders and component developers, so the apis are not ready to be published.
...however, when this same component is used in a gecko installation where this interface has changed, the method testa does not exist in the nsifoo interface; the first entry in the v-table is in fact isprime().
...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.
...And 10 more matches
Detailed XPCOM hashtable guide
unsorted: stored unsorted; cannot be iterated over in a sorted manner.
... some: hashtables are not packed structures; depending on the implementation, there may be significant wasted memory.
... hashtables should not be used for sets that need to be sorted; very small datasets (less than 12-16 items); data that does not need random access.
...And 10 more matches
IAccessibleTable2
other-licenses/ia2/accessibletable2.idlnot scriptable this interface gives access to a two-dimensional table.
... return value s_false if there is nothing to return, [out] value is null.
...s_false if there is nothing to return, [out] value is null.
...And 10 more matches
nsICryptoHash
note: this method may be called any time after " ..
... exceptions thrown ns_error_not_initialized indicates that init() or initwithstring() has not been called.
... note: this method or " ..
...And 10 more matches
nsIMsgDatabase
aforcecommit); void commit(in nsmsgdbcommit committype); void forceclosed(); void clearcachedhdrs; void resethdrcachesize(in unsigned long size); nsimsgdbhdr getmsghdrforkey(in nsmsgkey key); nsimsgdbhdr getmsghdrformessageid(in string messageid); boolean containskey(in nsmsgkey key); nsimsgdbhdr createnewhdr(in nsmsgkey key); void addnewhdrtodb(in nsimsgdbhdr newhdr, in boolean notify); nsimsgdbhdr copyhdrfromexistinghdr(in nsmsgkey key, in nsimsgdbhdr existinghdr, in boolean addhdrtodb); void listallkeys(in nsmsgkeyarrayref outputkeys); native code only!
... void deletemessage(in nsmsgkey key, in nsidbchangelistener instigator, in boolean commit); void deleteheader(in nsimsgdbhdr msghdr, in nsidbchangelistener instigator,in boolean commit, in boolean notify); void removeheadermdbrow(in nsimsgdbhdr msghdr); void undodelete(in nsimsgdbhdr msghdr); void markmarked(in nsmsgkey key, in boolean mark, in nsidbchangelistener instigator); void markoffline(in nsmsgkey key, in boolean offline, in nsidbchangelistener instigator); void setlabel(in nsmsgkey key, in nsmsglabelvalue label); void setstringproperty(in nsmsgkey akey, in string aproperty...
..., in string avalue); void markimapdeleted(in nsmsgkey key, in boolean deleted, in nsidbchangelistener instigator); void applyretentionsettings(in nsimsgretentionsettings amsgretentionsettings, in boolean adeleteviafolder); boolean hasnew(); void clearnewlist(in boolean notify); void addtonewlist(in nsmsgkey key); void startbatch(); void endbatch(); nsimsgofflineimapoperation getofflineopforkey(in nsmsgkey messagekey, in boolean create); void removeofflineop(in nsimsgofflineimapoperation op); nsisimpleenumerator enumerateofflineops(); void listallofflineopids(in nsmsgkeyarrayptr offlineopids); native code only!
...And 10 more matches
nsINavHistoryResultObserver
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.
...nce gecko 2.0 obsolete since gecko 11.0 void containeropened(in nsinavhistorycontainerresultnode acontainernode); deprecated since gecko 2.0 obsolete since gecko 11.0 void containerstatechanged(in nsinavhistorycontainerresultnode acontainernode, in unsigned long aoldstate, in unsigned long anewstate); void invalidatecontainer(in nsinavhistorycontainerresultnode acontainernode); void nodeannotationchanged(in nsinavhistoryresultnode anode, in autf8string aannoname); void nodedateaddedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodehistorydetailschanged(in nsinavhistoryresultnode anode, in prtime anewvisitdate, in unsigned long anewaccesscount); void nodeiconchanged(in nsinavhistoryresultnode anode); void nodeinserted(in nsinavhistorycontainerresultnode a...
...although this attribute is read-write, you should not alter it directly; instead, call nsinavhistoryresult.addobserver() to add an observer to a result.
...And 10 more matches
nsINavHistoryService
this can be used in ui to determine whether the "clear history" button should be enabled or not.
...it is also true of any content in a frame, regardless if whether or not the user clicked something to get there.
... canadduri() this method checks if the given uri would be added to the history or not.
...And 10 more matches
nsIRequest
load_background 1 << 0 do not deliver status notifications to the nsiprogresseventsink, or keep this load from completing the nsiloadgroup it may belong to.
...it does not, however, prevent cached content from being used to satisfy this request.
...it is not recommended for normal browsing as it may likely violate reasonable assumptions made by the server and confuse users.
...And 10 more matches
Add to iPhoto
note: this extension uses carbon routines, which can no longer be used in firefox add-ons now that firefox is a 64-bit application.
...choose it, and iphoto will start up (if it's not already running) and import the image.
... for the sake of organization, i chose to implement each system framework (and, mind you, i only declare the apis i actually use, not all of them) as a javascript object containing all the types and methods that framework's api.
...And 10 more matches
DevTools API - Firefox Developer Tools
if you notice any inconsistency, please let the firefox developer tools team know.
...the toolpanel is built only when the tool is selected (not when the toolbox is opened).
...if the tool is not already loaded or currently loading the returned promise won't be fulfilled until something triggers the tool to load.
...And 10 more matches
Migrating from Firebug - Firefox Developer Tools
when you switch to another tab, though, they're closed.
...the devtools do not have a side panel like the command editor (which is requested in bug 1133849), but therefore has a separate tool called scratchpad, which can be added as panel to the toolbox or opened in a separate window via firefox menu > developer > scratchpad or shift + f4.
...a few property values are not auto-completed yet, which is tracked in bug 1337918.
...And 10 more matches
Using images - Web APIs
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.
... htmlcanvaselement you can use another <canvas> element as your image source.
... the document.images collection the document.getelementsbytagname() method if you know the id of the specific image you wish to use, you can use document.getelementbyid() to retrieve that specific image using images from other domains using the crossorigin attribute of an <img> element (reflected by the htmlimageelement.crossorigin property), you can request permission to load an image from another domain for use in your call to drawimage().
...And 10 more matches
IDBObjectStore.createIndex() - Web APIs
note that this method must be called only from a versionchange transaction mode callback.
... note: this feature is available in web workers.
...note that it is possible to create an index with an empty name.
...And 10 more matches
Service Worker API - Web APIs
they will also allow access to push notifications and background sync apis.
...it takes the form of a javascript file that can control the web-page/site that it is associated with, intercepting and modifying navigation and resource requests, and caching resources in a very granular fashion to give you complete control over how your app behaves in certain situations (the most obvious one being when the network is not available).
...in firefox, service worker apis are also hidden and cannot be used when the user is in private browsing mode.
...And 10 more matches
Geometry and reference spaces in WebXR - Web APIs
in this article, we introduce the ways in which webxr expands upon the geometry of webgl, and how the positions and orientations of objects—both physical and virtual—are described in relation to one another using spaces and, in particular, reference spaces.
... const radians_per_degree = math.pi / 180.0; let degreestoradians = (deg) => deg * radians_per_degree; let radianstodegrees = (rad) => rad / radians_per_degree; times and durations note that for security reasons, domhighrestimestamp usually introduces a small amount of imprecision to the clock in order to prevent it from being used in fingerprinting and timing-based attacks.
... note that when we say that a transform applies to a point, it also, by extension, can be applied to a collection of points.
...And 10 more matches
Starting up and shutting down a WebXR session - Web APIs
assuming you're already familiar with 3d graphics in general and webgl in particular, taking that next bold step into mixed reality—the idea of presenting artificial scenery or objects in addition to or in place of the real world—is not overly complicated.
... webxr availability as a new and still in development api, webxr support is limited to specific devices and browsers; and even on those, it may not be enabled by default.
...be aware, however, that the emulator does not yet completely emulate all of the webxr api, so you may run into problems you're not expecting.
...And 10 more matches
Using the Web Audio API - Web APIs
the web audio api does not replace the <audio> media element, but rather complements it, just like <canvas> coexists alongside the <img> element.
... a powerful feature of the web audio api is that it does not have a strict "sound call limitation".
... 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.
...And 10 more matches
ARIA live regions - Accessibility
using javascript, it is possible to dynamically change parts of a page without requiring the entire page to reload — for instance, to update a list of search results on the fly, or to display a discreet alert or notification which does not require user interaction.
... while these changes are usually visually apparent to users who can see the page, they may not be obvious to users of assistive technologies.
... note: assistive technologies will announce dynamic changes in the content of a live region.
...And 10 more matches
Architecture - Accessibility
sometimes the embedded object is really just another text container with more embedded objects.
... however in accessibility hierarchies such as atk and iaccessible2, text is not exposed in leaf nodes as it is in a w3c dom.
... why hyperlink is often not a link as explained above, anything that is embedded in text implements the hyperlink interface.
...And 10 more matches
CSS values and units - CSS: Cascading Style Sheets
when both quoted and unquoted user defined text values are permitted, the specification will list <custom-ident> | <string>, meaning quotes are optional, such as is the case with animation names: @keyframe validident { /* keyframes go here */ } @keyframe 'validstring' { /* keyframes go here */ } some text values are not valid if encompassed in quotes.
... 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.
...And 10 more matches
display - CSS: Cascading Style Sheets
WebCSSdisplay
inline the element generates one or more inline element boxes that do not generate line breaks before or after themselves.
... 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.
... 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.
...And 10 more matches
<button>: The Button element - HTML: Hypertext Markup Language
WebHTMLElementbutton
disabled this boolean attribute prevents the user from interacting with the button: it cannot be pressed or focused.
...(if this attribute is not set, the <button> is associated with its ancestor <form> element, if any.) this attribute lets you associate <button> elements to <form>s anywhere in the document, not just inside a <form>.
...does nothing if there is no form owner.
...And 10 more matches
<col> - HTML: Hypertext Markup Language
WebHTMLElementcol
tag omission it must have start tag, but must not have an end tag.
... permitted parents <colgroup> only, though it can be implicitly defined as its start tag is not mandatory.
... the <colgroup> must not have a span attribute.
...And 10 more matches
<tr>: The Table Row element - HTML: Hypertext Markup Language
WebHTMLElementtr
deprecated attributes the following attributes may still be implemented in browsers but are no longer part of the html specification and may be missing or may not work as expected.
...if align is not set to char, this attribute is ignored.
... this attribute is not only obsolete, but was rarely implemented anyway.
...And 10 more matches
HTTP headers - HTTP
WebHTTPHeaders
hop-by-hop headers these headers are meaningful only for a single transport-level connection, and must not be retransmitted by proxies or cached.
... note that only hop-by-hop headers may be set using the connection general header.
...used for backwards compatibility with http/1.0 caches where the cache-control header is not yet present.
...And 10 more matches
Numbers and dates - JavaScript
in addition to being able to represent floating-point numbers, the number type has three symbolic values: +infinity, -infinity, and nan (not-a-number).
... decimal numbers 1234567890 42 // caution when using leading zeros: 0888 // 888 parsed as decimal 0777 // parsed as octal in non-strict mode (511 in decimal) note that decimal literals can start with a zero (0) followed by another decimal digit, but if every digit after the leading 0 is smaller than 8, the number gets parsed as an octal number.
...if the digits after the 0b are not 0 or 1, the following syntaxerror is thrown: "missing binary digits after 0b".
...And 10 more matches
Character classes - JavaScript
do not forget to edit it as well, thanks!
...for example, /.y/ matches "my" and "ay", but not "yes", in "yes make my day".
... note that the m multiline flag doesn't change the dot behavior.
...And 10 more matches
Regular expressions - JavaScript
use the constructor function when you know the regular expression pattern will be changing, or you don't know the pattern and are getting it from another source, such as user input.
... note: if you are already familiar with the forms of a regular expression, you may also read the cheatsheet for a quick lookup for a specific pattern/construct.
...there is no match in the string "grab crab" because while it contains the substring "ab c", it does not contain the exact substring "abc".
...And 10 more matches
Classes - JavaScript
classes in js are built on prototypes but also have some syntax and semantics that are not shared with es5 classalike semantics.
... class rectangle { constructor(height, width) { this.height = height; this.width = width; } } hoisting an important difference between function declarations and class declarations is that function declarations are hoisted and class declarations are not.
... you first need to declare your class and then access it, otherwise code like the following will throw a referenceerror: const p = new rectangle(); // referenceerror class rectangle {} class expressions a class expression is another way to define a class.
...And 10 more matches
Array.prototype.map() - JavaScript
it is not called for missing elements of the array; that is: indexes that have never been set; which have been deleted; or which have never been assigned a value.
... when not to use map() since map builds a new array, using it when you aren't using the returned array is an anti-pattern; use foreach or for-of instead.
... you shouldn't be using map if: you're not using the array it returns; and/or you're not returning a value from the callback.
...And 10 more matches
Atomics - JavaScript
unlike the other global objects, atomics is not a constructor.
... you cannot use it with a new operator or invoke the atomics object as a function.
...atomic operations make sure that predictable values are written and read, that operations are finished before the next operation starts and that operations are not interrupted.
...And 10 more matches
Function.prototype.apply() - JavaScript
note that this may not be the actual value seen by the method: if the method is a function in non-strict mode code, null and undefined will be replaced with the global object, and primitive values will be boxed.
... description note: while the syntax of this function is almost identical to that of call(), the fundamental difference is that call() accepts an argument list, while apply() accepts a single array of arguments.
... note: when the first argument is undefined or null a similar outcome can be achieved using the array spread syntax.
...And 10 more matches
Map - JavaScript
in the current ecmascript specification, -0 and +0 are considered equal, although this was not so in earlier drafts.
... however, there are important differences that make map preferable in certain cases: map object accidental keys a map does not contain any keys by default.
... an object has a prototype, so it contains default keys that could collide with your own keys if you're not careful.
...And 10 more matches
WebAssembly.Table - JavaScript
note: tables can currently only store function references, but this will likely be expanded in the future.
... the table2.wasm module contains two functions (one that returns 42 and another that returns 83) and stores both into elements 0 and 1 of the imported table (see text representation).
... webassembly.instantiatestreaming(fetch('table2.wasm'), importobject) .then(function(obj) { console.log(tbl.length); console.log(tbl.get(0)()); console.log(tbl.get(1)()); }); note how you've got to include a second function invocation operator at the end of the accessor to actually invoke the referenced function and log the value stored inside it (e.g.
...And 10 more matches
parseInt() - JavaScript
if this argument is not a string, then it is converted to one using the tostring abstract operation.
...be careful—this does not default to 10!
... the description below explains in more detail what happens when radix is not provided.
...And 10 more matches
Operator precedence - JavaScript
note that both op1 and op2 are fill-in-the-blanks for operators.
... a op1 b op2 c 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.
... as another example, the unique exponentiation operator has right-associativity, whereas other arithmetic operators have left-associativity.
...And 10 more matches
The "codecs" parameter in common media types - Web media technologies
as noted elsewhere, this format was once commonly used on the web but no longer is, since it required a plugin to use.
... as is the case with any mime type parameter, codecs must be changed to codecs* (note the asterisk character, *) if any of the properties of the codec use special characters which must be percent-encoded per rfc 2231, section 4: mime parameter value and encoded word extensions.
...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.
...And 10 more matches
Using custom elements - Web Components
note: custom elements are supported by default in firefox, chrome, and edge (76).
...note that custom element names require a dash to be used in them (kebab-case); they can't be single words.
...over in our html, we use it like so: <popup-info img="img/alt.png" data-text="your card validation code (cvc) is an extra security feature — it is the last 3 or 4 numbers on the back of your card."></popup-info> note: you can see the full javascript source code here.
...And 10 more matches
Content Processes - Archive of obsolete content
there are several caveats here, all of them related to security, that might cause things to not behave in the way you might expect.
... the final section explains why the sdk still uses the notion of content scripts and message passing, even though the multiprocess model for which they were designed never materialized.
...the problem with the multiprocess model is that add-ons and content are now in different processes, and scripts in one process cannot interact directly with scripts in another.
...And 9 more matches
Modules - Archive of obsolete content
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.
...each compartment has a set of privileges that determines what scripts running in that compartment can and cannot do.
...unfortunately, javascript does not provide any means to load scripts from other locations: we have to rely on the host application to provide us with this functionality.
...And 9 more matches
Private Properties - Archive of obsolete content
unlike other languages, javascript does not have native support for private properties.
... both approaches have drawbacks, they are either not restrictive enough or too restrictive, respectively.
...however, note that weakmaps might not be supported by all implementations yet.
...And 9 more matches
ui/frame - Archive of obsolete content
messages logged from a frame script using the console will not appear in the terminal when you run the add-on using jpm run.
... if you know the target uri, you should use it, as this is more secure: it prevents another window from intercepting messages that were intended for someone else.
...to do this, you call postmessage() not on the frame itself but on the source attribute of the object passed into an event listener.
...And 9 more matches
Inline options - Archive of obsolete content
here is an example of an options.xul file: <?xml version="1.0"?> <!doctype mydialog system "chrome://myaddon/locale/mydialog.dtd"> <vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <setting type="bool" pref="extensions.myaddon.bool" title="boolean" desc="stored as a boolean preference" /> </vbox> note that it's limited to <setting> tags.
...if you need script support, see the display notifications section.
...medium"/> <menuitem value="1200" label="large"/> </menupopup> </menulist> </setting> <!-- radio button example (this example would be stored as a boolean) --> <setting pref="extensions.myaddon.options2" type="radio" title="options 2"> <radiogroup> <radio value="false" label="disabled"/> <radio value="true" label="enabled"/> </radiogroup> </setting> <!-- button example - not tied to a preference, but attached to a command --> <setting title="do something" type="control"> <button id="myaddon-button" label="click me" oncommand="alert('thank you!');"/> </setting> setting element changed notifications most of the setting elements (it might be all i havent really looked), support oninputchanged attribute.
...And 9 more matches
Appendix D: Loading Scripts - Archive of obsolete content
speed: script 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.
... advantages namespacing: since scripts executed via evalinsandbox run in a defined namespace, global namespace contamination and the resultant extension compatibility issues are not usually a problem.
...And 9 more matches
The Box Model - Archive of obsolete content
the css property may be useful on some occasions, but using the orient attribute is not recommended because it mixes content and presentation.
...the default value for most elements is 0, which means that the element will not stretch in the direction of its orientation, and its size in that dimension will be determined by its contents and padding.
...note that this is not always the case.
...And 9 more matches
Setting up an extension development environment - Archive of obsolete content
note: for an extended guide on how to set up even more user profiles, take a look at multiple firefox profiles.
... note: you could run firefox using your regular profile while developing.
...if you are already running a firefox instance without -no-remote, and you attempt to start another instance with -p profilename (but without the -no-remote parameter), that second invocation would ignore its -p profilename parameter, instead opening a new window for the already running instance; sharing all its profile, sessions etc.
...And 9 more matches
Download Manager preferences - Archive of obsolete content
preference description browser.download.antivirus.dontclean note: in gecko 1.9.1.
... browser.download.manager.addtorecentdocs a boolean value that indicates whether or not new downloads should be added to the recent documents list.
... browser.download.manager.closewhendone a boolean value indicating whether or not the downloads window should close automatically when downloads are completed.
...And 9 more matches
JavaScript Client API - Archive of obsolete content
please note that usage of the sync apis is governed by a terms of service: by accessing or using the firefox sync apis in connection with the development of your own client software to access the firefox sync services (a “third party client”), you acknowledge that you will need to install and use a local version of the firefox sync server for multiple account testing and that any use of mozilla’s hosted firefox sy...
...d reasonably detailed privacy policy detailing how data collected or transmitted by your third party client is managed and protected; (b) that your third party client will only store data in encrypted form on the firefox sync servers operated by mozilla; (c) that you and your third party client will use the firefox sync apis solely for their intended purpose; (d) that your third party client will not hide or mask its identity as it uses the services and/or firefox sync apis, including by failing to follow required identification conventions; and (e) that you and your third party client will not use the firefox sync apis for any application or service that replicates or attempts to replicate the services or firefox sync experience unless such use is non-confusing (by non-confusing, we mean tha...
...you may not imply, either directly or by omission, that your third party client is produced or endorsed by mozilla.
...And 9 more matches
Actionscript Acceptance Tests - Archive of obsolete content
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.
... this example passes in another .abc file as an argument to the file being run: -- $dir/file.abc another use would be to pass a specific argument to the shell: -dtimeout this file can have multiple lines with different arguments.
... should just be an integer with nothing else.
...And 9 more matches
The new nsString class implementation (1999) - Archive of obsolete content
in the meantime, try the xpcom string guide—but note that that article bears a warning of its own!
...the deficiencies of the current implementation are: class based -- making it unsuitable for cross-dll usage due to fragility little intrinsic i18n support few efficiencies, notably a lack of support for narrow (1-byte) character strings no support for external memory management policy lack of xpcom interface notable features of the new nsstrimpl implementation are: intrinsic support for 1 and 2 byte character widths provides automatic conversion between strings with different character sizes inviolate base structure eliminates class fragility problem; safe across...
...also note that the new nsstring interface mimics fully the interface in the existing nsstring class found in mozilla/base/src/nsstring.h.
...And 9 more matches
Creating XPI Installer Modules - Archive of obsolete content
under the chrome/ directory, you'll notice that in addition to the package subdirectories, there are now also a handful of jar files, or java archives (see figure below).
...however, this new arrangement does not make things much easier for the web or user interface developer.
...where before a single manifest.rdf file described the resources in an entire package directory or archive, now contents.rdf files can be used for as large or as small a part of your package description as you want; you can use several contents.rdf files in your package to describe the various parts (e.g., one for the skin of your package, another for the content, and so on), or you can use a single one, as was common before.
...And 9 more matches
Writing to Files - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes.
...it doesn't matter whether the file exists or not.
...And 9 more matches
Multiple Rules - Archive of obsolete content
note that only the first rule, in the order that the rules appear in the template, that matches for a result is used, not all of them that match.
...for instance, if the first rule matched all folders, then the remaining rules can assume that any results that get past the first rule are not folders.
...note that the full query syntax must be used to use conditions within rules.
...And 9 more matches
Tree Box Objects - Archive of obsolete content
note that redrawing does not occur until the calling script ends since mozilla does not redraw in the background.
... note: it is not necessary to run tree.boxobject.queryinterface(components.interfaces.nsitreeboxobject) as shown in the code examples on this page because: let boxobject = tree.treeboxobject; note: is equivalent to: let boxobject = tree.boxobject; boxobject.queryinterface("components.interfaces.nsitreeboxobject"); scrolling the tree you can also scroll the tree using four different methods, similar to those available for listboxes.
...eeitem label="row 2"/> <treeitem label="row 3"/> <treeitem label="row 4"/> <treeitem label="row 5"/> <treeitem label="row 6"/> <treeitem label="row 7"/> <treeitem label="row 8"/> <treeitem label="row 9"/> </treechildren> </tree> <hbox align="center"> <label value="scroll to row:"/> <textbox id="tbox"/> <button label="scroll" oncommand="doscroll();"/> </hbox> note that we use the rows attribute on the tree to specify that only four rows are displayed at a time.
...And 9 more matches
menu - Archive of obsolete content
ArchiveMozillaXULmenu
this attribute does not apply to menus directly on the menubar.
... none the text will be not be cropped using an ellipsis.
...for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
...And 9 more matches
window - Archive of obsolete content
without including the css file at "chrome://global/skin/", the window will not be stylized and will be invisible and glitchy when opened as a dialog.
... note: starting in gecko 1.9.2, you can detect when a window is activated or deactivated by watching for the "activate" and "deactivate" events.
...note: this has no effect if the tabs on top preference is turned off.
...And 9 more matches
application/http-index-format specification - Archive of obsolete content
syntax every line in the file must conform to the following generic syntax: number: data where number is at least a three digit number (note that more digits are possible in the future) and data is separated from number by a colon and a space.
...if a number is encountered that a parser does not understand the parser is required to ignore that line.
...this data is not intended for display to the end user and is only meant as a comment to make the file format clear to a human interpreter.
...And 9 more matches
Monitoring plugins - Archive of obsolete content
this component then reports the plugin runtime using the observer service to anyone registered to receive the notifications.
... usage to make use of the new component you must register to receive its runtime notifications using the observer service.
... the notification's topic is experimental-notify-plugin-call.
...And 9 more matches
Adobe Flash - Archive of obsolete content
versions of flash prior to flash 6r49 (such as flash 5) are not scriptable in netscape gecko browsers.
...until macromedia changes this from within the flash plugin, scriptability can not be used on mac os x browsers based on gecko.
...furthermore, it is also necessary weed out versions of flash that are not scriptable in mach-o browsers on os x.
...And 9 more matches
Theme changes in Firefox 2 - Archive of obsolete content
note: we could use an article called updating themes for firefox 2 that would serve as a how-to guide for updating themes.
... global/icons/alltabs.png not actually used; left over from earlier drafts of the theme.
... global/notification.css new file; defines styles used by the notification strip that appears at the top of browser windows to present notices such as "a popup was blocked." global/scrollbox/autorepeat-arrow-dn-dis.gif new file; icon displayed for a disabled autorepeat down arrow in a scroll box.
...And 9 more matches
Processing XML with E4X - Archive of obsolete content
this chapter provides a practical overview of the language; it is not a complete reference.
... while the xml object looks and behaves in a similar way to a regular javascript object, the two are not the same thing.
...the syntax is designed to be familiar to javascript programmers, but e4x does not provide a direct mapping from xml to native javascript objects; just the illusion of one.
...And 9 more matches
Examples - Archive of obsolete content
if you wish to test these examples by yourself, please read the important notes.
... important notes if you plan to test these examples by yourself, you must use the right filename extension (it is written at the beginning of the code).
... please note that the examples 4, 5 and 6 require a file named style.css to exist in the same directory as the example.
...And 9 more matches
Gecko FAQ - Gecko Redirect 1
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.
...however, gecko does not package all of these components alongside other interface modules in a coherent, user-friendly application (including menus, toolbars, etc.), such as firefox.
...certain browser components are not provided as part of gecko, such as bookmarks, history, address book, etc.
...And 9 more matches
How CSS is structured - Learn web development
if css is not applying to content as-expected, your selector may not match the way you think it should match.
...if any of the syntax above is not familiar, try searching mdn.
... note: you will learn more about selectors in the next module: css selectors.
...And 9 more matches
How can we design for all types of users? - Learn web development
note: alternatively you can find a number of contrast checkers online, such as webaim's color contrast checker.
... absolute units absolute units are not proportionally calculated but refer to a size set in stone, so to speak, and are expressed most of the time in pixels (px).
...in this case, zooming did nothing, even as late as internet explorer 8, which we still have to cater to because it's still around.
...And 9 more matches
HTML Cheatsheet - Learn web development
remember that html tags must be used for their semantic, not their appearance.
...by default, "inline elements" appear next to one another in a webpage.
...ef="https://realityripple.com/">a link to realityripple</a> a link to realityripple a simple image <img src="https://udn.realityripple.com/samples/6e/d6ed76c6c7.png" width="25" /> a generic inline container <p>p its used to <span style="color:blue">style and group</span> particular elements </p> p its used to style and group particular elements another inline container <p>span its used to differentiate a part <span style="color:blue">of the content</span> that we will work on differently </p> span its used to differentiate a part of the content that we will work on differently emphasize some text <em>i'm posh</em> i'm posh italic textt you can mark a phrase in the text in <i>italics</i> you can m...
...And 9 more matches
Adding vector graphics to the Web - Learn web development
note: this article doesn't intend to teach you svg; just what it is, and how to add it to web pages.
... note: the images above are actually all pngs — with the left-hand star in each case representing a raster image, and the right-hand star representing a vector image.
...svg is for marking up graphics, not content.
...And 9 more matches
Handling text — strings in JavaScript - Learn web development
strings — the basics strings are dealt with similarly to numbers at first glance, but when you dig deeper you'll start to see some notable differences.
... creating a string to start with, enter the following lines: let string = 'the revolution will not be televised.'; string; just like we did with numbers, we are declaring a variable, initializing it with a string value, and then returning the value.
...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.
...And 9 more matches
Storing the information you need — Variables - Learn web development
you may not fully understand the syntax we are using (yet!), but you should be able to get the idea — if we didn't have variables available, we'd have to implement a giant code block that checked what the entered name was, and then display the appropriate message for any name.
... another special thing about variables is that they can contain just about anything — not just strings and numbers.
... note: we say variables contain values.
...And 9 more matches
Object-oriented JavaScript for beginners - Learn web development
here we'll look at oop theory in general, not in the context of any specific programming language.
... note: the fancy word for the ability of multiple object types to implement the same functionality is polymorphism.
...notice that it has all the features you'd expect in a function, although it doesn't return anything or explicitly create an object — it basically just defines properties and methods.
...And 9 more matches
Application cache implementation overview
if no nsiapplicationcache object has been found, there is no offline cache to load from and the load continues a usual way by loading from normal http cache, further steps are not executed.
...when aentrystatus is a failure code, entry has not been found, but the url is falling under one of the network or fallback namespaces.
...associating the top level document with offline cache this happens between document load start and the first sub-resource download start and is not about associating nsiapplicationcache object with the channel, but with the document object the load is performed for.
...And 9 more matches
Creating Sandboxed HTTP Connections
channel.asyncopen(listener, null); http notifications the above mentioned listener is a nsistreamlistener, which gets notified about events such as http redirects and data availability.
... since nsistreamlistener does not cover cookies, the current channel being used will need to be stored as a global, since another listener will be used for cookie notifications (covered in the next section).
...l // the io service var ioservice = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); // create an nsiuri var uri = ioservice.newuri(myurlstring, null, null); // get a channel for that nsiuri gchannel = ioservice.newchannelfromuri(uri); // get an listener var listener = new streamlistener(callbackfunc); gchannel.notificationcallbacks = listener; gchannel.asyncopen(listener, null); function streamlistener(acallbackfunc) { this.mcallbackfunc = acallbackfunc; } streamlistener.prototype = { mdata: "", // nsistreamlistener onstartrequest: function (arequest, acontext) { this.mdata = ""; }, ondataavailable: function (arequest, acontext, astream, asourceoffset, alength) { var scriptableinput...
...And 9 more matches
mozbrowserselectionstatechanged
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.
...note that this is deprecated, and current implementations should use mozbrowsercaretstatechanged instead.
...And 9 more matches
Overview of Mozilla embedding APIs
public return codes ns_succeeded ns_error_failure ns_error_not_implemented public functions the following functions are available from the xpcom dll.
...currently, once gecko has been shutdown, it cannot be restarted in the same process space...
...in addition to memory allocation and release, this service provides low memory notifications, called a memory pressure observers, which are notified when memory is low - thus allowing cached resources to be freed.
...And 9 more matches
How to implement a custom autocomplete search component
thunderbird 2.x and seamonkey 1.1.x support the toolkit interfaces, although they do not use the same autocomplete widget.
... the simplest way to make an xpcom component is to build an xpcom javascript component (this cannot be done with a javascript module).
... note: when copying the examples below, change the uuid that uniquely identifies the component, otherwise you might have problems if your component gets installed along another component derived from those same examples.
...And 9 more matches
Mozilla Development Strategies
it has not been updated for usage of mercurial (instead of cvs).
...if you don't mark the bug, your work might go unnoticed by the docs team!
...even if you're not comfortable with your writing skills, keep in mind that our helpful, happy documentation gnomes will follow along behind you and clean up for you.
...And 9 more matches
NSS PKCS11 Functions
recurse is a boolean indicates whether or not the module should also launch additional pkcs #11 modules.
...note: the database must be in the internal token, and must be one created with secmod_openuserdb().
...if configdir is not specified, and nocertdb and nokeydb is not specified, the load will fail.
...And 9 more matches
Property attributes
mxr id search for jsprop_enumerate jsprop_readonly the property's value cannot be set.
... mxr id search for jsprop_readonly jsprop_permanent the property cannot be deleted.
... the javascript language does not provide any way for a script to delete a permanent property.
...And 9 more matches
JSAPI reference
note: the foss wiki page contains a few links to other libraries and programs that can make life easier when using spidermonkey and the jsapi.
... a note on versioning: up until the release of firefox 4, spidermonkey, and thus the jsapi, was versioned in an ad-hoc way, with releases happening at times that roughly, but not really, corresponded to firefox releases.
...these macros must not be applied to values that are not known to be the right type.
...And 9 more matches
Gecko Roles
role_nothing used when the accessible item doesn't have a strongly defined role.
... role_alert represents an alert or a condition that a user should be notified about.
...users can navigate between panes and within the contents of the current pane, but cannot navigate between items in different panes.
...And 9 more matches
The Places database
any time a places component wants to reference a url, whether visited or not, it refers to this table.
...it contains the host url, frequency of access, if typed or not, and it's prefix (https://, ftp://, etc).
... annotation tables moz_anno_attributes: contains the names of all the annotations in the system and a name id.
...And 9 more matches
mozIStorageService
the database should not be open, or you should ensure that no database activity is happening when you call this method.
...if this is not specified, the backup is placed in the same directory as the original file.
...the specified file is created if it does not already exist.
...And 9 more matches
nsIAccessibleRole
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_alert 8 represents an alert or a condition that a user should be notified about.
...users can navigate between panes and within the contents of the current pane, but cannot navigate between items in different panes.
...And 9 more matches
nsIAppShellService
orsplashscreen); obsolete since gecko 1.8 void quit(in pruint32 aferocity); obsolete since gecko 1.8 void registertoplevelwindow(in nsixulwindow awindow); void run(); obsolete since gecko 1.8 void toplevelwindowismodal(in nsixulwindow awindow, in boolean amodal); obsolete since gecko 1.9.1 void unregistertoplevelwindow(in nsixulwindow awindow); note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindowinternal.
...if it was not, the default hidden window was used.
... note: size_to_content may be used for width or height.
...And 9 more matches
nsIContentPrefService2
a preference need not have a domain, and in that case the preference is called a "global" preference.
...in the latter case the api extracts the full domain from the url, so if you specify "http://foo.bar.example.com/baz", the domain is taken to be "foo.bar.example.com", not "example.com".
...prefobserver observer); void set(in astring domain, in astring name, in nsivariant value, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void setglobal(in astring name, in nsivariant value, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); methods addobserverforname() registers an observer that will be notified whenever a preference with the given name is set() or removed.
...And 9 more matches
nsICrashReporter
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void annotatecrashreport(in acstring key, in acstring data); void appendappnotestocrashreport(in acstring data); void appendobjcexceptioninfotoappnotes(in voidptr aexception); native code only!
... exceptions thrown ns_error_not_initialized if crash reporting is not initialized.
...ns_error_not_initialized if crash reporting is not initialized.
...And 9 more matches
nsIEditorSpellCheck
editor/idl/nsieditorspellcheck.idlnot scriptable provides spell checking commands for nsieditor instances.
... canspellcheck() determines whether or not spell checking can be enabled.
...checkcurrentdictionary() call this after any change in installed dictionaries to ensure that the spell checker is not using a current dictionary which is no longer available.
...And 9 more matches
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.
...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.
...And 9 more matches
nsIInstallLocation
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.
... astring getidforlocation(in nsifile file); nsifile getitemfile(in astring id, in astring path); nsifile getitemlocation(in astring id); nsifile getstagefile(in astring id); boolean itemismanagedindependently(in astring id); void removefile(in nsifile file); nsifile stagefile(in nsifile file, in astring id); attributes attribute type description canaccess boolean whether or not the user can write to the install location with the current access privileges.
... this is different from restricted because it's not whether or not the location *might* be restricted, it's whether or not it actually *is* restricted right now.
...And 9 more matches
nsIJSON
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) note: this interface may only be used from javascript code, with the exception of the legacydecodetojsval() method.
...to create an instance, use: var nativejson = components.classes["@mozilla.org/dom/json;1"] .createinstance(components.interfaces.nsijson); method overview note: the idl file has portions of the idl commented out because they represent things that can't actually be properly described by idl; however, for the purposes of this article, we'll pretend they can be and ignore that issue.
... note: this method is more flexible than it should be, and accepts some not-correctly-structured json.
...And 9 more matches
nsILoginManager
note: default values for the nsiloginmetainfo properties are created if the specified login doesn't explicitly specify them.
... note: this method is provided for use only by the formfillcontroller, which calls it directly.
... it should not be used for any other purpose.
...And 9 more matches
nsIPrintingPrompt
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.
... note: the windows version mozilla implements this service which is automatically built and registered for you.
... to fly your own dialog you may: implement this service to display at least the print dialog and a print progress dialog or you may implement just one of the dialogs and pass back ns_error_not_implemented for any of the others.
...And 9 more matches
nsIProcess
gecko 1.9.1 note this attribute is no longer implemented as of gecko 1.9.1, and is removed entirely in gecko 1.9.2.
...this value is only available after the process has started; in addition, some platforms may not offer this value at all.
... gecko 1.9.1 note this attribute is no longer implemented as of gecko 1.9.1, and is removed entirely in gecko 1.9.2.
...And 9 more matches
nsIProtocolProxyService
proxy auto config (pac) may perform a synchronous dns query, which may not return immediately.
...any additional bits that do not correspond to a resolve_ flag are reserved for future use.
... note: if pac is configured, and the pac file has not yet been loaded, then this method will return a nsiproxyinfo instance with a type of "unknown" to indicate to the consumer that asyncresolve should be used to wait for the pac file to finish loading.
...And 9 more matches
nsIScriptableIO
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes.
...the file does not have to exist already; this method simply creates the file reference which may then be passed to the newinputstream() or newoutputstream() method to open the file for reading or writing.
...And 9 more matches
nsISessionStore
the api operates on top-level browser.xul and navigator.xul windows; see note on windows for details.
... return value exceptions thrown ns_error_invalid_arg when aindex does not map to a closed window.
... note: the returned string does not include cookies.
...And 9 more matches
nsISocketTransportService
nsisockettransport createtransport(in array<acstring> asockettypes, in autf8string ahost, in long aport, in nsiproxyinfo aproxyinfo); void init(); obsolete since gecko 1.8 void notifywhencanattachsocket(in nsirunnable aevent); native code only!
... void shutdown(); obsolete since gecko 1.8 attributes attribute type description autodialenabled boolean controls whether or not the socket transport service should poke the autodialer on connection failure.
... this will fail with the error code ns_error_not_available if the maximum number of sockets is already reached.
...And 9 more matches
nsIWindowMediator
note this method is advisory only: it changes nothing either in windowmediator's internal state or with the window.
... note: it compares the nsixulwindow to nsiwidgets.
...they are expected to hand us comparison values which are pulled from general storage in the native widget, and may not correspond to an nsiwidget at all.
...And 9 more matches
nsIZipReader
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.
...if ] is to appear inside the brackets as a character to not match, it must be escaped.
... pat~pat2 returns matches to the pattern 'pat' which do not also match the pattern 'pat2'.
...And 9 more matches
Performance
the asynchronous writes discussed below removes most of the immediate penalty of a commit, so you will not notice the problem as much.
...sqlite> explain query plan select * from moz_historyvisit where session = 12; 0|0|table moz_historyvisit in this example, you can see that it is not using an index, so this query would be slow.
...as of april 10, 2006, mozilla uses sqlite 3.3.4, but the latest precompiled version of the command line tools is not available for all platforms.
...And 9 more matches
ctypes
cannot be set.
...cannot be set.
...these are declared as stdcall on windows, but do not have mangled names like those used by stdcall_abi above.
...And 9 more matches
about:debugging - Firefox Developer Tools
if it still doesn't appear, it may be because the link between your android device and your computer is not authorized yet.
... note: you do not need to install the full android studio sdk.
... note: if the version of firefox on your remote device is more than one major version older than the version running on your computer, you may see a message like the following: in firefox 76 and above, the message can look like the following: see connection for firefox for android 68 for more information.
...And 9 more matches
Document.cookie - Web APIs
WebAPIDocumentcookie
note that each key and value may be surrounded by whitespace (space and tab characters): in fact, rfc 6265 mandates a single space after each semicolon, but some user agents may not abide by this.
...note that you can only set/update a single cookie at a time using this method.
... consider also that: any of the following cookie attribute values can optionally follow the key-value pair, specifying the cookie to set/update, and preceded by a semi-colon separator: ;path=path (e.g., '/', '/mydir') if not specified, defaults to the current path of the current document location.
...And 9 more matches
Document.execCommand() - Web APIs
note: only returns true if part of a user interaction.
...this is not implemented in mozilla.
...note that internet explorer uses this to set the text background color.
...And 9 more matches
Element.querySelectorAll() - Web APIs
the element method queryselectorall() returns a static (not live) nodelist representing a list of elements matching the specified group of selectors which are descendants of the element on which the method was called.
... note: this method is implemented based on the parentnode mixin's queryselectorall() method.
...this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown.
...And 9 more matches
HTMLButtonElement - Web APIs
htmlbuttonelement.autofocus is a boolean indicating whether or not the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control.
... htmlbuttonelement.disabled is a boolean indicating whether or not the control is disabled, meaning that it does not accept any clicks.
... if the button is not a descendant of a form element, then the attribute can be the id of any form element in the same document it is related to, or the null value if none matches.
...And 9 more matches
HTMLMediaElement - Web APIs
note: automatically playing audio when the user doesn't expect or desire it is a poor user experience and should be avoided in most cases, though there are exceptions.
... htmlmediaelement.currenttime a double-precision floating-point value indicating the current playback time in seconds; if the media has not started to play and has not been seeked, this value is the media's initial playback time.
... htmlmediaelement.error read only returns a mediaerror object for the most recent error, or null if there has not been an error.
...And 9 more matches
HTMLTextAreaElement - Web APIs
disabled boolean: returns / sets the element's disabled attribute, indicating that the control is not available for interaction.
...if this element is not contained in a form element, it can be the id attribute of any <form> element in the same document or the value null.
... readonly boolean: returns / sets the element's readonly attribute, indicating that the user cannot modify the value of the control.
...And 9 more matches
IDBDatabaseException - Web APIs
constants note: do not rely on the numeric values of the constants, which might change as the specifications continue to change.
... constraint_err 4 a mutation operation in the transaction failed because a constraint was not satisfied.
... data_err 5 data provided to an operation does not meet requirements.
...And 9 more matches
IDBObjectStoreSync - Web APIs
constants mode constants constant value description read_only 1 modification operations are not allowed on this object store.
... snapshot_read 2 any read operations must access a snapshot view of the data, which cannot change once it is created.
... data_err if this object store uses out-of-line keys, and the key parameter was not passed.
...And 9 more matches
PannerNode - Web APIs
this is why these values are not marked read only, which is how they appear in the webidl.
... pannernode.maxdistance a double value representing the maximum distance between the audio source and the listener, after which the volume is not reduced any further.
...while this audioparam cannot be directly changed, its value can be altered using its value property.
...And 9 more matches
Using DTMF with WebRTC - Web APIs
note, however, that although it's possible to send dtmf using webrtc, there is currently no way to detect or receive incoming dtmf.
... webrtc currently ignores these payloads; this is because webrtc's dtmf support is primarily intended for use with legacy telephone services that rely on dtmf tones to perform tasks such as: teleconferencing systems menu systems voicemail systems entry of credit card or other payment information passcode entry note: while the dtmf is not sent to the remote peer as audio, browsers may choose to play the corresponding tone to the local user as part of their user experience, since users are typically used to hearing their phone play the tones audibly.
... note: this example is obviously somewhat contrived, since normally the two rtcpeerconnection objects would exist on different devices, and signaling would be done over the network instead of it all being simply linked up inline as it is here.
...And 9 more matches
Privileged features - Web APIs
this is not for web content.
...on windows platforms, a dependent window does not show on the task bar.
... dependent windows are not implemented on macos x, this option will be ignored.
...And 9 more matches
Window.prompt() - Web APIs
WebAPIWindowprompt
can be omitted if there is nothing to show in the prompt window.
...note that in internet explorer 7 and 8, if you do not provide this parameter, the string "undefined" is the default value.
... the above prompt appears as follows (in chrome on os x): notes a prompt dialog contains a single-line textbox, a cancel button, and an ok button, and returns the (possibly empty) text the user entered into that textbox.
...And 9 more matches
Using the alert role - Accessibility
when this role is added to an element, the browser will send out an accessible alert event to assistive technology products which can then notify the user about it.
... the alert role is most useful for information that requires the user's immediate attention, for example: an invalid value was entered into a form field the user's login session is about to expire the connection to the server was lost, local changes will not be saved because of its intrusive nature, the alert role must be used sparingly and only in situations where the user's immediate attention is required.
... 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.
...And 9 more matches
ARIA: textbox role - Accessibility
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.
... none (default): predicted text is not offered.
...aria does not alter the behavior of the element; rather this feature must be controlled by the developer.
...And 9 more matches
Understandable - Accessibility
note: to read the w3c definitions for understandable and its guidelines and success criteria, see principle 3: understandable — information and the operation of user interface must be understandable.
...however, the title contents are not accessible via keyboard, nor are they reliably read out by screenreaders.
...it is better to just write all content at lower secondary level, even technical documentation like programming tutorials, unless there is a good reason not to (e.g.
...And 9 more matches
@supports - CSS: Cascading Style Sheets
WebCSS@supports
@supports (display: grid) { div { display: grid; } } @supports not (display: grid) { div { float: right; } } in javascript, @supports can be accessed via the css object model interface csssupportsrule.
...the supports condition consists of one or more name-value pairs combined by conjunctions (and), disjunctions (or), and/or negations (not).
...the following example returns true if the browser supports the child combinator: @supports selector(a > b) {} the not operator the not operator can precede any expression to create a new expression, resulting in the negation of the original one.
...And 9 more matches
Box-shadow generator - CSS: Cascading Style Sheets
ction(e) { setvalue(topic, e.target.value | 0); }); subscribe(topic, function(value) { node.children[0].value = value; }); } var increment = function increment(topic) { var slider = sliders[topic]; if (slider === null || slider === undefined) return; if (slider.value + slider.step <= slider.max) { slider.value += slider.step; setvalue(slider.topic, slider.value) notify.call(slider); } }; var decrement = function decrement(topic) { var slider = sliders[topic]; if (slider === null || slider === undefined) return; if (slider.value - slider.step >= slider.min) { slider.value -= slider.step; setvalue(topic, slider.value) notify.call(slider); } } // this = slider object var updateslider = function updateslider(e) { var node = this.n...
... = 0; if (pos > width) pos = width; var value = pos * delta / width | 0; var precision = value % this.step; value = value - precision + this.min; if (precision > this.step / 2) value = value + this.step; if (this.snap) pos = (value - this.min) * width / delta; this.pointer.style.left = pos - offset/2 + "px"; this.value = value; node.setattribute('data-value', value); notify.call(this); } var setvalue = function setvalue(topic, value) { var slider = sliders[topic]; if (value > slider.max || value < slider.min) return; var delta = slider.max - slider.min; var width = slider.node.clientwidth; var offset = slider.pointer.clientwidth; var pos = (value - slider.min) * width / delta; slider.value = value; slider.pointer.style.left = pos - offset...
... / 2 + "px"; slider.node.setattribute('data-value', value); notify.call(slider); } var setmousetracking = function setmousetracking(elem, callback) { elem.addeventlistener("mousedown", function(e) { callback(e); document.addeventlistener("mousemove", callback); }); document.addeventlistener("mouseup", function(e) { document.removeeventlistener("mousemove", callback); }); } var subscribe = function subscribe(topic, callback) { if (subscribers[topic] === undefined) subscribers[topic] = []; subscribers[topic].push(callback); } var unsubscribe = function unsubscribe(topic, callback) { subscribers[topic].indexof(callback); subscribers[topic].splice(index, 1); } var notify = function notify() { if (subscribers[this.topic] === undefined) return; f...
...And 9 more matches
Color picker tool - CSS: Cascading Style Sheets
color.sethsv(h, s, v); color.a = a; return color; } function hslcolor(h, s, l) { var color = new color(); color.sethsl(h, s, l); return color; } function hslacolor(h, s, l, a) { var color = new color(); color.sethsl(h, s, l); color.a = a; return color; } color.prototype.copy = function copy(obj) { if(obj instanceof color !== true) { console.log('typeof parameter not color'); return; } this.r = obj.r; this.g = obj.g; this.b = obj.b; this.a = obj.a; this.hue = obj.hue; this.saturation = obj.saturation; this.value = obj.value; this.format = '' + obj.format; this.lightness = obj.lightness; }; color.prototype.setformat = function setformat(format) { if (format === 'hsv') this.format = 'hsv'; if (format === 'hsl') this.format =...
...turation = x * 100 / size | 0; if (this.picker_mode === 'hsv') this.color.sethsv(this.color.hue, saturation, value); if (this.picker_mode === 'hsl') this.color.sethsl(this.color.hue, saturation, value); this.color_picker.style.left = x - picker_offset + 'px'; this.color_picker.style.top = y - picker_offset + 'px'; this.updatealphagradient(); this.updatepreviewcolor(); this.notify('value', value); this.notify('lightness', value); this.notify('saturation', saturation); this.notify('red', this.color.r); this.notify('green', this.color.g); this.notify('blue', this.color.b); this.notify('hexa', this.color.gethexa()); notify(this.topic, this.color); }; colorpicker.prototype.updatehueslider = function updatehueslider(e) { var x = e.pagex - this.hue_area.o...
...osition(this.hue_picker, x); this.sethue(hue); }; colorpicker.prototype.updatealphaslider = function updatealphaslider(e) { var x = e.pagex - this.alpha_area.offsetleft; var width = this.alpha_area.clientwidth; if (x < 0) x = 0; if (x > width) x = width; this.color.a = (x / width).tofixed(2); this.updatesliderposition(this.alpha_picker, x); this.updatepreviewcolor(); this.notify('alpha', this.color.a); notify(this.topic, this.color); }; colorpicker.prototype.sethue = function sethue(value) { this.color.sethue(value); this.updatepickerbackground(); this.updatealphagradient(); this.updatepreviewcolor(); this.notify('red', this.color.r); this.notify('green', this.color.g); this.notify('blue', this.color.b); this.notify('hexa', this.color.gethexa())...
...And 9 more matches
CSS Containment - CSS: Cascading Style Sheets
<h1>my blog</h1> <article> <h2>heading of a nice article</h2> <p>content here.</p> </article> <article> <h2>another heading of another article</h2> <p>more content here.</p> </article> each article has the contain property with a value of content applied in the css.
...for example, it might not render articles that are outside the viewable area.
... if we give each <article> the contain property with a value of content, when new elements are inserted the browser understands it does not need to relayout or repaint any area outside of the containing element's subtree, although if the <article> is styled such that its size depends on its contents (e.g.
...And 9 more matches
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
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.
...the idea was not to use the experimental implementations in production code.
... status in browsers browser support for flexbox is excellent, and the majority of browsers do not need a prefix at this point.
...And 9 more matches
Typical use cases of Flexbox - CSS: Cascading Style Sheets
in this guide we will take a look at some of the common use cases for flexbox — those places where it makes more sense than another layout method.
... in a perfect world of browser support, the reason you'd choose to use flexbox is because you want to lay a collection of items out in one direction or another.
...in this case we would use the flex properties to allow items to grow and shrink in proportion to one another as described in controlling ratios of flex items along the main axis.
...And 9 more matches
Basic Concepts of grid layout - CSS: Cascading Style Sheets
grid also contains an algorithm to control the placement of items not given an explicit position on the grid.
... .wrapper { display: grid; grid-template-columns: 500px 1fr 2fr; } track listings with repeat() notation large grids with many tracks can use the repeat() notation, to repeat all or a section of the track listing.
... for example the grid definition: .wrapper { display: grid; grid-template-columns: 1fr 1fr 1fr; } can also be written as: .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); } repeat notation can be used for a part of the track listing.
...And 9 more matches
border-radius - CSS: Cascading Style Sheets
the border-radius property does not apply to table elements when border-collapse is collapse.
... note: as with any shorthand property, individual sub-properties cannot inherit, such as in border-radius:0 0 inherit inherit, which would partially override existing definitions.
... values radius is a <length> or a <percentage> denoting a radius to use for the border in each corner of the border.
...And 9 more matches
clip-path - CSS: Cascading Style Sheets
WebCSSclip-path
note: a computed value other than none results in the creation of a new stacking context the same way that css opacity does for values other than 1.
...> = nonzero | evenodd<box> = border-box | padding-box | content-box examples comparison of html and svg <svg class="defs"> <defs> <clippath id="mypath" clippathunits="objectboundingbox"> <path d="m0.5,1 c0.5,1,0,0.7,0,0.3 a0.25,0.25,1,1,1,0.5,0.3 a0.25,0.25,1,1,1,1,0.3 c1,0.7,0.5,1,0.5,1 z" /> </clippath> </defs> </svg> <div class="grid"> <div class="col"> <div class="note">clip-path: none</div> <div class="row"> <div class="cell"> <span>html</span> <div class="container"> <p class="none"> i love<br><em>clipping</em> </p> </div> </div> <div class="cell"> <span>svg</span> <div class="container viewbox"> <svg viewbox="0 0 192 192"> <g class="none"> <rect...
... x="24" y="24" width="144" height="144" /> <text x="96" y="91">i love</text> <text x="96" y="109" class="em">clipping</text> </g> </svg> </div> </div> </div> <div class="note">clip-path: url(#mypath)<br><br> assuming the following clippath definition: <pre> &lt;svg&gt; &lt;clippath id="mypath" clippathunits="objectboundingbox"&gt; &lt;path d="m0.5,1 c 0.5,1,0,0.7,0,0.3 a 0.25,0.25,1,1,1,0.5,0.3 a 0.25,0.25,1,1,1,1,0.3 c 1,0.7,0.5,1,0.5,1 z" /&gt; &lt;/clippath&gt; &lt;/svg&gt;</pre> </div> <div class="row"> <div class="cell"> <span>html</span> <div class="container"> <p class="svg"> i love<br><em>clipping</em> </p> <...
...And 9 more matches
min-width - CSS: Cascading Style Sheets
WebCSSmin-width
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmin-widthchrome full support 1edge full support 12firefox full support 1notes full support 1notes notes css 2.1 leaves the behavior of min-width with table undefined.
... firefox supports applying min-width to table elements.ie full support 7opera full support 4notes full support 4notes notes css 2.1 leaves the behavior of min-width with table undefined.
... opera supports applying min-width to table elements.safari full support 1webview android full support 4.4chrome android full support 18firefox android full support 4notes full support 4notes notes css 2.1 leaves the behavior of min-width with table undefined.
...And 9 more matches
Live streaming web audio and video - Developer guides
the idea is that the data transfer rate is monitored and if it looks like it's not keeping up, we drop down to a lower bandwidth (and consequently lower quality) stream.
... streaming audio and video on demand streaming technology is not used exclusively for live streams.
...this is not yet supported natively in most browsers, but be aware that firefox os 1.3 supports rtsp.
...And 9 more matches
disabled - HTML: Hypertext Markup Language
the boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form.
...if the disabled attribute is specified on a form control, the element and its form control descendants do not participate in constraint validation.
... this boolean disabled attribute indicates that the user cannot interact with the control or it's descendant controls.
...And 9 more matches
<a>: The Anchor element - HTML: Hypertext Markup Language
WebHTMLElementa
notes: download only works for same-origin urls, or the blob: and data: schemes.
...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.
... note: when using target, add rel="noreferrer noopener" to avoid exploitation of the window.opener api; note: in newer browser versions (e.g.
...And 9 more matches
Set-Cookie - HTTP
it also must not contain a separator character like the following: ( ) < > @ , ; : \ " / [ ] ?
...encoding: many implementations perform url encoding on cookie values, however it is not required per the rfc specification.
... __host- prefix: cookies with names starting with __host- must be set with the secure flag, must be from a secure page (https), must not have a domain specified (and therefore aren't sent to subdomains) and the path must be /.
...And 9 more matches
Introduction - JavaScript
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.
...the javascript language resembles java but does not have java's static typing and strong type checking.
...you do not have to declare all variables, classes, and methods.
...And 9 more matches
RegExp() constructor - JavaScript
syntax literal, constructor, and factory notations are possible: /pattern/flags new regexp(pattern[, flags]) regexp(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).
... if flags is not specified and a regular expressions object is supplied, that object's flags (and lastindex value) will be copied over.
...And 9 more matches
WeakRef - JavaScript
a weakref object lets you hold a weak reference to another object, without preventing that object from getting garbage-collected.
...a weak reference to an object is a reference that does not prevent the object from being reclaimed by the garbage collector.
... note: please see the avoid where possible section below.
...And 9 more matches
eval() - JavaScript
do not call eval() to evaluate an arithmetic expression; javascript evaluates arithmetic expressions automatically.
... if the argument of eval() is not a string, eval() returns the argument unchanged.
... function test() { var x = 2, y = 4; console.log(eval('x + y')); // direct call, uses local scope, result is 6 var geval = eval; // equivalent to calling eval in the global scope console.log(geval('x + y')); // indirect call, uses global scope, throws referenceerror because `x` is undefined (0, eval)('x + y'); // another example of indirect call } never use eval()!
...And 9 more matches
<semantics> - MathML
the mathml elements <semantics>, <annotation> and <annotation-xml> are used to combine presentation and content markup and to provide both, layout information and semantic meaning of mathematical expressions.
... the <semantics> element acts as a container element associating annotations and must have child elements (it will raise an invalid markup error 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.
...And 9 more matches
Add to Home screen - Progressive web apps (PWAs)
(note: in android 8 and higher, a system-level "add to home screen" permission dialog will be shown first.) if you have mobile chrome available, the experience is slightly different; upon loading our site, you'll see an install banner pop up asking whether you want to add this app to your home 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.
...And 9 more matches
fill - SVG: Scalable Vector Graphics
WebSVGAttributefill
value <paint> default value black animatable yes note: as a presentation attribute fill can be used as a css property.
... value <paint> default value black animatable yes note: as a presentation attribute fill can be used as a css property.
... value <paint> default value black animatable yes note: as a presentation attribute fill can be used as a css property.
...And 9 more matches
Paths - SVG: Scalable Vector Graphics
WebSVGTutorialPaths
while creating complex paths using an xml editor or text editor is not recommended, understanding how they work will allow to identify and repair display issues in svgs.
...note, though, that it wouldn't show up if a path was just drawn normally.
...it is often placed at the end of a path node, although not always.
...And 9 more matches
panel - Archive of obsolete content
your add-on can receive notifications when a panel is shown or hidden by listening to its show and hide events.
... getting user input note: this example uses the action button api, which is only available from firefox 29 onwards.
... scripting trusted panel content note: this example uses the action button api, which is only available from firefox 29 onwards.
...And 8 more matches
widget - Archive of obsolete content
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.
...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", label: "clock", contenturl: data.url("history.png") }); widget.panel = clockpanel; // will not be anchored widget.panel.show(); also, if you try to call panel.show() inside your widget's click event listener, the panel will not be anchored: 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, onclick: function() { // will not be anchored this.panel.show(); } }); see bug 638142.
...And 8 more matches
core/promise - Archive of obsolete content
promises consider another approach, instead of continuation via callbacks, a function returns an object that represents a eventual result, either successful or failed.
...if the promise is rejected and the rejection is not explicitly observed, any derived promises will be implicitly rejected for the same reason.
... // extract sql query then(readdbasync); // exectue extracted query against db nested chaining flat chaining is not always an option though, as in some cases you may want to capture intermediate values of the chain: var result = readasync(url).then(function(source) { var json = parse(source); return readdbasync(extractquery(json)).then(function(data) { return writeasync(json.url, data); }); }); in general, nesting is useful for computing values from more than one promise: function eventualadd(a, b...
...And 8 more matches
test/assert - Archive of obsolete content
this function is only called by the unit test framework, and not by unit tests themselves.
... notequal(actual, expected, message) tests that two objects are not equal, using !=: assert.notequal(1, 2, "test that one is not two"); parameters actual : object the actual result.
... other pairs that do not both pass typeof value == "object", equivalence is determined by ==.
...And 8 more matches
ui/button/toggle - Archive of obsolete content
when a button is checked it gets a "pressed" look in the user interface (note that the "pressed" look currently does not work in mac os x).
...a disabled button will not generate click or change events and its icon will appear disabled: updating state you can update all the button's properties, except for its id.
... the checked property is not only updated directly by assignment, but is also updated when the user clicks the button (or when some code calls button.click()).
...And 8 more matches
XPCOM Objects - Archive of obsolete content
another useful resource is this xpcom reference.
...it is particularly important to note that, for every member in the component, you'll see in what interface this member is defined.
... at mdc, you'll see stuff like this: void setcharpref(in string aprefname, in string avalue); one of the most important details to notice is that both paratemers have the in keyword.
...And 8 more matches
Security best practices in extensions - Archive of obsolete content
some items mentioned are strict guidelines, meaning that if you don't follow them then your add-on will not be approved on mozilla add-ons.
... web content handling in general the best way to ensure that the browser is not compromised when you load content is to make sure it does not have those privileges.
...there are ways to get around the content/chrome security barrier, if for example, you want a web page to send a notification to the add-on (or vice versa).
...And 8 more matches
Signing an XPI - Archive of obsolete content
note: these instructions are outdated.
... for an extension to work in firefox it must be signed by mozilla, not by yourself.
... note: these instructions are for how to test with a self-signed certificate.
...And 8 more matches
Repackaging Firefox - Archive of obsolete content
notice: the article is about repackaging firefox 2.0 and is obsolete when working on 3.x repackaging.
... while the aim of this article is not to fully document how to make an extension (for that, try this section of the mozilla developer center), here is a basic tutorial to get you started, and some tips specific for creating a dex.
...you should not need to edit this file.
...And 8 more matches
Microsummary XML grammar reference - Archive of obsolete content
note: although the <template> element must be in the microsummaries namespace (http://www.mozilla.org/microsummaries/0.1), its <stylesheet>/<transform> child element must be in the xslt namespace (http://www.w3.org/1999/xsl/transform).
... <exclude> (optional) a regular expression matching the urls of pages that the generator is not able to summarize.
...it must not contain any other elements, and it does not have any attributes.
...And 8 more matches
XML in Mozilla - Archive of obsolete content
dtds and other external entities mozilla does not load external entities from the web.
...another exception is an entity whose system identifier is a relative path, and the xml declaration states that the document is not standalone (default), in which case mozilla will try to look for the entity under <bin>/res/dtd directory.
...other notes a lot of the document object model (dom, w3c recommendations and drafts) applies to xml.
...And 8 more matches
Learn XPI Installer Scripting by Example - Archive of obsolete content
first, a quick scan of the contents of the xpi file (which you can open using with any unzip utility) reveals the following high-level directory structure: install.js bin\ chrome\ components defaults\ icons\ plugins\ res\ note that this high-level structure parallels the directory structure of the installed browser very closely: as you will see in the installation script, the contents of the archive are installed onto the file system in much the same way that they are stored in the archive itself, though it's possible to rearrange things arbitrarily upon installation--to create new directories, to install files in ...
...if you choose not to register the installed software or do the verifications at the front end of the installation, then at a minimum, the install scripts mustinitialize, add the files to be installed, and execute.
... note also that when you call methods on the install--as you do so often in installation scripts (getfolder, initinstall, addfile, and performinstall are all examples of common install object methods)--the install object is implicit; like the window object in regular web page scripts, the install object does not need to be prefixed to the method.
...And 8 more matches
A XUL Bestiary - Archive of obsolete content
this xulnote presents some of the key concepts and terms in the xul development environment.
... the purpose of this article is not to describe these items in any great detail but to define what they are in simple terms.
...note that when no file name is specified after the chrome directory path, a file name with the same name as the package is assumed.
...And 8 more matches
Special Condition Tests - Archive of obsolete content
note the parent attribute on the rule element, set to the value vbox.
...this does not match the first rule, so the content from the second rule is generated instead.
...if this is not the case, you will still need to use other types of conditions to handle this case.
...And 8 more matches
Advanced Rules - Archive of obsolete content
full rules contain three child tags, a conditions tag, a bindings tag and an action tag, although the bindings tag is not always needed.
...if the conditions do not match, no content is generated.
...the predicate would normally include the namespace, and the subject would be the bookmark's resource id, not the bookmark's title as used here.
...And 8 more matches
Keyboard Shortcuts - Archive of obsolete content
although shortcuts such as this might not always be valid, they will usually work any time the window is open.
...the key attribute (note that it has the same name as the element itself) can be used to indicate which key should be pressed, in this case r.
...any key elements outside of a keyset element will not work.
...And 8 more matches
Modifying a XUL Interface - Archive of obsolete content
notice that this is not the same as a vbox or an hbox.
...the function getelementbyid() does not know that the box it is looking for happens to be containing the tag that has the oncommand attribute that referenced it.
...note this button is not visible, nor is it attached to anything yet.
...And 8 more matches
Splitters - Archive of obsolete content
you can also hide the sidebar by clicking the notch.
... collapse this indicates which side of the panel should collapse when the splitter notch (or grippy) is clicked or set into a collapsed state.
...if you set this to none, which is also the default, the splitter grippy does not collapse when clicked.
...And 8 more matches
Tree View Details - Archive of obsolete content
in addition to the getlevel method, there is a hasnextsibling function which, given a row, should return true if there is another row afterwards at the same level.
... note that the tree will call neither iscontainerempty nor iscontaineropen for rows that are not containers as indicated by the return value of the iscontainer method.
...empty containers will not have a twisty, but will still be treated like a container.
...And 8 more matches
browser - Archive of obsolete content
it does not have any correlation with the user's browser homepage; instead it is a convenient property to hold a home page.
... showcaret type: boolean whether or not to cause a typing caret to be visible in the content area.
...if this is not set, the loaded document has the same access as the window containing the browser.
...And 8 more matches
listitem - Archive of obsolete content
checked type: boolean indicates whether the element is checked or not.
... none the text will be not be cropped using an ellipsis.
... disabled type: boolean indicates whether the element is disabled or not.
...And 8 more matches
menupopup - Archive of obsolete content
note that a context menu will never respect this attribute, always appearing relative to the mouse cursor.
... state type: string this read only property indicates whether the popup is open or not.
... four values are possible: closed: the popup is closed and not visible.
...And 8 more matches
menuseparator - Archive of obsolete content
this attribute does not apply to menus directly on the menubar.
... none the text will be not be cropped using an ellipsis.
...for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
...And 8 more matches
radio - Archive of obsolete content
ArchiveMozillaXULradio
none the text will be not be cropped using an ellipsis.
...for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
...And 8 more matches
richlistitem - Archive of obsolete content
attributes disabled, searchlabel, selected, tabindex, value properties accessible, control, disabled, label, selected, tabindex, value examples (example needed) attributes disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
... in the case of form elements, it will not be submitted.
...And 8 more matches
calICalendarView - Archive of obsolete content
it should be noted, however, that the methods and attributes implemented by a calicalendarview need not behave in any predictable fashion.
...notice that a calicalendarview does not contain any additem or refresh methods.
... therefore, it makes sense for an implementation of calicalendarview to add a caliobserver to the its displaycalendar in order to be notified of additions, modifications, and deletions of items it may be displaying.
...And 8 more matches
Index - Game development
the concern is mostly with switching to another option.
... fortunately, i do not have any experience with this, but i have heard it is an excruciating game of whack-a-mole.
...any gap means a collision does not exist.
...And 8 more matches
Bounding volume collision detection with THREE.js - Game development
var knot = new three.mesh( new three.torusknotgeometry(0.5, 0.1), new meshnormalmaterial({})); knot.geometry.computeboundingbox(); var knotbbox = new box3( knot.geometry.boundingbox.min, knot.geometry.boundingbox.max); note: the boundingbox property takes the geometry itself as reference, and not the mesh.
... var knot = new three.mesh( new three.torusknotgeometry(0.5, 0.1), new meshnormalmaterial({})); var knotbbox = new box3(new three.vector3(), new three.vector3()); knotbbox.setfromobject(knot); instantiating spheres instantiating sphere objects is similar.
... var knot = new three.mesh( new three.torusknotgeometry(0.5, 0.1), new meshnormalmaterial({})); var knotbsphere = new sphere( knot.position, knot.geometry.boundingsphere.radius); unfortunately, there is no equivalent of box3.setfromobject for sphere instances.
...And 8 more matches
Primitive - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, a primitive (primitive value, primitive data type) is data that is not an object and has no methods.
... all primitives are immutable, i.e., they cannot be altered.
... it is important not to confuse a primitive itself with a variable assigned a primitive value.
...And 8 more matches
Images, media, and form elements - Learn web development
this means that css cannot affect the internal layout of these elements — only their position on the page amongst other elements.
...this will enable the image to become smaller in size than the box but not larger.
...this will result in "letterboxing" if it is not the same aspect ratio as the box.
...And 8 more matches
Other form controls - Learn web development
note that even though you can put anything inside a <textarea> element (including other html elements, css, and javascript), because of its nature, it is all rendered as if it was plain text content.
... note: you can find a slightly more interesting example of text area usage in the example we put together in the first article of the series (see the source code also).
...the values are soft (the default value), which means the text submitted is not wrapped but the text rendered by the browser is wrapped; hard (the cols attribute must be specified when using this value), which means both the submitted and rendered texts are wrapped, and off, which stops wrapping.
...And 8 more matches
Your first form - Learn web development
forms allow users to enter data, which is generally sent to a web server for processing and storage (see sending form data later in the module), or used on the client-side to immediately update the interface in some way (for example, add another item to a list, or show or hide a ui feature).
... note: we'll look at how those attributes work in our sending form data article later on.
... the <label>, <input>, and <textarea> elements our contact form is not complex: the data entry portion contains three text fields, each with a corresponding <label>: the input field for the name is a single-line text field.
...And 8 more matches
General asynchronous programming concepts - Learn web development
if a function relies on the result of another function, it has to wait for the other function to finish and return, and until that happens, the entire program is essentially stopped from the perspective of the user.
...there's no sense sitting there waiting for something when you could let the other task chug along on another processor core and let you know when it's done.
...on'); btn.addeventlistener('click', () => { let mydate; for(let i = 0; i < 10000000; i++) { let date = new date(); mydate = date } console.log(mydate); let pelem = document.createelement('p'); pelem.textcontent = 'this is a newly-added paragraph.'; document.body.appendchild(pelem); }); when running the example, open your javascript console then click the button — you'll notice that the paragraph does not appear until after the dates have finished being calculated and the console message has been logged.
...And 8 more matches
Starting our Svelte Todo list app - Learn web development
objective: to learn how to create a svelte component, render it inside another component, pass data into it using props, and save its state.
... note: you can put your components anywhere inside the src folder, but the components folder is a recognized convention to follow, allowing you to find your components easily.
...est of the tutorial</span> </button> </div> </div> </li> </ul> <hr /> <!-- moreactions --> <div class="btn-group"> <button type="button" class="btn btn__primary">check all</button> <button type="button" class="btn btn__primary">remove completed</button> </div> </div> check the rendered out again, and you'll see something like this: it's current not very nicely styled, and also functionally useless.
...And 8 more matches
Debugging on Windows
firefox, in general, and even in non-e10s mode, does not start the main process directly, it starts it via a launcher process.
... this means that visual studio will only attach to the first process it finds, and will not hit any break-point (and even notifies you that it cannot find their location).
... setting breakpoints in dlls which are not yet loaded in memory vc++ 6.0: go to project > settings..., debug tab and select "additional dlls" from the drop down list.
...And 8 more matches
HTTP logging
note: the web console also offers the ability to peek at http transactions within firefox.
...go to the web site that is broken for you and make the bug happen in the browser) make a note of the value of "current log file".
... other bugs may require all the logs to be uploaded--ask the developer if you're not sure.
...And 8 more matches
Simple Thunderbird build
windows build prerequisites gnu/linux build prerequisites macos build prerequisites mapi headers on windows: check that the mapi header files from https://www.microsoft.com/en-us/download/details.aspx?id=12905 are installed because the mapi header files (except mapi.h) are not bundled with visual studio 2017 (windows sdk 10).
...note that the downloaded outlook 2010 mapi header files contain 18 fies, of which only 17 are needed.
... do not copy mapi.h, it is already in c:\program files (x86)\windows kits\10\include\10.0.17134.0\um\mapi.h.
...And 8 more matches
Frame script loading and lifetime
the script just writes "foo" to the command line: // chrome script var mm = gbrowser.selectedbrowser.messagemanager; mm.loadframescript('data:,dump("foo\\n")', true); loadframescript() takes two mandatory parameters: a url that points to the frame script you want to load a boolean flag, allowdelayedload note: if the message manager is a global frame message manager or a window message manager, loadframescript() may load the script multiple times, once in each applicable frame.
...passing allowdelayedload is a way to ensure that the script is loaded correctly, in case the tab is not ready when making the call.
...note that this function will not remove any scripts which have been loaded earlier.
...And 8 more matches
Performance
all their overhead is thus not just incurred by active tabs but by the total number of tabs in a session.
... but care must be taken to not leak references to the frame script global when it is passed into a jsm.
...not only does that increase memory footprint but the deserialization also has to be executed seperately for each tab, thus requiring more cpu time.
...And 8 more matches
HTML parser threading
it also has another lazily initialized tokenizer/tree builder for speculatively scanning the tail of document.write() data when the parser blocks without parsing the document.write() data to completion.
...if the parser is not script-created, nshtml5parser::markasnotscriptcreated() is called to create an nshtml5streamparser for the nshtml5parser.
...at that point, nothing has happened on the parser thread yet and the nshtml5streamparser lives fully on the main thread.
...And 8 more matches
Implementing Download Resuming
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.
...this can also be used to check whether the download is resumable: if it is not (e.g.
... the server is not using http 1.1), then accessing this attribute will throw an ns_error_not_resumable exception.
...And 8 more matches
AddonManager
if an error occurred (such as an add-on not being found), null is passed back instead.
... error_incorrect_hash the downloaded file did not match the expected hash.
... update_status_unknown_format the update was not in any known format.
...And 8 more matches
Assert.jsm
method overview undefined ok(value, message); undefined equal(actual, expected, message); undefined notequal(actual, expected, message); undefined deepequal(actual, expected, message); undefined notdeepequal(actual, expected, message); undefined strictequal(actual, expected, message); undefined notstrictequal(actual, expected, message); undefined throws(block, expected, message); promise rejects(promise, expected, message); undefined gr...
... ok, equal, notequal, deepequal, notdeepequal, strictequal, notstrictequal, throws, setreporter, report methods ok() pure assertion tests whether a value is truthy, as determined by !!guard.
... undefined equal( actual, expected, message ); parameters actual test subject to be evaluated as equivalent to expected expected test reference to evaluate against actual message short explanation of the expected result notequal() the non-equality assertion tests for whether two objects are not equal with !=.
...And 8 more matches
DeferredTask.jsm
firefox 28 note interface was changed in firefox 28, and old methods were removed.
... void arm(); disarm cancel any request for a delayed execution of the task, though the task itself cannot be canceled in case it is already running.
... if the task is running and the timer is not armed, the returned promise will be resolved when the current execution terminates.
...And 8 more matches
Dict.jsm
avascript scope: components.utils.import("resource://gre/modules/dict.jsm"); creating a dictionary you can create a new, empty dictionary by simply calling the dict() constructor: var newdict = new dict(); if you wish, you may also pass in an object literal of key/value pairs with which to initialize the dictionary: var someobj = {}; var newdict = new dict({key1: "foo", key2: someobj}); note that values may be any javascript object type.
... note: you can actually specify non-strings as keys; these are converted to strings before being used, so they're documented here as if they were a string parameter.
... in firefox 19 and above, you may also pass a json string to initialize the dictionary: var somejson = '{key1: "foo", key2: {}}'; var newdict = new dict(somejson); note: any string you pass will be assumed to be json.
...And 8 more matches
Deferred
starting from gecko 30, this object is obsolete and should not be used anymore.
...if the associated promise has already been resolved, either to a value, a rejection, or another promise, this method does nothing.
... note: this function is bound to its associated promise when promise.defer() is called, and can be called with any value of this.
...And 8 more matches
Mozilla Content Localized in Your Language
note: if this doens't apply, how is expressed in your language to indicate importance or name of a movie, book title, product uis (save, file...).
...note: if this doens't apply, indicate so with n/a.
...note: if this doens't apply, indicate so with n/a.
...And 8 more matches
Localizing with Koala
note that you don't have to edit the location field, it automatically fills in when you check the "mercurial" checkbox: "c:\mozilla\l10n\application\firefox\3.6".
...if you're starting a new localization, you may not have a remote repository set up yet.
...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.
...And 8 more matches
QA phase
after all of your hard work localizing we're sure that you not only want to see your work but you want to make sure it's accurate!
...since such is the case, this part of the guide may not be entirely applicable to you.
... in order to see your work on firefox (or another mozilla application), you'll need to have a built language pack to install on your local instance.
...And 8 more matches
Mozilla Quirks Mode Behavior
add padding if the very first node in an li is another ul or ol (bug 98636).
... obsolete since gecko 50 list bullets do not inherit the font size of the list (bug 97351).
... map acts like an inline, not a block.
...And 8 more matches
JS::PerfMeasurement
note: at present, js::perfmeasurement 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.
... 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.
...structions .instructions total instructions executed ::cache_references .cache_references total number of memory accesses ::cache_misses .cache_misses memory accesses that missed the cache ::branch_instructions .branch_instructions branch instructions executed ::branch_misses .branch_misses branch instructions that were not predicted correctly ::bus_cycles .bus_cycles total memory bus cycles ::page_faults .page_faults total page-fault exceptions fielded by the os ::major_page_faults .major_page_faults page faults that required disk access ::context_switches .context_switches context switches involving the profiled thread ::c...
...And 8 more matches
NSPR Contributor Guide
some of these reasons are not obvious to an outside observer.
...this means that the behavior of an existing public api item in nspr cannot change.
...please do not contribute java, c or other language wrappers.
...And 8 more matches
NSPR's Position On Abrupt Thread Termination
threads are not processes.
...this practice does not extend to threads.
...threads are lightweight because they do not maintain the full protection domain provided by a process.
...And 8 more matches
Enc Dec MAC Output Public Key as CSR
if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/.
... * fixme: samples should determine the version of nss that's available and refuse * to run if not 3.13 or higher.
...%-21s specify subject\n\n", "-s "); fprintf(stderr, "%-21s specify certficate request file name\n\n", "-r "); fprintf(stderr, "%-21s specify an input file name\n\n", "-i "); fprintf(stderr, "%-21s specify an output file name\n\n", "-o "); fprintf(stderr, "%-7s for encrypt, it takes as an input file and produces\n", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final output file.\n\n", ""); exit(-1); } /* map option letter enumerated commad type */ static commandtype option2command(const c...
...And 8 more matches
Encrypt Decrypt_MAC_Using Token
if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/.
...ssword file [optional]\n\n", "-f "); fprintf(stderr, "%-20s specify noise file name [optional]\n\n", "-z "); fprintf(stderr, "%-21s specify an input file name\n\n", "-i "); fprintf(stderr, "%-21s specify an output file name\n\n", "-o "); fprintf(stderr, "%-7s for encrypt, it takes as an input file and produces\n", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final output file.\n\n", ""); exit(-1); } /* * gather a cka_id.
... */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key.
...And 8 more matches
NSS Sample Code Sample_3_Basic Encryption and MACing
fprintf(stderr, "%-20s specify noise file name [optional]\n\n", "-z <noisefilename>"); fprintf(stderr, "%-21s specify an input file name\n\n", "-i <ipfilename>"); fprintf(stderr, "%-21s specify an output file name\n\n", "-o <opfilename>"); fprintf(stderr, "%-7s for encrypt, it takes <ipfilename> as an input file and produces\n", "note :"); fprintf(stderr, "%-7s <ipfilename>.enc and <ipfilename>.header as intermediate output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes <ipfilename>.enc and <ipfilename>.header\n", ""); fprintf(stderr, "%-7s as input files and produces <opfilename> as a final output file.\n\n", ""); exit(-1); } /* this source code form is s...
...if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/.
...include <prerror.h> #include <prinit.h> #include <prlog.h> #include <prtypes.h> #include <plstr.h> /* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); ...
...And 8 more matches
NSS Tools ssltap
once this connection arrives, the tool makes another connection to the specified host name and port on the server side.
... the tool cannot and does not decrypt any encrypted message data.
... syntax to run the ssl debugging tool, type this command in a command shell: ssltap [-vhfsxl] [-p port] hostname:port options the command does not require any options other than hostname:port, but you normally use them to control the connection interception and output.
...And 8 more matches
Rhino shell
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.
... readfile(path [, charactercoding]) read given file and convert its bytes to a string using the specified character coding or default character coding if explicit coding argument is not given.
... readurl(url [, charactercoding]) open an input connection to the given string url, read all its bytes and convert them to a string using the specified character coding or default character coding if explicit coding argument is not given.
...And 8 more matches
SpiderMonkey 38
these release notes are incomplete.
... — sep 17, 2015 the download url is outdated and spidermonkey not release alone!
... if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010.
...And 8 more matches
Secure Development Guidelines
ld save you without knowing it examples: if it doesn’t have to be negative, store it in an unsigned int if the input doesn’t have to be > 512, cut it off there if the input should only be [a-za-z0-9], enforce it cross site scripting (xss) xss is a type of code injection attack typically occurs in web applications injection of arbitrary data into an html document from another site victim’s browser executes those html instructions could be used to steal user credentials think: webmail, online auction, cms, online banking...
... insert value into the database (a user account) change application logic based on results returned by the database sql injection: example snprintf(str, sizeof(str), "select * from account where name ='%s'", name); sqlite3_exec(db, str, null, null, null); sql injection: prevention use parameterized queries insert a marker for every piece of dynamic content so data does not get mixed with sql instructions example: sqlite3_stmt *stmt; char *str = "select * from account where name='?'"; sqlite3_prepare_v2(db, str, strlen(str), &stmt, null); sqlite3_bind_text(stmt, 1, name, strlen(name), sqlite_transient); sqlite3_step(stmt); sqlite3_finalize(p_stmt); writing secure code: arithmetic issues integer overflows/underflows overflows occur when an arithmet...
... 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 stack segment!
...And 8 more matches
Gecko object attributes
possible values are "off" which is the same as not being set -- this means the region is not live.
...if not specified, the default should be considered "additions text", which indicates that newly created objects and changes to text and text equivalents should be considered relevant, and that the hiding or removal of items is not.
... container-busy the current changes are not yet complete.
...And 8 more matches
XPCOM glue
MozillaTechXPCOMGlue
it should not link against xpcom_core.lib.
... frozen linkage: standalone glue (no dll dependencies) note: support for locating a standalone glue was removed in gecko 6.0.
... embedding code which wishes to use only frozen symbols and cannot tolerate a load-time dependency on xpcom.dll should #define xpcom_glue 1 while compiling, and link against xpcomglue.lib.
...And 8 more matches
mozIStorageStatement
methods initialize() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) note: this method has been removed for gecko 1.9.1.
... void finalize(); note: this method does not need to be used from native callers because you have to release the statement in order to not leak.
... note: javascript callers should always wrap their execution in a try block, and have a reset statement in a finally block.
...And 8 more matches
nsIAccessibleHyperLink
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview nsiaccessible getanchor(in long index); note: renamed from getobject in gecko 1.9 nsiuri geturi(in long index); boolean isselected(); obsolete since gecko 1.9 boolean isvalid(); obsolete since gecko 1.9 attributes attribute type description anchorcount long the number of anchors within this hyperlink.
...note: renamed from anchors in gecko 1.9 exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree.
... note: the link itself is represented by one embedded character within the parent text, so the endindex should be startindex + 1.
...And 8 more matches
nsIAccessibleTable
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsiaccessible getcellat(in long rowindex, in long columnindex); note: renamed from cellrefat in gecko 1.9.2 long getcellindexat(in long rowindex, in long columnindex); note: renamed from getindexat in gecko 1.9.2 astring getcolumndescription(in long columnindex); long getcolumnextentat(in long row, in long column); long getcolumnindexat(in long cellindex); note: renamed from getcolumnatindex in gecko 1.9.2 void getrowandcolumnindicesat(in long cellindex, out long rowindex, out long columnindex); astring getrowdes...
...cription(in long rowindex); long getrowextentat(in long row, in long column); long getrowindexat(in long cellindex); note: renamed from getrowatindex in gecko 1.9.2 void getselectedcellindices(out unsigned long cellsarraysize, [retval, array, size_is(cellsarraysize)] out long cellsarray); note: renamed from getselectedcells in gecko 1.9.2 void getselectedcolumnindices(out unsigned long columnsarraysize, [retval, array, size_is(columnsarraysize)] out long columnsarray); note: renamed from getselectedcolumns in gecko 1.9.2 void getselectedrowindices(out unsigned long rowsarraysize, [retval, array, size_is(rowsarraysize)] out long rowsarray); note: renamed from getselectedrows in gecko 1.9.2 boolean iscellselected(in long rowindex, in long co...
...note: renamed from columns in gecko 1.9.2 columnheader nsiaccessibletable read only.
...And 8 more matches
nsIDOMWindow
while this interface is not officially defined by any standard bodies, it originates from the de-facto dom level 0 standard.
...note: prior to gecko 7.0 this attribute was part of nsidomwindow2.
...note: prior to gecko 8.0 this attribute was part of nsidomstoragewindow.
...And 8 more matches
nsILocalFileMac
obsolete since gecko 2.0 methods native code only!getcfurl note: observes the state of the followlinks attribute.
...note: supported only for xp_macosx.
...native code only!getfsref note: observes the state of the followlinks attribute.
...And 8 more matches
nsIMsgDBHdr
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.
...d 3.1 [noscript] void getauthorcollationkey(out octetptr key, out unsigned long len); [noscript] void getsubjectcollationkey(out octetptr key, out unsigned long len); [noscript] void getrecipientscollationkey(out octetptr key, out unsigned long len); attributes attribute type description isread boolean readonly: indicates whether or not the message is read.
... isflagged boolean readonly: indicates whether or not the message is starred in the ui.
...And 8 more matches
nsIMsgMessageService
acopylistener an nsistreamlistener to be notified of copy events.
... aurllistener a nsiurllistener to be notified of url events.
... srcfolder acopylistener an nsistreamlistener to be notified of copy events.
...And 8 more matches
nsIPropertyBag2
ring prop); print64 getpropertyasint64(in astring prop); void getpropertyasinterface(in astring prop, in nsiidref iid, [iid_is(iid), retval] out nsqiresult result); pruint32 getpropertyasuint32(in astring prop); pruint64 getpropertyasuint64(in astring prop); prbool haskey(in astring prop); methods get() this method returns null if the value does not exist, or exists but is null.
...note: accessing a property of a different type may attempt conversion to this type.
...note: accessing a property of a different type may attempt conversion to this type.
...And 8 more matches
nsITimer
note that the delay is approximate: the timer can be fired before the requested time has elapsed.
...it is not necessary to cancel the timer in that case.
... note: re-setting the delay on a one-shot timer that has already fired doesn't restart the timer.
...And 8 more matches
nsITreeView
constants constant value description progress_normal 1 note: renamed from progressnormal in gecko 1.8 progress_undetermined 2 note: renamed from progressundetermined in gecko 1.8 progress_none 3 note: renamed from progressnone in gecko 1.8 drop_before -1 drop_on 0 drop_after 1 indropbefore 0 obsolete since gecko 1.8 indropon 1 ...
...to get the behavior where drops are only allowed on items, such as the mailnews folder pane, always return false when the orientation is not drop_on.
... note: drop_on will only be passed to candrop() if the item is a container; see iscontainer().
...And 8 more matches
nsIWebBrowserPersist
progresslistener nsiwebprogresslistener callback listener for progress notifications.
... persist_flags_from_cache 1 only use cached data (could result in failure if data is not cached).
... persist_flags_no_conversion 16 do not run the incoming data through a content converter for example to decompress it.
...And 8 more matches
Xptcall Porting Status
status status platform contributors and <font color="red">?</font> possible contributors notes <font color="white">done</font> win32 x86 john bandhauer <jband@netscape.com> win32 <font color="white">done</font> linux x86 john bandhauer <jband@netscape.com> ulrich drepper <drepper@cygnus.com> unix <font color="white">done</font> freebsd and netbsd x86 christoph toshok <toshok@hungry.com>, john bandhauer <jband@netscape.com> unix (same as linux 86 code) <font color="white">don...
...he notes that the vtbl scheme is different.
...notice the last 2 files (the change to mozilla\xpcom\build\makefile.win and mozilla\xpcom\build) are needed because i was unable to figure how to do a "declspecexport" from the assembler asaxp ...
...And 8 more matches
Using js-ctypes
note: js-ctypes only works with c libraries; you can't use c++ methods directly.
... note: this information comes from this article on msdn.
... note: this example will not work on 64bit os x, see below for core foundation for 64bit os x /* build a str255 ("pascal style") string from the passed-in string */ function makestr(str) { return string.fromcharcode(str.length) + str; } components.utils.import("resource://gre/modules/ctypes.jsm"); var carbon = ctypes.open("/system/library/frameworks/carbon.framework/carbon"); stdalert = carbon.
...And 8 more matches
Accessibility Inspector - Firefox Developer Tools
this means trying your best to not lock anyone out of accessing information because of any disability they may have, or any other personal circumstances such as the device they are using, the speed of their network connection, or their geographic location or locale.
... accessing the accessibility inspector when you first open any of the other developer tools, the accessibility features are turned off (unless you've already got them turned on in another browser tab, or got the firefox accessibility engine started already, e.g., you might be a screenreader user or tester).
...if you do this, the ways listed above for activating the accessibility inspector do nothing.
...And 8 more matches
about:debugging (before Firefox 68) - Firefox Developer Tools
whether or not system add-ons appear in the list on this page depends on the setting of the devtools.aboutdebugging.showsystemaddons preference.
... 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 include add-ons that came preinstalled with your firefox).
...note that sometimes the debugger window is hidden by the main firefox window.
...And 8 more matches
Background Tasks API - Web APIs
certainly most if not all code that is capable of making changes to the dom is running in the main thread, since it's common for user interface changes to only be available to the main thread.
... because event handling and screen updates are two of the most obvious ways users notice performance issues, it's important for your code to be a good citizen of the web and help to prevent stalls in the execution of the event loop.
... idle callbacks should do their best not to overrun the time allotted.
...And 8 more matches
Cache - Web APIs
WebAPICache
note that the cache interface is exposed to windowed scopes as well as workers.
...items in a cache do not get updated unless explicitly requested; they don’t expire unless deleted.
... note: the key matching algorithm depends on the vary header in the value.
...And 8 more matches
console - Web APIs
WebAPIConsole
note: this feature is available in web workers.
... note: the actual console interface is defined as all lower case (i.e.
... not console), for historical reasons.
...And 8 more matches
DOMError - Web APIs
WebAPIDOMError
error types type description indexsizeerror the index is not in the allowed range (e.g.
... hierarchyrequesterror the node tree hierarchy is not correct.
... nomodificationallowederror the object can not be modified.
...And 8 more matches
Document.querySelectorAll() - Web APIs
the document method queryselectorall() returns a static (not live) nodelist representing a list of the document's elements that match the specified group of selectors.
... note: this method is implemented based on the parentnode mixin's queryselectorall() method.
...this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown.
...And 8 more matches
Document - Web APIs
WebAPIDocument
document.hiddenread only returns a boolean value indicating if the page is considered hidden or not.
... document.undomanager read only … document.visibilitystateread only returns a string denoting the visibility state of the document.
...note that this is currently only implemented by chrome; other browsers still implement them directly on the document interface.
...And 8 more matches
FileSystemDirectoryEntry.getDirectory() - Web APIs
absolute paths may not be able to be used, for security reasons.
... options optional an object based on the filesystemflags dictionary, which allows you to specify whether or not to create the entry if it's missing and if it's an error if the file already exists.
... these options are currently not useful in web contexts.
...And 8 more matches
HTMLInputElement.stepDown() - Web APIs
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.
...the default value for the parameter, if not is passed, is 1.
... the method will not cause the value to go below the min value set or defy the constraints set by the step attribute.
...And 8 more matches
KeyboardEvent.key - Web APIs
WebAPIKeyboardEventkey
if the key cannot be identified, the returned value is unidentified.
...for a given key press, the sequence of keyboardevents fired is as follows assuming that event.preventdefault is not called: a keydown event is first fired.
...note that some other implementations may fire keypress event if supported.
...And 8 more matches
NavigationPreloadManager - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnavigationpreloadmanager experimentalchrome full support 62edge full support 18firefox no support nonotes no support nonotes notes implementation tracked in bug 1290958ie ?
... webview android full support 62chrome android full support 62firefox android no support nonotes no support nonotes notes implementation tracked in bug 1290958opera android full support 46safari ios ?
... samsung internet android full support 8.0disable experimentalchrome full support 62edge full support 18firefox no support nonotes no support nonotes notes implementation tracked in bug 1290958ie ?
...And 8 more matches
Navigator - Web APIs
WebAPINavigator
do not rely on this property to return the correct value.
...do not rely on this property to return the correct value.
...do not rely on this property to return the correct value.
...And 8 more matches
Pointer events - Web APIs
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).
...this event is also used if the change in pointer state can not be reported by other events.
... 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.
...And 8 more matches
Using server-sent events - Web APIs
vent source, you can begin listening for messages from the server by attaching a handler for the message event: evtsource.onmessage = function(event) { const newelement = document.createelement("li"); const eventlist = document.getelementbyid("list"); newelement.innerhtml = "message: " + event.data; eventlist.appendchild(newelement); } this code listens for incoming messages (that is, notices from the server that do not have an event field on them) and appends the message text to a list in the document's html.
... when not used over http/2, sse suffers from a limitation to the maximum number of open connections, which can be especially painful when opening multiple tabs, as the limit is per browser and is set to a very low number (6).
...this limit is per browser + domain, which means that you can open 6 sse connections across all of the tabs to www.example1.com and another 6 sse connections to www.example2.com (per stackoverflow).
...And 8 more matches
Streams API concepts - Web APIs
an internal queue keeps track of the chunks that have not yet been read (see the internal queues and queuing strategies section below).
...if you want another reader to start reading your stream, you typically need to cancel the first reader before you do anything else (although you can tee streams, see the teeing section below) note that there are two different types of readable stream.
... 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 for them to be implemented.
...And 8 more matches
Web Authentication API - Web APIs
please note: both create() and get() require a secure context (e.g.
... - the server is connected by https or is the localhost), and will not be available for use if the browser is not operating in a secure context.
...note most javascript programmers that are creating an application will only really care about steps 1 and 5 where the create() function is called and subsequently returns; however, steps 2, 3, and 4 are essential to understanding the processing that takes place in the browser and authenticator and what the resulting data means.
...And 8 more matches
Using the Web Storage API - Web APIs
the keys and the values are always strings (note that, as with objects, integer keys will be automatically converted to strings).
...these three lines all set the (same) colorsetting entry: localstorage.colorsetting = '#a4509b'; localstorage['colorsetting'] = '#a4509b'; localstorage.setitem('colorsetting', '#a4509b'); note: it's recommended to use the web storage api (setitem, getitem, removeitem, key, length) to prevent the pitfalls associated with using plain objects as key-value stores.
... testing for availability note: this api is available in current versions of all major browsers.
...And 8 more matches
ARIA: row role - Accessibility
this is not the case for an ordinary table or grid, in which the aria-expanded attribute is not present.
... note: using the native html table element (<table>) along with the table row element (<tr>) whenever possible is strongly encouraged.
... if the element with the aria-expanded attribute controls the expansion of another grouping container that is not 'owned by' the element, the author should reference the container by using the aria-controls attribute.
...And 8 more matches
Text labels and names - Accessibility
a dialog box is generally denoted by an aria role="dialog" or role="alertdialog"; you can use the aria-label or aria-labelledby attributes to provide a label.
...if the title is not available, they have to navigate the page to determine its content, which can be a time consuming and potentially confusing process.
... examples the title for the reference article about the <title> element is as follows: <title>&lt;title&gt;: the document title element - html: hypertext markup language</title> another example might look like so: <title>fill in your details to register — mygov services</title> to help the user, you can update the page title value to reflect significant page state changes (such as form validation problems): <title>2 errors — fill in your details to register — mygov services</title> see also <title> embedded content must be labeled make sure that elements that embed content have a title attribute that describes the embedded content.
...And 8 more matches
OpenType font features guide - CSS: Cascading Style Sheets
caution: there are many css attributes defined to leverage font features, but unfortunately many are not fully implemented.
...not all opentype features are appropriate to use all of the time, but some features are critical for great typography.
... sometimes it's substance, not just style there are some cases — like with font-variant-east-asian — that opentype features are directly tied to using different forms of certain glyphs, which can impact meaning and readability.
...And 8 more matches
box-shadow - CSS: Cascading Style Sheets
values inset if not specified (default), the shadow is assumed to be a drop shadow (as if the box were raised above the content).
...negative values are not allowed.
... if not specified, it will be 0 (the shadow's edge is sharp).
...And 8 more matches
pointer-events - CSS: Cascading Style Sheets
values auto the element behaves as it would if the pointer-events property were not specified.
...the value of the fill property does not affect event processing.
...the value of the stroke property does not affect event processing.
...And 8 more matches
Adding captions and subtitles to HTML5 video - Developer guides
note: you can find the source on github, and also view the example live.
... captions versus subtitles captions and subtitles are not the same thing: they have significantly different audiences, and convey different information, and it is recommended that you read up on the differences if you are not sure what they are.
...if you are not interested in this, and just want to get straight into the javascript and more relevant css, skip to the subtitle implementation section.
...And 8 more matches
<input type="color"> - HTML: Hypertext Markup Language
WebHTMLElementinputcolor
color names, functional notations and a hexadecimal format with an alpha channel.
... the element's presentation may vary substantially from one browser and/or platform to another—it might be a simple textual input that automatically validates to ensure that the color information is entered in the proper format, or a platform-standard color picker, or some kind of custom color picker window.
... 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.
...And 8 more matches
<th> - HTML: Hypertext Markup Language
WebHTMLElementth
auto the default value when this attribute is not specified is auto.
... the default value when this attribute is not specified is left.
... note: do not use this attribute as it is obsolete in the latest standard.
...And 8 more matches
Feature-Policy - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
...when this policy is disabled, the promise returned by navigator.getbattery() will reject with a notallowederror domexception.
...when this policy is disabled, the promise returned by getusermedia() will reject with a notallowederror domexception.
...And 8 more matches
Using Promises - JavaScript
each callback is executed one after another, in the order in which they were inserted.
... here's the magic: the then() function returns a new promise, different from the original: const promise = dosomething(); const promise2 = promise.then(successcallback, failurecallback); or const promise2 = dosomething().then(successcallback, failurecallback); this second promise (promise2) represents the completion not just of dosomething(), but also of the successcallback or failurecallback you passed in, which can be other asynchronous functions returning a promise.
... basically, each promise represents the completion of another asynchronous step in the chain.
...And 8 more matches
arguments.callee - JavaScript
(adapted from a stack overflow answer by olliej) early versions of javascript did not allow named function expressions, and for this reason you could not make a recursive function expression.
...*/ (n - 1) * n; }); did not.
...1 : arguments.callee(n - 1) * n; }); however, this was actually a really bad solution as this (in conjunction with other arguments, callee, and caller issues) make inlining and tail recursion impossible in the general case (you can achieve it in select cases through tracing, etc., but even the best code is suboptimal due to checks that would not otherwise be necessary.) the other major issue is that the recursive call will get a different this value, e.g.: var global = this; var sillyfunction = function(recursed) { if (!recursed) { return arguments.callee(true); } if (this !== global) { alert('this is: ' + this); } else { alert('this is the global'); } } sillyfunction(); ecmascript 3 resolved these iss...
...And 8 more matches
Array.prototype.forEach() - JavaScript
it is not invoked for index properties that have been deleted or are uninitialized.
...elements which are appended to the array after the call to foreach() begins will not be visited by callback.
... if existing elements of the array are changed or deleted, their value as passed to callback will be the value at the time foreach() visits them; elements that are deleted before being visited are not visited.
...And 8 more matches
Array - JavaScript
since an array's length can change at any time, and data can be stored at non-contiguous locations in the array, javascript arrays are not guaranteed to be dense; this depends on how the programmer chooses to use them.
... in general, these are convenient characteristics; but if these features are not desirable for your particular use, you might consider using typed arrays.
... arrays cannot use strings as element indexes (as in an associative array) but must use integers.
...And 8 more matches
Optional chaining (?.) - JavaScript
when used with function calls, it returns undefined if the given function does not exist.
...operator instead of just ., javascript knows to implicitly check to be sure obj.first is not null or undefined before attempting to access obj.first.second.
... this is equivalent to the following, except that the temporary variable is in fact not created: let temp = obj.first; let nestedprop = ((temp === null || temp === undefined) ?
...And 8 more matches
async function - JavaScript
if the return value of an async function is not explicitly a promise, it will be implicitly wrapped in a promise.
...the result of the first promise fulfilment (if it was not rejected) is returned from the await expression.
... async function foo() { const result1 = await new promise((resolve) => settimeout(() => resolve('1'))) const result2 = await new promise((resolve) => settimeout(() => resolve('2'))) } foo() note how the promise chain is not built-up in one go.
...And 8 more matches
MathML documentation index - MathML
WebMathMLIndex
found 40 pages: # page tags and summary 1 mathml landing, mathml, reference, web, xml mathematical markup language (mathml) is a dialect of xml for describing mathematical notation and capturing both its structure and content.
...html becomes verbose when your document contains advanced structures like lists or tables but fortunately there are many generators from simple notations, wysiwyg editors and other content management systems to help writing web pages.
...in addition you must not nest a second <math> element in another, but you can have an arbitrary number of other child elements in it.
...And 8 more matches
Using templates and slots - Web Components
this element and its contents are not rendered in the dom, but it can still be referenced using javascript.
...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.
... 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).
...And 8 more matches
page-mod - Archive of obsolete content
it will not attach scripts to add-on panels, page-workers, sidebars, or firefox hidden windows.
... exclude has the same syntax as include, but specifies the urls to which content scripts should not be attached, even if they match include: so it's a way of excluding a subset of the urls that include specifies.
...note that this is a very naive implementation, created only for demonstration purposes, and will not work properly in many real-world cases.
...And 7 more matches
core/heritage - Archive of obsolete content
ruff!' }; // subclassing a `dog` function pet(name, breed) { // once again we do our little dance if (!(this instanceof pet)) return new pet(name, breed); dog.call(this, name); this.breed = breed; } // to subclass, you need to make another special dance with special // 'prototype' properties.
... pet.prototype = object.create(dog.prototype); // if you want correct instanceof behavior you need to make a dance with // another special `constructor` property of the `prototype` object.
...to do that we need to freeze constructor's prototype chain to make sure functions are frozen: object.freeze(dog.prototype); object.freeze(pet.prototype); note: also, this is not quite enough as object.prototype stays mutable & in fact we do little bit more in sdk to address that, but it's not in the scope of this documentation.
...And 7 more matches
io/file - Archive of obsolete content
unfortunately this api does not currently provide a way to obtain an absolute base path which you could then use with join.
... note that if you do decide to hardcode windows-style paths, be sure to escape backslashes in strings.
... for example, to specify the file at c:\users\myk, you need to use the string "c:\\users\\myk", not "c:\users\myk".
...And 7 more matches
places/bookmarks - Archive of obsolete content
the module does not automatically sync up a bookmark instance with ongoing changes to that item in the database from the same add-on, other add-ons, or the user.
...rks with a new group let { bookmark, group, save } = require("sdk/places/bookmarks"); let group = group({ title: "guitars" }); let bookmarks = [ bookmark({ title: "ran", url: "http://ranguitars.com", group: group }), bookmark({ title: "ibanez", url: "http://ibanez.com", group: group }), bookmark({ title: "esp", url: "http://espguitars.com", group: group }) ]; // save `bookmarks` array -- notice we don't have `group` in the array, // although it needs to be saved since all bookmarks are children // of `group`.
...so `mygroup` will not be in this array, // but `mybookmark` will be.
...And 7 more matches
Bootstrapped extensions - Archive of obsolete content
notes on modifying 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).
... not all chrome.manifest instructions are supported in bootstrapped add-ons, for example you still cannot register xul overlays from a bootstrapped add-on.
... backward compatibility because older versions of firefox don't know about the bootstrap property or bootstrap.js file, it's not overly difficult to create an xpi that will work on both as a bootstrappable extension and as a traditional extension.
...And 7 more matches
Adding menus and submenus - Archive of obsolete content
the menubar element should be a child of a toolbox element because it is treated like another toolbar on systems other than mac os x.
... if you have nothing to show on a menu, you should follow the standard used in firefox: show a single disabled item with an "(empty)" label.
... if filling your menu takes a noticeable amount of time, you should not make firefox (and your users) wait for it to fill up before displaying anything.
...And 7 more matches
Custom XUL Elements with XBL - Archive of obsolete content
for now, just notice the opening part of the binding element: <binding id="person">.
...this css file is located in the content because it's not something we would normally want to be replaced by a skin, and it's not really defining style; it defines content behavior instead.
...notice how the default namespace for the document is xbl, and the xul namespace is defined as "xul".
...And 7 more matches
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
999/xhtml", xul: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" }; jsontodom.defaultnamespace = jsontodom.namespaces.html; function jsontodom(jsontemplate, doc, nodes) { function namespace(name) { var reelemnameparts = /^(?:(.*):)?(.*)$/.exec(name); return { namespace: jsontodom.namespaces[reelemnameparts[1]], shortname: reelemnameparts[2] }; } // note that 'elemnameorarray' is: either the full element name (eg.
... [html:]div) or an array of elements in json notation function tag(elemnameorarray, elemattr) { // array of elements?
... = elem; continue; } var attrns = namespace(key); if (typeof val == "function") { // special case for function attributes; don't just add them as 'on...' attributes, but as events, using addeventlistener elem.addeventlistener(key.replace(/^on/, ""), val, false); } else { // note that the default namespace for xml attributes is, and should be, blank (ie.
...And 7 more matches
Session store API - Archive of obsolete content
it's worth noting that this event is sent even if tab loading at startup is deferred until the user selects the tab.
... firefox 3 note in firefox 3 and later, if you need to detect when a tab is about to be closed so that you can update data associated with the tab before it is closed, you can watch for the "sstabclosing" event, which is sent to the tab.
... restoring without restarting firefox 3.6 note this section applies to firefox 3.6 and later.
...And 7 more matches
Search Extension Tutorial (Draft) - Archive of obsolete content
due to the large volume of user complaints regarding hidden settings being changed against their will, and not being restored after the add-ons responsible are disabled, mozilla will take any steps necessary to mitigate the impact of offending add-ons.
... in particular, changing the location bar search keyword url in a way which is not automatically reset when the add-on is removed will result in a reset prompt for users.
...pref("browser.search.defaultenginename", "data:text/plain,browser.search.defaultenginename=example engine"); in the case or restartless extensions, the preferences need to be changed manually, and reverted when the extension is disabled if they have not been changed in the meantime.
...And 7 more matches
Defining Cross-Browser Tooltips - Archive of obsolete content
summary: authors are used to having alt text appear as a &quot;tooltip&quot; above images, but that's not how it was meant to be used.
...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.
... 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.
...And 7 more matches
Source code directories overview - Archive of obsolete content
although not required, these common names are typically used for a common purpose.
...base contains all the source code that cannot be categorized into a submodule.
...they are not all necessarily public in the general sense; some are only meant for internal use in a certain module.
...And 7 more matches
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
the changes do not affect functionality and the step numbers in the diagram are still accurate.
... 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.
... if the load is not aborted, we create an nsdocumentopeninfo object for this load, passing it the "this is a link click" boolean and the window context.
...And 7 more matches
Java in Firefox Extensions - Archive of obsolete content
note: the global java object has been removed in gecko 16.0, so this page is out of date.
... note bug 834918 about click-to-play effect on java plugins in chrome and bug 775301.
...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.").
...And 7 more matches
Priority Content - Archive of obsolete content
note: use example at sample:original document information to credit original authors.
... devedge devedge mirror note: if you're digging around the mirror and see anything there that you think should be migrated to devmo that isn't on this list, feel free to add it below.
... a raw list of everything that has not been migrated at all appears there.
...And 7 more matches
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.
... a mozilla tree with the test files at %moz_src%/layout/html/tests, disable_tests should not be defined (so ac_add_options --enable-tests), patience and time.
... start the layout debugger via mozilla -layoutdebug - p foo where foo is just another profile than your main profile.
...And 7 more matches
Building accessible custom components in XUL - Archive of obsolete content
note: the row and column headers are denoted by description elements, and individual cells are denoted by label elements.
... this is not an accessibility requirement; as we'll see in the next section, the actual xul elements are irrelevant because we will define the role of each element in a separate attribute.
... <caption>it looks like a cell, but it's not</caption> assistive technologies also have no idea that our row headers and column headers are really headers.
...And 7 more matches
Moving, Copying and Deleting Files - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes.
...if you do not want to rename the file, and use the same name as the source file, use a null string for the second argument.
...And 7 more matches
Attribute Substitution - Archive of obsolete content
note that variable names must have a space after them as this is how the end of variable is determined.
... that is '?name?age' is considered to be a single variable with that name, not two variables together.
...<label value="?name" class="?gender^?nationality"/> the caret is considered a separator between variables, however it will not appear in the output.
...And 7 more matches
Sorting Results - Archive of obsolete content
for more complex queries, this natural sorting will not work, because the sort service assumes that the starting ref resource is the container and the end results are the children.
...this last value is the default if the attribute is not specified.
...usually, this would be the same variable that is used to generate the label for the cells in that column, however this is not actually necessary.
...And 7 more matches
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
another tutorial, which walks you through the entire process from the beginning, is also available.
... note: some people overlay chrome://messenger/content/mailwindowoverlay.xul.
...the latter is possible, but is not recommended and is harder to implement.
...And 7 more matches
Complete - Archive of obsolete content
this article is not finished yet.
...however, because it is so simple it does not support some of the usual features of extensions.
...this page is not a step-by-step tutorial.
...And 7 more matches
Focus and Selection - Archive of obsolete content
usually, however, you would not set the tabindex attribute.
... if you do not, pressing tab will set the focus to the next displayed element.
...it takes three parameters, the event type, a function to execute when the event occurs and a boolean indicating whether to capture or not.
...And 7 more matches
More Event Handlers - Archive of obsolete content
if a capturing event stops the event propagation, none of the later capturing listeners, nor any of the bubbling listeners will ever receive notification about the events.
...lert('button was pressed!'); } function boxpressed(event){ alert('box was pressed!'); event.stoppropagation(); } var button = document.getelementbyid("okbutton"); button.addeventlistener('command',buttonpressed,true); var outerbox = document.getelementbyid("outerbox"); outerbox.addeventlistener('command',boxpressed,true); </script> here, an event listener has been added to the button and another event listener has been added to the box.
...if the default action is prevented, the popup will not be displayed.
...And 7 more matches
Property Files - Archive of obsolete content
« previousnext » in a script, entities cannot be used.
...however, a script does not get parsed for entities.
... in addition, you may wish to display a message which is generated from a script, if, for example, you do not know the exact text to be displayed.
...And 7 more matches
Trees - Archive of obsolete content
ArchiveMozillaXULTutorialTrees
the tree also supports nested rows, whereas the listbox does not.
...this attribute specifies how many rows are displayed in the user interface, not how many rows of data there are.
... the content tree view having said that the data to be displayed in a tree comes from a view and not from xul tags, there happens to be a built-in tree view which gets its data from xul tags.
...And 7 more matches
button - Archive of obsolete content
checked type: boolean indicates whether the element is checked or not.
... none the text will be not be cropped using an ellipsis.
... disabled type: boolean indicates whether the element is disabled or not.
...And 7 more matches
key - Archive of obsolete content
ArchiveMozillaXULkey
disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
... in the case of form elements, it will not be submitted.
...And 7 more matches
treecol - Archive of obsolete content
none the text will be not be cropped using an ellipsis.
...if the cycler attribute is not set, the cell is a regular text cell.
... fixed type: boolean if true, the size of the column in the tree cannot be adjusted by the user.
...And 7 more matches
NPN_GetURL - Archive of obsolete content
not recommended; if target refers to the window or frame containing the instance, the instance is destroyed and the plug-in may be unloaded.
... if unsuccessful, the plug-in is not loaded and the function returns an error code.
... description npn_geturl() is used to load a url into the current window or another target or stream.
...And 7 more matches
NPAPI plugin reference - Archive of obsolete content
npn_geturlnotify requests creation of a new stream with the contents of the specified url; gets notification of the result.
... npn_hasmethod determines whether or not the specified npobject has a particular method.
... npn_hasproperty determines whether or not the specified npobject has a particular property.
...And 7 more matches
The First Install Problem - Archive of obsolete content
unless gecko does a pre-emptive scan upon startup for desirable plugins that are not in the browser's plugins directory first, the best way to solve this problem is to encourage plugin vendors to leave dlls (and xpt files, if applicable) in a location that gecko can discover at runtime.
...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.
...note that myapplication consists of one dll (which is an npapi plugin handling a given mimetype -- say application/x-myapp) and one xpt file, for scriptable interfaces.
...And 7 more matches
Building a Theme - Archive of obsolete content
note: this tutorial is about building themes for firefox 29 and later.
... note: firefox for mac os x has changed some directories so the guide may be obsolete.
...this is a value you come up with to identify your extension in email address format (note that it should not be your email).
...And 7 more matches
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
following standards is certainly not a new organizational phenomenon; organizations require their employees to follow common rules, or a common set of standards all the time.
... this process is not unique: most organizations have basic project management processes for product or service.
...however, what xerox neglected to understand was that regardless of how powerful pilot and co-pilot was, the star workstation could not evolve with the times because it was proprietary.
...And 7 more matches
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
this technote explains the source of the problems and how to avoid encountering them.
...scripting may change whether elements react to user events or not, and different devices and uas may have different ways of pointing to, or activating elements.
... thus, although authors are used to thinking of these states as applying exclusively to hyperlinks, they are not so restricted by css2.
...And 7 more matches
Common causes of memory leaks in extensions - Extensions
however, while this is still true, the window.setinterval() in the example originates from the outer chrome window (browser.xul) and not from the content window.
...when the user closes the whole browser window) but not when the content window unloads (i.e.
...another solution would be to use the setinterval()/settimeout() instances content windows provide, but there is a big drawback with this idea: if the user disables javascript globally or locally (such as by using an add-on like noscript), then using the content window functions won't work.
...And 7 more matches
Building up a basic demo with Three.js - Game development
note: we chose three because it 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.
...thanks to this approach, a fallback can be used, if a desired technology is not supported by the browser.
...And 7 more matches
Backgrounds and borders - Learn web development
by default, the large image is not scaled down to fit the box, so we only see a small corner of it, whereas the small image is tiled to fill the box.
... note: the default background-position value is (0,0).
... note: background-position is a shorthand for background-position-x and background-position-y, which allow you to set the different axis position values individually.
...And 7 more matches
Flexbox - Learn web development
note also that you can use a display value of inline-flex if you wish to lay out an element's children as flex items, but have that element behave like an inline element.
... note: you can also lay out flex items in a reverse direction using the row-reverse and column-reverse values.
...you might also notice that the last few children on the last row are each made wider so that the entire row is still filled.
...And 7 more matches
Grids - Learn web development
add this to the css inside your file: .container { display: grid; } unlike flexbox, the items will not immediately look any different.
... { display: grid; grid-template-columns: 2fr 1fr 1fr; } .container > div { border-radius: 5px; padding: 10px; background-color: rgb(207,232,220); border: 2px solid rgb(79,185,227); } <div class="container"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> <div>six</div> <div>seven</div> </div> note: the fr unit distributes available space, not all space.
... .container { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-gap: 20px; } these gaps can be any length unit or a percentage, but not an fr unit.
...And 7 more matches
Web fonts - Learn web development
note: web fonts as a technology have been supported in internet explorer since version 4!
... you can use the firefox font editor to investigate and manipulate the fonts in use on your page, whether they are web fonts or not.
...you can also buy fonts directly from font foundries, for example linotype, monotype, or exljbris.
...And 7 more matches
How do you make sure your website works properly? - Learn web development
it's not showing the image we expected!
..."404" means "resource not found", and that's why we didn't see the image.
... 304: not modified the file has not changed since the last time you asked for it, so your browser can display the version from its cache, resulting in faster response times and more efficient use of bandwidth.
...And 7 more matches
What is a Domain Name? - Learn web development
a label is a case-insensitive character sequence anywhere from one to sixty-three characters in length, containing only the letters a through z, digits 0 through 9, and the - character (which may not be the first or last character in the label).
...it is not mandatory nor necessary to have 3 labels to form a domain name.
... you cannot “buy a domain name”.
...And 7 more matches
Dealing with files - Learn web development
when you're building a website, you need to assemble these files into a sensible structure on your local computer, make sure they can talk to one another, and get all your content looking right before you eventually upload them to a server.
... inside this first folder, create another folder to store your first website in.
... an aside on casing and spacing you'll notice that throughout this article, we ask you to name folders and files completely in lowercase with no spaces.
...And 7 more matches
Deployment and next steps - Learn web development
note that our application is fully functional and porting it to typescript is completely optional.
...even if you are not planning to adopt it, this article will be useful for allowing you to learn what it has to offer and help you make your own decision.
... if you are not interested 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.
...And 7 more matches
Vue conditional rendering: editing existing todos - Learn web development
if; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #0b0c0c; display: block; margin-bottom: 5px; } input { display: inline-block; margin-top: 0.4rem; width: 100%; min-height: 4.4rem; padding: 0.4rem 0.8rem; border: 2px solid #565656; } form { display: flex; flex-direction: row; flex-wrap: wrap; } form > * { flex: 0 0 100%; } </style> note: walk through the above code then read the below description to make sure you understand everything the component is doing before moving on.
... isediting: false }; } now add your methods inside a methods property, right below your data() property: methods: { deletetodo() { this.$emit('item-deleted'); }, toggletoitemeditform() { this.isediting = true; } } conditionally displaying components via v:if and v:else now we have an isediting flag that we can use to signify that the item is being edited (or not).
...to do that, we'll use another vue directive: v-if.
...And 7 more matches
Experimental features in Firefox
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)}}.
... 78 yes developer edition 78 yes beta 78 yes release 78 no preference name network.preload css display stray control characters in css as hex boxes this feature renders control characters (unicode category cc) other than tab (u+0009), line feed (u+000a), form feed (u+000c), and carriage return (u+000d) as a hexbox when they are not expected.
...when tabbing between elements), and not when they are focused using a mouse or other pointing device.
...And 7 more matches
Limitations of frame scripts
however, some apis that work in the chrome process will not work in a frame script.
... file i/o you should not write to or read from the disk from a frame script, in particular, the profile directory.
... even if this is possible, you should not do it and may expect that it could stop working at any time.
...And 7 more matches
Getting Started with Chat
note that on 2nd march 2020, mozilla moved away from irc to matrix for its public channels, the irc server was shut down.
...for example, do not talk about thunderbird issues in #firefox.
... posting a message like "help!" is not particularly helpful.
...And 7 more matches
Downloads.jsm
rt("resource://gre/modules/downloads.jsm"); method overview promise<download> createdownload(object aproperties); promise<void> fetch(asource, atarget, [optional] object aoptions); promise<downloadlist> getlist(atype); promise<downloadsummary> getsummary(atype); constants constant description public work on downloads that were not started from a private browsing window.
...can be omitted or null if no referrer should be sent or the download source is not http.
... this download method does not provide user interface or the ability to cancel or restart the download programmatically.
...And 7 more matches
JavaScript OS.Constants
os.constants.libc is available on all platforms, although some constants are not defined everywhere.
... error values eacces permission denied eagain resource temporarily unavailable ebadf bad file descriptor eexist file exists efault bad address efbig file too large einval invalid argument eio input/output error eisdir is a directory eloop (not always available under windows) too many levels of symbolic links.
... 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.
...And 7 more matches
Examples
when the callback finishes execution, newpromise will be fulfilled with an undefined fulfillment value, because the callback does not return any value.
... when newpromise is fulfilled, nothing happens, because no fulfillment callback is specified and the return value of the last then method is ignored.
...always wrap that function in a try catch and make that catch return promise.reject(ex) otherwise it will not trigger the rejection function of the promise.then.
...And 7 more matches
Fonts for Mozilla 2.0's MathML engine
note: these instructions are for gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) until gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27).
... on android, firefox os and other platforms where the instructions above do not work: install the mathml-fonts add-on.
...furthermore, in accordance with the w3c css2 recommendation on fonts, authors can specify an ordered list of particular fonts which they prefer (using the font-family property of css), with the assurance that mozilla's font engine will hunt for alternate fonts whenever their specified fonts are not found on a particular user's system.
...And 7 more matches
Using the viewport meta tag to control layout on mobile browsers
this is often not the same size as the rendered page, in which case the browser provides scrollbars for the user to scroll around and access all the content.
... this is done because many pages are not mobile optimized, and break (or at least look bad) when rendered at a small viewport width.
... enter viewport meta tag however, this mechanism is not so good for pages that are optimized for 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.
...And 7 more matches
Refcount tracing and balancing
note: due to an issue with the sandbox on windows (bug 1345568), refcount logging currently requires the moz_disable_content_sandbox environment variable to be set.
...this requires c++ dynamic casts, so it is not supported on all platforms.
...note that setting xpcom_mem_log_classes will also list the serial number of each object that leaked in the "bloat log" (that is, the file specified by the xpcom_mem_bloat_log variable; see the bloatview documentation for more details).
...And 7 more matches
A brief guide to Mozilla preferences
a preference is any value or defined behavior that can be set (presumably, one setting is preferable to another).
... prefs.js is automatically generated by the application and should not be edited manually, whereas user.js is an optional file the user can create to override preferences initialized by other preferences files.
... do not edit prefs.js directly.
...And 7 more matches
Encrypt Decrypt MAC Keys As Session Objects
if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/.
...ssword file [optional]\n\n", "-f "); fprintf(stderr, "%-20s specify noise file name [optional]\n\n", "-z "); fprintf(stderr, "%-21s specify an input file name\n\n", "-i "); fprintf(stderr, "%-21s specify an output file name\n\n", "-o "); fprintf(stderr, "%-7s for encrypt, it takes as an input file and produces\n", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final output file.\n\n", ""); exit(-1); } /* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { sec...
...status rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } ...
...And 7 more matches
Encrypt and decrypt MAC using token
if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/.
...ssword file [optional]\n\n", "-f "); fprintf(stderr, "%-20s specify noise file name [optional]\n\n", "-z "); fprintf(stderr, "%-21s specify an input file name\n\n", "-i "); fprintf(stderr, "%-21s specify an output file name\n\n", "-o "); fprintf(stderr, "%-7s for encrypt, it takes as an input file and produces\n", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final output file.\n\n", ""); exit(-1); } /* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { sec...
...status rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey cka_id attribute\n"); return rv; } return rv; } /* * generate a symmetric key */ pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } ...
...And 7 more matches
NSS Developer Tutorial
nss coding style formatting line length should not exceed 80 characters.
... however, not all features from c99 are equally available.
... universal character names are not permitted, as are wide character types (char16_t and char32_t).
...And 7 more matches
sslintro.html
other apis that may be exposed in the header files are not supported for application use.
...nss_init is not idempotent, so call it only once.
...cipher suites disabled by policy cannot be enabled by user preference.
...And 7 more matches
Tracing JIT
a fragment represents a single linear code sequence, typically terminating in a jump to another fragment or back to the beginning of the fragment.
...in this way the assembler can "patch together" multiple fragments, so that program control can flow from one fragment into another, or back out of generated code and into the interpreter.
...this is a local register allocator, meaning that it does not allocate registers across basic blocks.
...And 7 more matches
JS::PersistentRooted
method description void init(jscontext* cx) initialize with optional initial value (if not provided, it will be initialized with the initial value of the type).
... 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.
...And 7 more matches
JS_THREADSAFE
note: js_threadsafe is now permanently on.
... the callback does not need to call js_beginrequest()).
...for each thread that is in a request: almost any call into the jsapi may trigger garbage collection; but garbage collection does not happen at any other time (such as, for example, at the moment before the return value of js_newobject is assigned to a rooted variable).
...And 7 more matches
SpiderMonkey 24
these release notes are an incomplete draft and were initially seeded from the spidermonkey 17 release notes, so they're not necessarily complete or fully accurate.
... — dec 16, 2013 the download url still available, but spidermonkey not release alone!
... (this change was motivated by garbage collector improvements, which lean quite heavily on c++'s support for raii through constructors and destructors.) if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010: msvc8/9 support has been dropped.
...And 7 more matches
Split object
but the association is not fixed.
...suppose a script in page a, in tab ta, has a reference to the window object of page b in another tab tb.
...this makes the problem resistant to a wrapper-based approach.) older versions of firefox accomplished this by blowing away all window properties every time a user navigated to another page, then reusing the window.
...And 7 more matches
Thread Sanitizer
public builds note: no public builds are available at this time yet.
... manual build build prerequisites note: this section assumes you're using linux to build.
... threadsanitizer does not work on mac osx yet.
...And 7 more matches
Mozilla Projects
compare-locales compare-locales is a python script that helps localizers to check their work without running firefox or another application.
...generated from c/c++ using clang, or from another language) and compiles that into javascript, which can be run on the web.
...it will pop-up an alert when a window is closed and javascript still links to that window (for example, an observer that is not cleared when the window closes).
...And 7 more matches
Using RAII classes in Mozilla
ensuring raii classes are not used as temporaries a common mistake when using raii classes is to accidentally forget to name object, which causes its scope to be different from what is intended.
... assertions runtime assertions offer two benefits - firstly, they run on windows, which the static analysis currently does not, and secondly they will run locally, even if the developer did not choose to run static analysis locally.
... the static analys runtime assertions are often better at catching bugs in code that a developer is currently working on than static analysis, which he might not think to run.
...And 7 more matches
A Web PKI x509 certificate primer
one issue that is not commonly known is that the x509 trust graph is not a forest (a bunch of trees where each root is a trusted root) but a cyclic graph, where the same key/issuer can be a root or an intermediate for another root in the browsers key store (when roots create intermediates for each other it is called cross-signing).
...certificates can have other extensions not described on rfc 5280, but that is out of the scope of this document.
... extensions can be marked as critical or non-critical, conforming certificate verification libraries should stop processing verification when encountering a critical extension that they do not understand ( and should continue processing if the extension is marked as non-critical) mozila::pkix has this behavior.
...And 7 more matches
Embedded Dialog API
posing gecko dialogs in embedding applications problem statement an application embedding gecko cannot tightly control its own windows and still allow gecko to be a fully functional web browser.
...the complete windowing portion of the api is large and complex, but it need not be entirely implemented.
...however while xul dialogs are very configurable, they will not behave and probably not look precisely like dialogs which the application builds for itself, independently of gecko.
...And 7 more matches
Interfacing with the XPCOM cycle collector
if the collector finds a group of objects that all refer back to one another, and establishes that the objects' reference counts are all accounted for by internal pointers within the group, it considers that group cyclical garbage, which it then attempts to free.
... note that the collector also knows how to walk through the js heap, and can locate ownership cycles that pass in and out of it.
... it does not suspect any pointers by default; objects must suspect themselves, typically by using an nscyclecollectingautorefcnt rather than a nsautorefcnt.
...And 7 more matches
mozIJSSubScriptLoader
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.
... any top-level functions or variables created by the loaded script via var are created as properties of the targetobj target object (but things declared via let and const are not).
... note: this method must only be called from javascript!
...And 7 more matches
nsIAsyncInputStream
if the stream implements nsiasyncinputstream, then the caller can use this interface to request an asynchronous notification when the stream becomes readable or closed (via the asyncwait() method).
... while this interface is almost exclusively used with non-blocking streams, it is not necessary that nsiinputstream.isnonblocking() return true.
...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).
...And 7 more matches
nsIAsyncOutputStream
if the stream implements nsiasyncoutputstream, then the caller can use this interface to request an asynchronous notification when the stream becomes writable or closed (via the asyncwait() method).
... while this interface is almost exclusively used with non-blocking streams, it is not necessary that nsioutputstream.isnonblocking() return true.
...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).
...And 7 more matches
nsIClipboardDragDropHooks
rs who want to have these hooks made available should implement nsiclipboarddragdrophooks and use the command manager to send the appropriate commands with these parameters/settings: command: cmd_clipboarddragdrophook params value type possible values "addhook" isupports nsiclipboarddragdrophooks as nsisupports "removehook" isupports nsiclipboarddragdrophooks as nsisupports note: overrides/hooks need to be added to each window (as appropriate).
... adding them to the first window does not enable them for every window.
...adding the same hook to the same window will not add a second call.
...And 7 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.
...roughly equivalent to body.contenteditable domain domstring initially the host name of the document's url, but may be changed to the parent (but not top-level) domain in order to facilitate data exchange between documents from different sites in the same domain.
...obsolete since gecko 6.0 methods captureevents() provided for compatibility with netscape 4.x, but does not actually do anything.
...And 7 more matches
getFile
xpcom file system aliases apersistent [out] this output parameter indicates to the caller whether or not the returned location is persistent.
...if false, then the directory service will not cache the results of this method.
... c constant string value notes ns_os_home_dir "home" ns_os_temp_dir "tmpd" ns_os_current_working_dir "curworkd" ns_os_desktop_dir "desk" otherwise same as home ns_os_current_process_dir "curprocd" ns_xpcom_current_process_dir "xcurprocd" can be overriden by passing a "bin directory" to ns_initxpcom2().
...And 7 more matches
nsIDownloadProgressListener
it is important to note that there is no service for this listener.
...this parameter will not be null.
...this parameter will not be null.
...And 7 more matches
nsIEffectiveTLDService
therefore, if you call getpublicsuffix("a.b.c.nonexistent"), you will get back "nonexistent" - this "tld" is not in the public suffix list, but the implicit "*" rule means that it is returned.
... it is not recommended to use this interface for determining whether a given string "is a domain name".
...depends who you ask - for some people it is, others not.
...And 7 more matches
nsIMsgHeaderParser
note that some of the strings may be zero-length.
... either of the provided pointers may be null if the caller is not interested in those components.
...this param may be null if the caller does not want this part of the result.
...And 7 more matches
nsINavHistoryResultViewer
toolkit/components/places/public/nsinavhistoryservice.idlscriptable lets nsinavhistoryresult instances notify places views of changes in the results.
... note: most methods in this interface were renamed in gecko 1.9.2, and others have slightly different parameter lists.
... method overview void containerclosed(in nsinavhistorycontainerresultnode acontainernode); void containeropened(in nsinavhistorycontainerresultnode acontainernode); void invalidatecontainer(in nsinavhistorycontainerresultnode acontainernode); void nodeannotationchanged(in nsinavhistoryresultnode anode, in autf8string aannoname); void nodedateaddedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodelastaddedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodehistorydetailschanged(in nsinavhistoryresultnode anode, in prtime anewvisitdate, in unsigned long anewaccesscount); void nodeiconchanged(in nsinavhistoryresultnode anode); void nodekeywordchanged(in nsinavhisto...
...And 7 more matches
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.
...And 7 more matches
nsISocketTransport
inherits from: nsitransport last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: connection setup is triggered by opening an input or output stream, it does not start on its own.
... completion of the connection setup is indicated by a status_connected_to notification to the event sink (if set).
... securitycallbacks nsiinterfacerequestor security notification callbacks passed to the secure socket provider via nsisslsocketcontrol at socket creation time.
...And 7 more matches
nsIVariant
arrays and interface pointers cannot be converted to a string.
...(reference counted elements are not cloned, but their reference count is increased.) return value native code only!getasastring astring getasastring(); parameters none.
...arrays and interface pointers cannot be converted to a string.
...And 7 more matches
nsIXULWindow
when the window is destroyed, it will fire a "xul-window-destroyed" notification through the global observer service.
... note: that this is a docshell tree item and therefore can not be assured of what object it is.
... highestz 9 methods addchildwindow() tell this window that it has picked up a child xul window.note that xul windows do not currently track child xul windows.
...And 7 more matches
XPCOM
the majority of xpcom components are not part of this core set and are provided by other parts of the platform (e.g.
...this article will show you how to use the available interfaces in several mozilla products.aggregating the in-memory datasourcealready_addrefedalready_addrefed in association with nscomptr allows you to assign in a pointer without addrefing it.binary compatibilityif mozilla decides to upgrade to a compiler that does not have the same abi as the current version, any built component may fail.
...if you have a class that you think is involved in a cyclical-ownership leak, this page is for you.introduction to xpcom for the domwarning: this document has not yet been reviewed by the dom gurus, it might contain some errors.language bindingsan xpcom language binding is a bridge between a particular language and xpcom to provide access to xpcom objects from that language, and to let modules written in that language be used as xpcom objects by all other languages for which there are xpcom bindings.monitoring http activitygecko includes the nsihttpactivit...
...And 7 more matches
nsIMsgCloudFileProvider
this url should not point to external web content.
...this url should not point to external web content.
...if this value is not known, returns -1.
...And 7 more matches
Using the Mozilla symbol server
note that because mozilla release builds are heavily optimized, debugging is not always easy.
... the debugger will not be able to show you the content of all variables and the execution path can seem strange because of inlining, tail calls, and other compiler optimizations.
...you cannot visit this url directly: you must add it to the symbol path of your debugging tool.
...And 7 more matches
Standard OS Libraries
standard libraries offer the advantage of not having to ship anything.
...windows also has the "winapilists" and ".net framework" (i'm not sure if it can be accessed jsctypes but probably).
... components.utils.import("resource://gre/modules/ctypes.jsm"); var lib = ctypes.open("user32.dll"); /* note: if you go to getcursorpos page on msdn, it says first argument is of structure point, so lets create that structure, * the link here shows that that x and y are type long which is ctypes.long */ // https://msdn.microsoft.com/en-us/library/windows/desktop/dd162805%28v=vs.85%29.aspx var point = new ctypes.structtype("tagpoint", [ { "x": ctypes.long }, { "y": ctypes.long } ]); /* declare th...
...And 7 more matches
UInt64
note: it's important to note that the 64-bit integer objects created by uint64 are not uint64 objects; rather, they're opaque objects whose values you manipulate through the other methods on the uint64 object.
...this may be specified as an integer (if the value can be represented as a 32-bit value), another 64-bit integer object (either signed or unsigned), or as a string, which may consist of an optional minus sign, followed by either a decimal number or "0x" or "0x" followed by a hexadecimal number.
... exceptions thrown typeerror the specified value cannot be converted into a 64-bit integer.
...And 7 more matches
DOM Inspector internals - Firefox Developer Tools
at the top of each panel is a toolbar which contains a menu button allowing you to choose which viewer to display from the viewer list, a label displaying the name of the currently active viewer, and another menu button allowing you to issue viewer-specific commands.
... viewers are dynamically loaded; when the panel is made to switch from one viewer to another, the old viewer is destroyed, and the new viewer is loaded in its place.
...another convenient consequence of this is that if you use a properly set up development profile, then for the most part, the effects of development changes can be seen by simply switching away from the current viewer and back.
...And 7 more matches
Debugger.Source - Firefox Developer Tools
please note at the time of this writing, support for webassembly is very preliminary.
...if the behavior does not differ, no such emphasized headings will appear.
...for scripts created by eval or the function constructor, this may be a synthesized filename, starting with a valid url and followed by information tracking how the code was introduced into the system; the entire string is not a valid url.
...And 7 more matches
Settings - Firefox Developer Tools
new tools are often included in firefox but not enabled by default.
... note that in firefox 52 we removed the checkbox to toggle the "select element" button.
...there's just one of these: enable persistent logs a setting to control whether or not the web console and network monitor clear their output when you navigate to a new page.
...And 7 more matches
AudioNode.connect() - Web APIs
WebAPIAudioNodeconnect
the connect() method of the audionode interface lets you connect one of the node's outputs to a target, which may be either another audionode (thereby directing the sound data to the specified node) or an audioparam, so that the node's output data is automatically used to change the value of that parameter over time.
...it is possible to connect an audionode to another audionode, which in turn connects back to the first audionode, creating a cycle.
...otherwise, a notsupportederror exception is thrown.
...And 7 more matches
BiquadFilterNode - Web APIs
number of inputs 1 number of outputs 1 channel count mode "max" channel count 2 (not used in the default count mode) channel interpretation "speakers" constructor biquadfilternode() creates a new instance of a biquadfilternode object.
... note: though the audioparam objects returned are read-only, the values they represent are not.
... not used highpass standard second-order resonant highpass filter with 12db/octave rolloff.
...And 7 more matches
CSSCounterStyleRule - Web APIs
if the descriptor was not specified in the associated rule, the attribute returns an empty string.
...if the descriptor was not specified in the associated rule, the attribute returns an empty string.
...if the descriptor was not specified in the associated rule, the attribute returns an empty string.
...And 7 more matches
Using the CSS properties and values API - Web APIs
the css properties and values api — part of the css houdini umbrella of apis — allows the registration of css custom properties, allowing for property type checking, default values, and properties that do or do not inherit their value.
... note: the javascript option has working implementations.
... the css option does not.
...And 7 more matches
Document.requestStorageAccess() - Web APIs
if the sub frame is not sandboxed, skip to step 7.
... if the sub frame's parent frame is not the top frame, reject.
... if the browser is not processing a user gesture, reject.
...And 7 more matches
EffectTiming.fill - Web APIs
WebAPIEffectTimingfill
the web animations api's effecttiming dictionary's fill property specifies a fill mode, which defines how the element to which the animation is applied should look when the animation sequence is not actively running, such as before the time specified by iterationstart or after animation's end time.
... for example, setting fill to "none" means the animation's effects are not applied to the element if the current time is outside the range of times during which the animation is running, while "forwards" ensures that once the animation's end time has been passed, the element will continue to be drawn in the state it was in at its last rendered frame.
... note that authors are discouraged from using fill modes to persist the effect of an animation indefinitely.
...And 7 more matches
FileError - Web APIs
WebAPIFileError
note: this interface is obsolete per the latest specification.
... error callbacks are not optional for your sanity although error callbacks are optional, you should include them in the arguments of the methods for the sake of the sanity of your users.
... don't run your app from file:// for security reasons, browsers do not allow you to run your app from file://.
...And 7 more matches
FileException - Web APIs
basic concepts synchronous apis do not have error callbacks, which makes it difficult to catch errors.
... constants note: do not rely on the numeric values of the constants, which might change as the specifications continue to change.
... invalid_modification_err 9 the modification requested is not allowed.
...And 7 more matches
FileSystemDirectoryEntry.getFile() - Web APIs
options optional an object based on the filesystemflags dictionary, which allows you to specify whether or not to create the entry if it's missing and if it's an error if the file already exists.
... these options are currently not useful in web contexts.
...the {domxref("fileerror.code")}} specifies what type of error occurred, as follows: fileerror.not_found_err the create option was not specified (or was specified as false), and the file doesn't exist.
...And 7 more matches
FileSystemDirectoryEntry.removeRecursively() - Web APIs
the fileerror.code specifies what type of error occurred, as follows: fileerror.invalid_modification_err an attempt was made to remove the root directory; this is not permitted.
... fileerror.not_found_err the directory represented by the filesystemdirectoryentry no longer exists.
... fileerror.not_readable_err the directory is not accessible; perhaps it's in use by another application or is locked at the operating system level.
...And 7 more matches
Dragging and Dropping Multiple Items - Web APIs
this processing does not use the datatransferitem interface nor the datatransferitemlist interface.
...you should add them in order starting with 0 as you cannot add items at positions farther than the last item, however you can replace existing items by using indices you have already added.
...although not required, you should always add the same formats for each item.
...And 7 more matches
Using the Media Capabilities API - Web APIs
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.
... note: the display capabilities functionality mentioned in the third point above have not yet appeared in any browser.
...you can, therefore, test for the presence of the api like so: if ("mediacapabilities" in navigator) { // mediacapabilities is available } else { // mediacapabilities is not available } taking video as an example, to obtain information about video decoding abilities, you create a video decoding configuration which you pass as a parameter to mediacapabilities.decodinginfo() method.
...And 7 more matches
Capabilities, constraints, and settings - Web APIs
historically, writing scripts for the web that work intimately with web apis has had a well-known challenge: often, your code needs to know whether or not an api exists and if so, what its limitations are on the user agent it's running on.
... figuring this out has often been difficult, and has usually involved looking at some combination of which user agent (or browser) you're running on, which version it is, looking to see if certain objects exist, trying to see whether various things work or not and determining what errors occur, and so forth.
...this may not represent the actual current state of the track, due to properties whose requested values had to be adjusted and because platform default values aren't represented.
...And 7 more matches
Node.insertBefore() - Web APIs
WebAPINodeinsertBefore
(that is, it will automatically be removed from its existing parent before appending it to the specified new parent.) this means that a node cannot be in two locations of the document simultaneously.
... note: the node.clonenode() 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.
...And 7 more matches
Page Visibility API - Web APIs
with tabbed browsing, there is a reasonable chance that any given webpage is in the background and thus not visible to the user.
... notes: the page visibility api is especially useful for saving resources and improving performance by letting a page avoid performing unnecessary tasks when the document isn't visible.
... when the user minimizes the window or switches to another tab, the api sends a visibilitychange event to let listeners know the state of the page has changed.
...And 7 more matches
Pointer Lock API - Web APIs
the pointer lock api (formerly called mouse lock api) provides input methods based on the movement of the mouse over time (i.e., deltas), not just the absolute position of the mouse cursor in the viewport.
...game players can now click buttons and swipe the mouse cursor back and forth without worrying about leaving the game play area and accidentally clicking another application that would take mouse focus away from the game.
...pointer lock is different from mouse capture in the following ways: it is persistent: pointer lock does not release the mouse until an explicit api call is made or the user uses a specific release gesture.
...And 7 more matches
Push API - Web APIs
WebAPIPush API
the push api gives web applications the ability to receive messages pushed to them from a server, whether or not the web app is in the foreground, or even currently loaded, on a user agent.
... this lets developers deliver asynchronous notifications and updates to users that opt in, resulting in better engagement with timely new content.
...when the service worker is active, it can subscribe to push notifications, using pushmanager.subscribe().
...And 7 more matches
SVGTransformList - Web APIs
note: starting in gecko 9.0,the svgtransformlist dom interface is now indexable and can be accessed like arrays interface overview also implement none methods void clear() svgtransform initialize(in svgtransform newitem) svgtransform getitem(in unsigned long index) svgtransform insertitembefore(in svgtransform newitem, in unsigned long index) svgtransform replaceitem(in svgtransform newitem, in unsigned long index) svgtransform removeitem(in unsigned long index) svgtransform appenditem(i...
...the inserted item is the item itself and not a copy.
...the returned item is the item itself and not a copy.
...And 7 more matches
Sensor APIs - Web APIs
sensors may or may not correspond exactly to a physical device sensor.
...the presence of a sensor api does not tell you whether that api is connected to a real hardware sensor, whether that sensor works, if it's still connected, or even whether the user has granted access to it.
...notice that detection through the navigator interface is not one of the available options.
...And 7 more matches
Lifetime of a WebRTC session - Web APIs
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 network’s address is changed by nat and/or dhcp.
... for developers trying to do peer-to-peer networking, this introduces a conundrum: without a unique identifier for every user device, it’s not possible to instantly and automatically know how to connect to a specific device on the internet.
...the most important thing to know about the signaling process for webrtc: it is not defined in the specification.
...And 7 more matches
Lighting a WebXR setting - Web APIs
and while this article provides brief reminders as to how lighting works in general, it is not by any means a tutorial in lighting or a guide to how to create a properly-lit 3d scene.
...note the total lack of any shading to indicate the depth of the sphere.
... directional light sources a directional light source is a light source that comes from a specific direction, but not from a specific source, so its emitted light rays are parallel to one another.
...And 7 more matches
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
to accomplish this, software needs the ability to not only track the locations, orientation, and movements of objects in the virtual world, but the user's location, orientation, and movement as well.
... note: this article presumes that you are familiar with the concepts introduced in geometry and reference spaces in webxr: that is, the basics of 3d coordinate systems, as well as webxr spaces, reference spaces, and how reference spaces are used to create local coordinate systems for individual objects or movable components within a scene.
... representing a position using a reference space as covered in defining spatial relationships with reference spaces in geometry and reference spaces in webxr, reference spaces establish a local coordinate system which is offset from another coordinate system that is itself defined by some other space.
...And 7 more matches
Using the Web Animations API - Web APIs
the css version here’s a tumbling animation written in css showing alice falling down the rabbit hole that leads to wonderland (see the full code on codepen): notice that the background moves, alice spins, and her color changes at an offset from her spinning.
...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.
...if your keyframe list has only one entry, element.animate() may throw a notsupportederror exception in some browsers until they are updated.
...And 7 more matches
Basic concepts behind Web Audio API - Web APIs
channel notation the number of audio channels available on a signal is frequently presented in a numeric format, such as 2.0 or 5.1.
... this is called channel notation.
... audio data: what's in a sample when an audio signal is processed, sampling means the conversion of a continuous signal to a discrete signal; or put another way, a continuous sound wave, such as a band playing live, is converted to a sequence of samples (a discrete-time signal) that allow a computer to handle the audio in distinct blocks.
...And 7 more matches
XMLHttpRequest - Web APIs
140" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="511" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">xmlhttprequest</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} despite its name, xmlhttprequest can be used to retrieve any type of data, not just xml.
... xmlhttprequest.responsetext read only returns a domstring that contains the response to the request as text, or null if the request was unsuccessful or has not yet been sent.
... xmlhttprequest.responsexml read only returns a document containing the response to the request, or null if the request was unsuccessful, has not yet been sent, or cannot be parsed as xml or html.
...And 7 more matches
msRegionOverflow - 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.
... the msregionoverflow read-only property determines if content fully fits into the region or not.
...And 7 more matches
Using the aria-hidden attribute - Accessibility
this can improve the experience for assistive technology users by hiding: purely decorative content, such as icons or images duplicated content, such as repeated text offscreen or collapsed content, such as menus according to the fourth rule of aria, aria-hidden="true" should not be used on a focusable element.
... additionally, since this attribute is inherited by an element's children, it should not be added onto the parent or ancestor of a focusable element.
... using aria-hidden="false" will not re-expose the element to assistive technology if any of its parents specify aria-hidden="true".
...And 7 more matches
Using the aria-invalid attribute - Accessibility
the aria-invalid attribute is used to indicate that the value entered into an input field does not conform to the format expected by the application.this may include formats such as email addresses or telephone numbers.
... aria-invalid can also be used to indicate that a required field has not been filled in.the attribute should be programmatically set as a result of a validation process.
... this attribute can be used with any typical html form element; it is not limited to elements that have an aria role assigned.
...And 7 more matches
ARIA: application role - Accessibility
description the application role indicates to assistive technologies that this part of the web content contains elements that do not conform to any other known html element or wai-aria widget.
... in this mode, the web author is completely responsible for handling any and all keyboard input, focus management, and other interactions and cannot assume assistive technologies would do any processing on their end.
... for all of this to work, ats intercept almost all keyboard input and consume it themselves, letting nothing through to the browser or other user agent.
...And 7 more matches
ARIA: grid role - Accessibility
while it does not imply a specific visual presentation, it implies a relationship among elements.
... aria-readonly if the user can navigate the grid but not change the value or values of the grid, the aria-readonly should be set to true.
...if focus is on the right-most cell in the row, focus does not move.
...And 7 more matches
An overview of accessible web applications and widgets - Accessibility
stock tickers, live twitter feed updates, progress indicators, and similar content modify the dom in ways that an assistive technology (at) may not be aware of.
...--> <ol role="tablist"> <li id="ch1tab" role="tab"> <a href="#ch1panel">chapter 1</a> </li> <li id="ch2tab" role="tab"> <a href="#ch2panel">chapter 2</a> </li> <li id="quiztab" role="tab"> <a href="#quizpanel">quiz</a> </li> </ol> <div> <!-- notice the role and aria-labelledby attributes we've added to describe these panels.
...examples include (but are certainly not limited to): aria-checked: indicates the state of a checkbox or radio button aria-disabled: indicates that an element is visible, but not editable or otherwise operable aria-grabbed: indicates the 'grabbed' state of an object in a drag-and-drop operation (for a full list of aria states, consult the aria list of states and properties.) developers should use aria states to indicate the stat...
...And 7 more matches
system - CSS: Cascading Style Sheets
at least one symbol must be specified in the symbols descriptor, or the counter style is not valid.
...at least one symbol must be specified in the symbols descriptor or the counter style is not valid.
...at least one symbol must be specified in the symbols descriptor or the counter style is not valid.
...And 7 more matches
@font-feature-values - CSS: Cascading Style Sheets
syntax feature value blocks @swash specifies a feature name that will work with the swash() functional notation of font-variant-alternates.
... @annotation specifies a feature name that will work with the annotation() functional notation of font-variant-alternates.
... an annotation feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't.
...And 7 more matches
Spanning and Balancing Columns - CSS: Cascading Style Sheets
note the spanning and balancing functionality covered in this guide is not as well supported across browsers as the functionality covered in the previous two sections in this guide.
...the content does not jump over a spanning element.
...the value none is the initial value and means the item does not span, remaining within a column.
...And 7 more matches
Using feature queries - CSS: Cascading Style Sheets
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.
... testing for lack of support in addition to asking the browser if it supports a feature, you can test for the opposite by adding in the not keyword: @supports not (property: value) { css rules to apply } the css inside the following example feature query will run if the browser does not support row-gap.
...therefore feature queries cannot be used to check if a browser supports a thing properly, and without bugs!
...And 7 more matches
Basic concepts of flexbox - CSS: Cascading Style Sheets
start and end lines another vital area of understanding is how flexbox makes no assumption about the writing mode of the document.
... you can read more about the relationship between flexbox and the writing modes specification in a later article; however, the following description should help explain why we do not talk about left and right and top and bottom when we describe the direction that our flex items flow in.
... the items do not stretch on the main dimension, but can shrink.
...And 7 more matches
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
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.
...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.
...as long as flex-shrink has a positive value the items will shrink in order that they do not overflow the container.
...And 7 more matches
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
in the code snippet below, the item is placed 20 pixels from the top, and 30 pixels from the left of the container: .container { position: relative; } .item { position: absolute; top: 20px; left: 30px; } <div class="container"> <div class="item">item</div> </div> another place you might see physical keywords in use, is when using text-align: right to align text to the right.
... logical properties and values logical properties and values do not make an assumption about text direction.
... css writing modes i’m going to introduce another specification here, that i will be using in my examples: the css writing modes specification.
...And 7 more matches
WebKit CSS extensions - CSS: Cascading Style Sheets
webkit-only properties note: avoid using on websites.
... 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 properties instead of the prefixed ones listed below.
...ation -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.
...And 7 more matches
image-set() - CSS: Cascading Style Sheets
WebCSSimage-set
the image-set() css function notation is a method of letting the browser pick the most appropriate css image from a given set, primarily for high pixel density screens.
...the image-set() function can not be nested inside another image-set() function.
... accessibility concerns browsers do not provide any special information on background images to assistive technology.
...And 7 more matches
The HTML autocomplete attribute - HTML: Hypertext Markup Language
in order to provide autocompletion, user-agents might require <input>/<select>/<textarea> elements to: have a name and/or id attribute be descendants of a <form> element the form to have a submit button values "off" the browser is not permitted to automatically enter or select a value for this field.
... it is possible that the document or application provides its own autocomplete feature, or that security concerns require that the field's value not be automatically entered.
... note: in most modern browsers, setting autocomplete to "off" will not prevent a password manager from asking the user if they would like to save username and password information, or from automatically filling in those values in a site's login form.
...And 7 more matches
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.
...if the attribute is not included, the :read-write pseudo class will match.
...And 7 more matches
Date and time formats used in HTML - HTML: Hypertext Markup Language
are not supported, so html doesn't support years 1 b.c.e.
... leap years a leap year is any year which is divisible by 400 or the year is divisible by 4 but not by 100.
... week and year (date range) 2001-w37 week 37, 2001 (september 10-16, 2001) 1953-w01 week 1, 1953 (december 29, 1952-january 4, 1953) 1948-w53 week 53, 1948 (december 27, 1948-january 2, 1949) 1949-w01 week 1, 1949 (january 3-9, 1949) 0531-w16 week 16, 531 (april 13-19, 531) 0042-w04 week 4, 42 (january 21-27, 42) note that both the year and week numbers are padded with leading zeroes, with the year padded to four digits and the week to two.
...And 7 more matches
<input type="image"> - HTML: Hypertext Markup Language
WebHTMLElementinputimage
value none — the value attribute should not be specified.
... value <input type="image"> elements do not accept value attributes.
...et a string indicating a browsing context from where to load the results of submitting the form height the height, in css pixels, at which to draw the image src the url from which to load the image width the width, in css pixels, at which to draw the image alt the alt attribute provides an alternate string to use as the button's label if the image cannot be shown (due to error, a user agent that cannot or is configured not to show images, or if the user is using a screen reading device).
...And 7 more matches
<rb>: The Ruby Base element - HTML: Hypertext Markup Language
WebHTMLElementrb
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.
... tag omission the end tag can be omitted if the element is immediately followed by an <rt>, <rtc>, or <rp> element or another <rb> element, or if there is no more content in the parent element.
...And 7 more matches
<select>: The HTML Select element - HTML: Hypertext Markup Language
WebHTMLElementselect
disabled this boolean attribute indicates that the user cannot interact with the control.
... 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 attribute set, then the control is enabled.
...(if this attribute is not set, the <select> is associated with its ancestor <form> element, if any.) this attribute lets you associate <select> elements to <form>s anywhere in the document, not just inside a <form>.
...And 7 more matches
<tbody>: The Table Body element - HTML: Hypertext Markup Language
WebHTMLElementtbody
tag omission the <tbody> element is not a required child element for a parent <table> element to graphically render.
... however, it must not be present, if its parent <table> element has a <tr> element as a child.
... if this attribute is not set, the left value is assumed.
...And 7 more matches
<tfoot>: The Table Foot element - HTML: Hypertext Markup Language
WebHTMLElementtfoot
note that this is the requirement as of html5.
... html 4 the <tfoot> element cannot be placed after any <tbody> and <tr> element.
... note that this directly contradicts the above normative requirement from html5.
...And 7 more matches
Content Security Policy (CSP) - HTTP
WebHTTPCSP
malicious scripts are executed by the victim's browser because the browser trusts the source of the content, even when it's not coming from where it seems to be coming from.
...a complete data transmission security strategy includes not only enforcing https for data transfer, but also marking all cookies with the secure attribute and providing automatic redirects from http pages to their https counterparts.
... content-security-policy: default-src 'self'; img-src *; media-src media1.com media2.com; script-src userscripts.example.com here, by default, content is only permitted from the document's origin, with the following exceptions: images may load from anywhere (note the "*" wildcard).
...And 7 more matches
Accept-Encoding - HTTP
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.
...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, microsoft recommends not to compress if a server uses more than 80% of its computational power.
...And 7 more matches
Large-Allocation - HTTP
when a post request is used to load a document, that load cannot currently be redirected into a new process.
... this error means that the document was not loaded at the top level of an user-opened or noopener-opened tab or window.
...firefox cannot move an iframe into a new process currently, so the document must load in the current process.
...And 7 more matches
Equality comparisons and sameness - JavaScript
note that the distinction between these all have to do with their handling of primitives; none of them compares whether the parameters are conceptually similar in structure.
...if the values have the same type, are not numbers, and have the same value, they're considered equal.
... finally, if both values are numbers, they're considered equal if they're both not nan and are the same value, or if one is +0 and one is -0.
...And 7 more matches
The arguments object - JavaScript
description note: if you're writing es6 compatible code, then rest parameters should be preferred.
... note: “array-like” means that arguments has a length property and properties indexed from zero, but it doesn't have array's built-in methods like foreach() or map().
... for example, if a function is passed 3 arguments, you can access them as follows: arguments[0] // first argument arguments[1] // second argument arguments[2] // third argument each argument can also be set or reassigned: arguments[1] = 'new value'; the arguments object is not an array.
...And 7 more matches
FinalizationRegistry - JavaScript
(cleanup callbacks are sometimes called finalizers.) note: cleanup callbacks should not be used for essential program logic.
... see notes on cleanup callbacks for details.
...}); then you register any objects you want a cleanup callback for by calling the `register` method, passing in the object and a *held value* for it: registry.register(theobject, "some value"); the registry does not keep a strong reference to the object, as that would defeat the purpose (if the registry held it strongly, the object would never be reclaimed).
...And 7 more matches
Number.prototype.toFixed() - JavaScript
the tofixed() method formats a number using fixed-point notation.
... return value a string representing the given number using fixed-point notation.
...values between 0 and 100, inclusive, will not cause a rangeerror.
...And 7 more matches
String - JavaScript
creating strings strings can be created as primitives, from string literals, or as objects, using the string() constructor: const string1 = "a string primitive"; const string2 = 'also a string primitive'; const string3 = `yet another string primitive`; const string4 = new string("a string object"); string primitives and string objects can be used interchangeably in most situations.
...the first is the charat() method: return 'cat'.charat(1) // returns "a" the other way (introduced in ecmascript 5) is to treat the string as an array-like object, where individual characters correspond to a numerical index: return 'cat'[1] // returns "a" when using bracket notation for character access, attempting to delete or assign a value to these properties will not succeed.
... note that a == b compares the strings in a and b for being equal in the usual case-sensitive way.
...And 7 more matches
undefined - JavaScript
(even when this is not the case, avoid overriding it.) a variable that has not been assigned a value is of type undefined.
... a method or statement also returns undefined if the variable that is being evaluated does not have an assigned value.
... a function returns undefined if a value was not returned.
...And 7 more matches
import - JavaScript
the static import statement is used to import read only live bindings which are exported by another module.
... imported modules are in strict mode whether you declare them as such or not.
... the import statement cannot be used in embedded scripts unless such script has a type="module".
...And 7 more matches
Animation performance and frame rate - Web Performance
the performance cost of animating a css property can vary from one property to another, and animating expensive css properties can result in jank as the browser struggles to hit a smooth frame rate.
... for animated media, such as video and animated gifs, the main performance concern is file size - downloading the file size fast enough to not negatively impact performance is the greatest issue.
...animation can help make a site feel faster and responsive, but animations can also make a site feel slower and janky if not done correctly.
...And 7 more matches
Navigation and resource timings - Web Performance
if there is no redirect, or if one of the redirects is not of the same origin, the value returned is 0.
...if there is no redirect, or if one of the redirects is not of the same origin, the value returned is 0.
...if there is no previous document, or if the previous document or one of the needed redirects is not of the same origin, the value returned is 0.
...And 7 more matches
Introduction to progressive web apps - Progressive web apps (PWAs)
it's not a brand new concept—such ideas have been revisited many times on the web platform with various approaches in the past.
... as we hinted at above, pwas are not created with a single technology.
...it's not that obvious if a web app is a pwa or not from first glance.
...And 7 more matches
An Overview - XSLT: Extensible Stylesheet Language Transformations
so the model for transformation is that one xml document is used to transform another xml document.
...despite the fact that very often namespaces appear to be uris, they do not, in fact, refer to a resource located at that address.
...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.
...And 7 more matches
Compiling from Rust to WebAssembly - WebAssembly
they may not even notice that it's written in webassembly.
... note: pay attention to the post-install note about needing cargo's bin directory in your system path.
... wasm-pack uses wasm-bindgen, another tool, to provide a bridge between the types of javascript and rust.
...And 7 more matches
SDK API Lifecycle - Archive of obsolete content
developers using the sdk's apis need to know how far they can trust that a given api will not change in future releases.
...the sdk uses only four of the six values defined by node.js: experimental the module is not yet stabilized.
... unstable the api is in the process of settling, but has not yet had sufficient real-world testing to be considered stable.
...And 6 more matches
Implementing the widget - Archive of obsolete content
we want the widget to do two things: on a left-click, the widget should activate or deactivate the annotator.
... on a right-click, the widget should display a list of all the annotations the user has created.
... because the widget's click event does not distinguish left and right mouse clicks, we'll use a content script to capture the click events and send the corresponding message back to our add-on.
...And 6 more matches
Developing for Firefox Mobile - Archive of obsolete content
right now not all modules are fully functional, but we're working on adding support for more modules.
... when you need to run the add-on, first ensure that firefox is not running on the device.
... 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.mozilla.fennec/.app (has extras) } --------- beginning of /dev/log/main --------- beginning of /dev/log/system could not read chrome manifest 'file:///data/data/org.mozilla.fennec/chrome.manifest'.
...And 6 more matches
Finding window handles - Archive of obsolete content
note: starting in gecko 17.0, nsibasewindow.nativehandle provides the handle (hwnd [widows], gdkwindow* [linux], nswindow* [macosx],...) of a top-level window, for all plateforms, as a string.
... note: starting in gecko 2.0, only the top level browser window has an hwnd.
... web content windows (in tabs) do not have their own hwnds.
...And 6 more matches
Label and description - Archive of obsolete content
line breaking under normal conditions, a description will not break long-running text and the text may be cropped or hidden.
... to cause the text to wrap: ensure the long-running text is a text node child of <description/> or <label/> (i.e., do not specify the long-running text in the value attribute of these elements).
...absolutely nothing!</description> with white-space: pre; all whitespace, including newlines, is rendered literally.
...And 6 more matches
Multiple item extension packaging - Archive of obsolete content
from the release of firefox 53, multiple item extension packages are no longer supported and will not load.
...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.
... install.rdf a multiple item package does not have the same requirements as an extension for its install.rdf.
...And 6 more matches
Appendix A: Add-on Performance - Archive of obsolete content
note: see the newer article performance best practices in extensions for more up-to-date information about how to optimize the performance of your add-on.
... add-ons can have a noticeable performance impact on firefox.
... startup this is the area where add-ons have the most noticeable impact.
...And 6 more matches
Appendix F: Monitoring DOM changes - Archive of obsolete content
unfortunately, adding listeners for any of these events to a document has a highly deleterious effect on performance, an effect which is not mitigated in the slightest by later removing those listeners.
...this document lays out some alternatives which do not have such severe performance impacts.
...while these are not exceptionally efficient (they run for every http request, and considerably more often for some methods), they work very well for certain applications pure css pure css can be more powerful than most people suspect.
...And 6 more matches
Connecting to Remote Content - Archive of obsolete content
request.open("post", url, true); request.setrequestheader("content-type", "application/x-www-form-urlencoded"); request.send("data=hello&version=2"); the third parameter for the open method specifies whether the request should be handled asynchronously or not.
... note: requests can take a long time to process and you don't want users to be stuck waiting while a request is obtained and processed.
...using xpath to parse a complete xml document is probably not a good idea performance-wise.
...And 6 more matches
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
why not attempt to use technology standards for the web to live out that story?
...we've noted that some of the file size comparison's aren't necessarily fair, because we're not comparing apples to apples-- we're comparing an old design using html, tables, and spacer gifs to a new design much richer in imagery and style.
...now that the content is not locked into a specific table structure, we have much more flexibility in how we present that content.
...And 6 more matches
Creating a Help Content Pack - Archive of obsolete content
this is still very much a work in progress, tho, and i need to complete the rest of it soon (where "complete" means "use what's there that's good, build on the stuff that's not as good, and add other useful information as necessary".
...(we're still not actually to the point where we're describing the actual data in each of these, so we'll just use some filler data for now.) add the following code inside the rdf:description element you just created: <nc:panellist> <rdf:seq> </rdf:seq> </nc:panellist> you'll create the relevant information descriptions within the rdf:seq element.
...iption nc:panelid="toc" nc:datasources="chrome://foo/locale/help/glossary.rdf"/> </rdf:li> <rdf:li> <rdf:description nc:panelid="index" nc:datasources="chrome://foo/locale/help/glossary.rdf"/> </rdf:li> </rdf:seq> the help viewer ui may or may not provide a panel for each of these data sources.
...And 6 more matches
Plug-n-Hack Phase1 - Archive of obsolete content
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.
...And 6 more matches
Reading textual data - Archive of obsolete content
files and network sockets contain bytes, not characters - to give these bytes a meaning, you need to know the character encoding.
...note that not all channels know the character encoding of the data.
...not doing so can cause problems if you try to rename or delete the file at a later time on some platforms.
...And 6 more matches
Frequently Asked Questions - Archive of obsolete content
note: this page is extremely out of date.
... if there's a grey area at the top of the source with the text "this xml file does not appear to have any style information associated with it" then the problem is with the svg file.
...mozilla is strict about this, and no, it's not a bug.
...And 6 more matches
Accessing Files - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes.
...retrieving a file when working with files, usage is always done via a file object and not via string paths.
...And 6 more matches
Working With Directories - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes.
...these directories do not need to exist yet, but they can be created using nsifile.create().
...And 6 more matches
Simple Query Syntax - Archive of obsolete content
simple rdf graph navigation such as this is common, so the simpler syntax is usually used in this situation since it avoids extra tags, although the simple syntax is not more or less efficient, at least when a single query is involved.
...at its simplest, the simple query syntax is equivalent to the following: <query> <content uri="?start"/> <member container="?start" child="?photo"/> </query> the template builder uses the simple query syntax whenever a template does not have a <query> element.
...first, it evaluates the default query as above, except that no variables are used, or at least, not ones that are used externally.
...And 6 more matches
Template Builder Interface - Archive of obsolete content
an element that does not have a builder will have this property set to null.
...note that this particular whitespace issue has been fixed in firefox 3 and later.
... note also that the datasources attribute has been placed on an html element.
...And 6 more matches
Adding Methods to XBL-defined Elements - Archive of obsolete content
you do not need to have any though, in which case the method would take no parameters.
...note that the less-than symbol has to be escaped because otherwise it would look like the start of a tag.
...because mozilla uses javascript as its scripting language, and javascript is a non-typed language, you do not need to specify the types of the parameters.
...And 6 more matches
Creating a Window - Archive of obsolete content
the simplest xul file has the following structure: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <!-- other elements go here --> </window> this window will not do anything since it doesn't contain any ui elements.
...in fact, there will not be shown any window at all.
...because xml does not have any knowledge of how elements should be displayed, the file indicates how.
...And 6 more matches
Features of a Window - Archive of obsolete content
creating another window you can create a second window for your application in the same manner as you would create the first one.
...if you do not add the 'chrome' flag, the file will open up as the content in a browser window.
... for example: var mywin = window.open("chrome://findfile/content/findfile.xul", "findfile", "chrome"); specifying the width and height you should have noticed that whenever elements were added to a window, the window's width expanded to fit the new elements.
...And 6 more matches
Localization - Archive of obsolete content
note: you should encode dtd files as utf-8 for non-ascii characters.
...note that entity declarations do not have a trailing slash at the end of them.
...you should not have any directly displayed text in the xul file at all.
...And 6 more matches
Tabboxes - Archive of obsolete content
there is really nothing special about the tab elements that make them different than boxes.
...they do not go in the tab elements, as that is where the contents of the tabs along the top go.
...that means that if there are ten textboxes on one tab page and only one on another, the tab page will be sized to fit the one with the ten on it as this takes up more room.
...And 6 more matches
Using Remote XUL - Archive of obsolete content
introduction note: support for remote xul has long been a potential security concern; support for it was disabled in gecko 2.0.
... note: the downside to using xul is that it only works with browsers that understand it.
... this isn't a problem inside an organization that uses mozilla-based browsers exclusively, but for other sites you may need to provide another form of navigation as well.
...And 6 more matches
description - Archive of obsolete content
</description> this is a long section of text that will not word wrap <description value="this is a long section of text that will not word wrap"> </description> this is a long section of dynamically controlled text that will word wrap <description id="desc" style="width: 300px"></description> document.getelementbyid('desc').textcontent = "this is a long section of dynamic message text that will word wrap"; attributes crop type: o...
... none the text will be not be cropped using an ellipsis.
...for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
...And 6 more matches
radiogroup - Archive of obsolete content
edindex, selecteditem, tabindex, value methods appenditem, checkadjacentelement, getindexofitem, getitematindex, insertitemat, removeitemat examples <radiogroup> <radio id="orange" label="red"/> <radio id="violet" label="green" selected="true"/> <radio id="yellow" label="blue"/> </radiogroup> attributes disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
... in the case of form elements, it will not be submitted.
...And 6 more matches
tabs - Archive of obsolete content
ArchiveMozillaXULtabs
activating them will not change the selectedindex.
... disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
...And 6 more matches
2006-10-27 - Archive of obsolete content
summary: mozilla.dev.builds - october 21st to october 27th 2006 fx 1.5.0.x (linux) not building since 20-oct-2006 17:45 pdt october 22nd: gavin sharp answered a question that was posted by tony mechelynck.
... firefox 2 wont build under solaris 10 x86 october 26: alex was trying to build firefox 2 source on a solaris 10 x86 machine but was not successful with the build.
...alex is not sure if he is missing a library or if he needs to pass extra options to configure the build.
...And 6 more matches
NPP_NewStream - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary notifies a plug-in instance of a new data stream.
... false: not seekable.
... implementation note: some plugins, notably silverlight, do not set this outparam, and rely on the outparam being initialized to a default np_normal value.
...And 6 more matches
What is RSS - Archive of obsolete content
you will not yet be creating your own rss files, but you will be seeing how rss is commonly used and simple example rss files for these common uses.
...in fact, back then, rss did not stand for really simple syndication but stood for rich site summary.
...like rss 0.90, netscape's rss 0.91 was also a format for providing a summary of a website, and not really a syndication format (as it is today).
...And 6 more matches
Table Reflow Internals - Archive of obsolete content
this is equivalent to preferred size if the avail size is not constrained.
...the reflowee returns a reflow status which indicates if it is complete, and thus not have to continue (split) breaking status (in the case of some inline frames) if there is truncation (it can't fit in the space and can't split).
...a text run) user defined - currently only used for fixed positioned frames kinds of reflows incremental reflow (continued) reflower not allowed to change available size of reflowee reflow commands get coalesced to streamline processing style change a target changed stylistic if there is a target, otherwise every frame may need to respond parent of target usually turns it into an incremental reflow with a style changed command type table frames nstableouter frame ↙ ↘ nstable...
...And 6 more matches
Using IO Timeout And Interrupt On NT - Archive of obsolete content
this technical memo is a cautionary note on using netscape portable runtime's (nspr) io timeout and interrupt on windows nt 3.51 and 4.0.
...if the io operation cannot complete before the specified timeout, the io function returns with <tt>pr_io_timeout_error</tt>.
... if the thread gets interrupted by another thread's <tt>pr_interrupt()</tt> call, the io function returns with <tt>pr_pending_interrupt_error</tt>.
...And 6 more matches
Mozilla XForms Specials - Archive of obsolete content
(limitation tracked in bug 280368) mixing repeat 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> ...
...(limitation tracked in bug 271724) optional parameters in xpath functions optional parameters in xpath functions are not supported, you will have to specify all parameters when calling a function.
...And 6 more matches
Archive of obsolete content
material in this archived content zone should not be used for building new web sites or apps for modern browsers.
... see the complete index of archived content note to writers: we need to try to keep the subpages here organized instead of all dumped into one large folder.
...if anyone might realistically need the information in a living product, it may not be appropriate to move it here.
...And 6 more matches
Game distribution - Game development
an html5 game is just another website.
... if you want to make money out of game dev, you should secure your source code one way or another against people who could easily take it and sell it as their own.
...another good measure to take is to provide an online demo if you're planning on packaging it and selling it in a closed store like itunes or steam.
...And 6 more matches
Game promotion - Game development
developing and publishing your game is not enough.
... competitions taking part in competitions will not only level up your gamedev skills and let you meet new devs to befriend and learn from — and it will also get you involved in the community.
...remember to not be too pushy on telling everyone about your games — you're not a walking advertisement.
...And 6 more matches
Assessment: Accessibility troubleshooting - Learn web development
the finished assessment site should look like so: you will see some differences/issues with the display of the starting state of the assessment — this is mainly due to the differences in the markup, which in turn cause some styling issues as the css is not applied properly.
... note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page.
... semantic html the content is still not very accessible — report on what happens when you try to navigate it using a screenreader.
...And 6 more matches
Organizing your CSS - Learn web development
avoid overly-specific selectors if you create very specific selectors you will often find that you need to duplicate chunks of your css to apply the same rules to another element.
... article.main p.box { border: 1px solid #ccc; } if you then wanted to apply the same rules to something outside of main, or to something other than a <p>, you would have to add another selector to these rules or create a whole new ruleset.
... if you are not taking an oocss approach you might create custom css for the different places this pattern is used, for example creating a class called comment with a bunch of rules for the component parts, then a class called list-item with almost the same rules as the comment class except for some tiny differences.
...And 6 more matches
How CSS works - Learn web development
prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, and html basics (study introduction to html.) objective: to understand the basics of how css and html are parsed by the browser, and what happens when a browser encounters css it does not understand.
... in an earlier lesson i mentioned that browsers do not all implement new css at the same time.
... in addition, many people are not using the latest version of a browser.
...And 6 more matches
What is CSS? - Learn web development
note: a browser is sometimes called a user agent, which basically means a computer program that represents a person inside a computer system.
... browsers are the main type of user agent we think of when talking about css, however, it is not the only one.
... note: you can find links to all the css property pages (along with other css features) listed on the mdn css reference.
...And 6 more matches
What text editors are available? - Learn web development
notice we didn't mention price.
...esso closed source $75 mac faq, e-mail no end user doc, but plug-in doc yes gedit gpl free windows, mac, linux mailing list, irc online manual yes kate lgpl, gpl free windows, mac, linux mailing list, irc online manual yes komodo edit mpl free windows, mac, linux forum online manual yes notepad++ gpl free windows forum wiki yes pspad closed source free windows faq, forum online help yes sublime text closed source $70 windows, mac, linux forum official, unofficial yes textmate closed source $50 mac twitter, irc, mailing list, e-mail online manual, wiki yes textwrangler close...
...gedit if you use gnome desktop, kate if you use kde etc.), if not then you should try installing one or more text editors of your choosing.
...And 6 more matches
What is a URL? - Learn web development
a url is nothing more than the address of a given unique resource on the web.
...alternatively, it is possible to directly use an ip address, but because it is less convenient, it is not often used on the web.
... #somewhereinthedocument is an anchor to another part of the resource itself.
...And 6 more matches
The web and web standards - Learn web development
in 1980, tim berners-lee (often referred to as timbl) wrote a notebook program called enquire, which featured the concept of links between different nodes.
...these documents are not very useful for learning how to use the technologies they describe (this is why we have sites like mdn web docs), but instead are intended to be used by software engineers to implement these technologies (usually in web browsers).
... "open" standards one of the key aspects of web standards, which timbl and the w3c agreed on from the start, is that the web (and web technologies) should be free to both contribute and use, and not encumbered by patents/licensing.
...And 6 more matches
Making asynchronous programming easier with async and await - Learn web development
try typing the following lines into your browser's js console: function hello() { return "hello" }; hello(); the function returns "hello" — nothing special, right?
... here is a trivial example: async function hello() { return greeting = await promise.resolve("hello"); }; hello().then(alert); of course, the above example is not very useful, although it does serve to illustrate the syntax.
... you'll note that we've wrapped the code inside a function, and we've included the async keyword before the function keyword.
...And 6 more matches
Test your skills: Conditionals - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... note: in the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
...if not, it should assign a generic string to response that tells the user we don't know what season it is.
...And 6 more matches
Solve common problems in your JavaScript code - Learn web development
one of the most common errors is to declare the function, but not call it anywhere.
...not inside any functions), or return the value from the function.
... object notation versus normal assignment when you assign something normally in javascript, you use a single equals sign, e.g.: const mynumber = 0; with objects, however, you need to take care to use the correct syntax.
...And 6 more matches
Adding features to our bouncing balls demo - Learn web development
note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page.
... creating our new objects first of all, change your existing ball() constructor so that it becomes a shape() constructor and add a new ball() constructor: the shape() constructor should define the x, y, velx, and vely properties in the same way as the ball() constructor did originally, but not the color and size properties.
... it should also define a new property called exists, which is used to track whether the balls exist in the program (have not been eaten by the evil circle).
...And 6 more matches
Ember interactivity: Events, classes and state - Learn web development
one component's this will be different from another component's this.
... note: a decorator is basically a wrapper function, which wraps and calls other functions or properties, providing additional functionality along the way.
...we know that we want to track both the text of a todo, and whether or not it is is completed.
...And 6 more matches
Componentizing our React app - Learn web development
-label" htmlfor="todo-0"> eat </label> </div> <div classname="btn-group"> <button type="button" classname="btn"> edit <span classname="visually-hidden">eat</span> </button> <button type="button" classname="btn btn__danger"> delete <span classname="visually-hidden">eat</span> </button> </div> </li> ); } note: components must always return something.
... if at any point in the future you try to render a component that does not return anything, react will display an error in your browser.
...your <ul> should read like this: <ul role="list" classname="todo-list stack-large stack-exception" aria-labelledby="list-heading" > <todo /> <todo /> <todo /> </ul> when you look back at your browser, you'll notice something unfortunate: your list now repeats the first task three times!
...And 6 more matches
Adding a new todo form: Vue events, methods, and models - Learn web development
when referenced, methods are fully run, so it's not a good idea to use them to display information inside the template.
...add .prevent to the @submit handler in your template like so: <form @submit.prevent="onsubmit"> if you try submitting the form now, you'll notice that the page doesn't reload.
...do this now: <input type="text" id="new-todo-input" name="new-todo" autocomplete="off" v-model="label" /> note: you can also sync data with <input> values through a combination of events and v-bind attributes.
...And 6 more matches
Old Thunderbird build
windows build prerequisites gnu/linux build prerequisites mac os x build prerequisites get the source note: on windows, you won't be able to build the thunderbird source code if it's under a directory with spaces in the path (e.g., don't use "documents and settings").
... note: parts of the build process also have problems when the source code is in a directory where the path is long (nested many levels deep).
... on linux, this can manifest as problems setting up the virtualenv for running tests (failure to install pip or virtualenv because of os access denied errors, where access is denied not because of permission problems, but because the paths being accessed have been truncated, and so do not exist).
...And 6 more matches
Limitations of frame scripts
however, some apis that work in the chrome process will not work in a frame script.
...therefore frame scripts should not attempt to access the local file system directly, as these calls will fail.
... examples of apis add-on authors should avoid in frame scripts: nsifileinputstream nsifileoutputstream constructing a file from a string or nsifile (but file objects can be sent via message manager) htmlinputelement.mozsetfilenamearray (alternative: mozsetfilearray) xul and browser ui anything that tries to touch the browser ui or anything to do with xul is likely to not work in the content process.
...And 6 more matches
AsyncShutdown.jsm
phase profilebeforechange is guaranteed to not terminate until promise is either resolved or rejected.
...in this case, a crash report is produced, with information on all the shutdown blockers that have not been resolved, and all the additional debug information returned by calls to info().
... instances of phase note that you cannot create an instance of phase yourself.
...And 6 more matches
FileUtils.jsm
the file is not created if it does not exist, however all required directories along the way are.
... shouldcreate optional true if the directory hierarchy specified in patharray should be created if it does not exist, false otherwise.
...if the directory requested does not exist, it is created, along with any parent directories that need to be created.
...And 6 more matches
Bootstrapping a new locale
navigate to that level making sure you are *not* inside mozilla-1.9.x/ and then run the following commands.
... from now on may be needs some corrections, (see expected structure below $cd ab-cd/browser/chrome/browser) may be needs $cp -r mozilla-1.9.x/browser/locales/ ab-cd and then $mv ab-cd/en-us ab-cd/browser and the same for the others the commands seems symbolic and not real ...
... netwerk not error ?
...And 6 more matches
Localization formats
warning: this document pertains to the development of mozilla web sites and not to the development of gecko-based extensions or applications.
...accidentally removes some html like </h1>, that localizer can break everything.) very hard to update automatically, if not impossible.
....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.
...And 6 more matches
gettext
warning: this document pertains to the development of mozilla web sites and not to the development of gecko-based extensions or applications.
...notice that you need to pass the $num variable twice.
... the string definition in the messages.po file will look like this: #: file.php:3 #, php-format msgid "%d user likes this." msgid_plural "%d users like this." msgstr[0] "" msgstr[1] "" depending on the localizer's target language and its rules for creating plural forms, there might be another field for translation, e.g.
...And 6 more matches
Reporting a Performance Problem
using the profiler when enabled, the profiler toolbar button is not recording by default.
...make sure to choose an appropriate setting for the recording (if you're not sure, choose firefox platform), and then choosing "start recording".
...when it runs out of space in its buffer, it discards old entries so you may want to increase the buffer size if you find you are unable to capture the profile quickly enough after you notice a performance problem.
...And 6 more matches
Nonblocking IO In NSPR
(note: <tt>pr_poll()</tt> also works with blocking file descriptors, although it is less useful in the blocking io model.) when <tt>pr_poll()</tt> reports that a file descriptor is ready for some io operation, the central thread invokes that io function on the file descriptor.
...this is not a serious constraint as one can assume that disk i/o never blocks.
...once the io mode of a socket is committed, it cannot be changed.
...And 6 more matches
FIPS Mode - an explanation
(note: mozilla does not distribute a "fips mode"-ready nss with firefox.) this page attempts to provide an informal explanation of what it is, who would use it, and why.
... (fips sounds plural, but is singular; one fips document is a fips, not a fip.) fips documents define rules, regulations, and standards for many aspects of handling of information by computers and by people.
... (note, the current version of fips 140 is revision 2, a.k.a.
...And 6 more matches
EncDecMAC using token object - sample 3
encdecmac using token object example: <h2 id="nss_sample_code_3_hashing.">nss sample code 3: enc/dec/mac using token object id.</h2> <p class="summary">computes the hash of a file and saves it to another file, illustrates the use of nss message apis.</p> <pre class="brush: cpp"> /* this source code form is subject to the terms of the mozilla public * license, v.
...if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/.
...s specify db password [optional]\n\n", "-p "); fprintf(stderr, "%-20s specify db password file [optional]\n\n", "-f "); fprintf(stderr, "%-20s specify noise file name [optional]\n\n", "-z "); fprintf(stderr, "%-21s specify an input file name\n\n", "-i "); fprintf(stderr, "%-21s specify an output file name\n\n", "-o "); fprintf(stderr, "%-7s for encrypt, it takes as an input file and produces\n", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final output file.\n\n", ""); exit(-1); } /* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id,...
...And 6 more matches
NSS tools : pk12util
if the prefix sql: is not used, then the tool assumes that the given databases are in the old format.
...changing the names of the certificate and key databases is not recommended.
... keycipher] [-c certcipher] [-m|--key_len keylen] [-n|--cert_key_len certkeylen] [-d [sql:]directory] [-p dbprefix] [-k slotpasswordfile|-k slotpassword] [-w p12filepasswordfile|-w p12filepassword] for example: # pk12util -o certs.p12 -n server-cert -d sql:/home/my/sharednssdb enter password for pkcs12 file: re-enter password: listing keys and certificates the information in a .p12 file are not human-readable.
...And 6 more matches
Rhino scopes and contexts
you can create a scope using one context and then evaluate a script using that scope and another context (either by exiting the current context and entering another, or by executing on a different thread).
...such behavior may not be suitable with shared scopes since if a script by mistake adds a property to a library object from the shared scope, that object would not be garbage 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.
...And 6 more matches
Creating JavaScript jstest reftests
you should not add tests of the following type: tests of the jit test of jit correctness belong in the jit-test suite, read more here.
... if tests for the new feature proposal do not yet exist in test262 (they might!), contributing to test262 will allow all other javascript implementors to use your tests as well.
...if they're not, throw an exception (which will cause the test to fail).
...And 6 more matches
64-bit Compatibility
the following types or typedefs are always 64-bit on 64-bit platforms, and 32-bit on 32-bit platforms: pointers uintptr_t, intptr_t, ptrdiff_t, (probably) size_t jsval jsuword, jsword length of a string, though the actual length cannot exceed 30 bits jsuintptr, jsintptr, jsptrdiff, jsuptrdiff, jssize, jsuword, jsword (let's not use these, kthx) the following types are 32-bit on 32-bit platforms.
...lir safety it is not immediately clear from reading lir which opcodes should be used for 64-bit safety.
...not all pointer-width values are actually pointers.
...And 6 more matches
JS::Value
embeddings should not rely on observed representation details or upon the size of js::value.
...the different representations are visible using the separate int32/double methods but do not affect observable semantics (ignoring performance).
...(note that both -0 and +0 are allowed, and the latter may sometimes be stored using the int32_t representation.) js::value further provides these methods combining various aspects of the above methods: js::objectornullvalue(jsobject*) returns an object value corresponding to the given non-null pointer, or a null value if the pointer is null.
...And 6 more matches
SpiderMonkey 1.8
in js_threadsafe builds, some objects are not safe to be shared among threads.
...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.
... migrating to spidermonkey 1.8 spidermonkey 1.8 is not binary-compatible with previous releases.
...And 6 more matches
History Service Design
these statements can be reused avoiding the overhead due to createstatement calls, before closing the connection these statements need to be finalized though, since not doing that would cause leaking.
... the internal syncing service takes care of initializing places, syncing data to disk and finalize statements, so usually that's not a problem.
... another step to improve performance is mainly dedicated to not locking ui.
...And 6 more matches
The Publicity Stream API
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.
...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.
...And 6 more matches
NS ConvertASCIItoUTF16 external
@return the offset of astr, or -1 if not found parameters nsastring& astr print32 (*)(prunichar*, prunichar*, pruint32) c print32 find(const nsastring&, pruint32, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsastring& astr pruint32 aoffset print32 (*)(prunichar*, prunichar*, pruint32) c print32 find(const char*, prbool) const - source find an ascii string within this string.
... @return the offset of astr, or -1 if not found.
...And 6 more matches
NS ConvertUTF16toUTF8 external
@return the offset of astr, or -1 if not found parameters nsacstring& astr print32 (*)(char*, char*, pruint32) c print32 find(const nsacstring&, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsacstring& astr pruint32 aoffset print32 (*)(char*, char*, pruint32) c print32 find(const char*, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
... @return the offset of astr, or -1 if not found parameters char* astr print32 (*)(char*, char*, pruint32) c print32 find(const char*, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* astr pruint32 alen print32 (*)(char*, char*, pruint32) c rfind print32 rfind(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the last occurrence of astr in this string.
...And 6 more matches
NS ConvertUTF8toUTF16 external
@return the offset of astr, or -1 if not found parameters nsastring& astr print32 (*)(prunichar*, prunichar*, pruint32) c print32 find(const nsastring&, pruint32, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsastring& astr pruint32 aoffset print32 (*)(prunichar*, prunichar*, pruint32) c print32 find(const char*, prbool) const - source find an ascii string within this string.
... @return the offset of astr, or -1 if not found.
...And 6 more matches
NS LossyConvertUTF16toASCII external
@return the offset of astr, or -1 if not found parameters nsacstring& astr print32 (*)(char*, char*, pruint32) c print32 find(const nsacstring&, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsacstring& astr pruint32 aoffset print32 (*)(char*, char*, pruint32) c print32 find(const char*, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
... @return the offset of astr, or -1 if not found parameters char* astr print32 (*)(char*, char*, pruint32) c print32 find(const char*, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* astr pruint32 alen print32 (*)(char*, char*, pruint32) c rfind print32 rfind(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the last occurrence of astr in this string.
...And 6 more matches
PromiseFlatCString (External)
@return the offset of astr, or -1 if not found parameters nsacstring& astr print32 (*)(char*, char*, pruint32) c print32 find(const nsacstring&, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsacstring& astr pruint32 aoffset print32 (*)(char*, char*, pruint32) c print32 find(const char*, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
... @return the offset of astr, or -1 if not found parameters char* astr print32 (*)(char*, char*, pruint32) c print32 find(const char*, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* astr pruint32 alen print32 (*)(char*, char*, pruint32) c rfind print32 rfind(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the last occurrence of astr in this string.
...And 6 more matches
PromiseFlatString (External)
@return the offset of astr, or -1 if not found parameters nsastring& astr print32 (*)(prunichar*, prunichar*, pruint32) c print32 find(const nsastring&, pruint32, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsastring& astr pruint32 aoffset print32 (*)(prunichar*, prunichar*, pruint32) c print32 find(const char*, prbool) const - source find an ascii string within this string.
... @return the offset of astr, or -1 if not found.
...And 6 more matches
nsACString (External)
@return the offset of astr, or -1 if not found parameters nsacstring& astr print32 (*)(char*, char*, pruint32) c print32 find(const nsacstring&, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsacstring& astr pruint32 aoffset print32 (*)(char*, char*, pruint32) c print32 find(const char*, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
... @return the offset of astr, or -1 if not found parameters char* astr print32 (*)(char*, char*, pruint32) c print32 find(const char*, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* astr pruint32 alen print32 (*)(char*, char*, pruint32) c rfind print32 rfind(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the last occurrence of astr in this string.
...And 6 more matches
nsAString (External)
@return the offset of astr, or -1 if not found parameters nsastring& astr print32 (*)(prunichar*, prunichar*, pruint32) c print32 find(const nsastring&, pruint32, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsastring& astr pruint32 aoffset print32 (*)(prunichar*, prunichar*, pruint32) c print32 find(const char*, prbool) const - source find an ascii string within this string.
... @return the offset of astr, or -1 if not found.
...And 6 more matches
nsAdoptingCString
note that this class violates constness in a few places.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param...
... astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 6 more matches
nsAdoptingString
note that this class violates constness in a few places.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prun...
...ichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 6 more matches
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.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prun...
...ichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 6 more matches
nsAutoString (External)
@return the offset of astr, or -1 if not found parameters nsastring& astr print32 (*)(prunichar*, prunichar*, pruint32) c print32 find(const nsastring&, pruint32, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsastring& astr pruint32 aoffset print32 (*)(prunichar*, prunichar*, pruint32) c print32 find(const char*, prbool) const - source find an ascii string within this string.
... @return the offset of astr, or -1 if not found.
...And 6 more matches
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.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, lookin...
...g for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 6 more matches
nsCAutoString (External)
@return the offset of astr, or -1 if not found parameters nsacstring& astr print32 (*)(char*, char*, pruint32) c print32 find(const nsacstring&, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsacstring& astr pruint32 aoffset print32 (*)(char*, char*, pruint32) c print32 find(const char*, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
... @return the offset of astr, or -1 if not found parameters char* astr print32 (*)(char*, char*, pruint32) c print32 find(const char*, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* astr pruint32 alen print32 (*)(char*, char*, pruint32) c rfind print32 rfind(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the last occurrence of astr in this string.
...And 6 more matches
nsCString
names: nsstring for wide characters nscstring for narrow characters this class is also known as nsaflat[c]string, where "flat" is used to denote a null-terminated string.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param...
... astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 6 more matches
nsCStringContainer (External)
@return the offset of astr, or -1 if not found parameters nsacstring astr print32* c find(const nsacstring&, pruint32, print32 (*) print32 find(const nsacstring&, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsacstring astr pruint32 aoffset print32* c find(const char*, print32 (*) print32 find(const char*, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
... @return the offset of astr, or -1 if not found parameters char astr print32* c find(const char*, pruint32, print32 (*) print32 find(const char*, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source parameters char astr pruint32 alen print32* c rfind(const nsacstring&, print32 (*) print32 rfind(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the last occurrence of astr in this string.
...And 6 more matches
nsCString external
@return the offset of astr, or -1 if not found parameters nsacstring& astr print32 (*)(char*, char*, pruint32) c print32 find(const nsacstring&, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsacstring& astr pruint32 aoffset print32 (*)(char*, char*, pruint32) c print32 find(const char*, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
... @return the offset of astr, or -1 if not found parameters char* astr print32 (*)(char*, char*, pruint32) c print32 find(const char*, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* astr pruint32 alen print32 (*)(char*, char*, pruint32) c rfind print32 rfind(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the last occurrence of astr in this string.
...And 6 more matches
nsDependentCString external
@return the offset of astr, or -1 if not found parameters nsacstring& astr print32 (*)(char*, char*, pruint32) c print32 find(const nsacstring&, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsacstring& astr pruint32 aoffset print32 (*)(char*, char*, pruint32) c print32 find(const char*, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
... @return the offset of astr, or -1 if not found parameters char* astr print32 (*)(char*, char*, pruint32) c print32 find(const char*, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* astr pruint32 alen print32 (*)(char*, char*, pruint32) c rfind print32 rfind(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the last occurrence of astr in this string.
...And 6 more matches
nsDependentCSubstring external
@return the offset of astr, or -1 if not found parameters nsacstring& astr print32 (*)(char*, char*, pruint32) c print32 find(const nsacstring&, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsacstring& astr pruint32 aoffset print32 (*)(char*, char*, pruint32) c print32 find(const char*, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
... @return the offset of astr, or -1 if not found parameters char* astr print32 (*)(char*, char*, pruint32) c print32 find(const char*, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* astr pruint32 alen print32 (*)(char*, char*, pruint32) c rfind print32 rfind(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the last occurrence of astr in this string.
...And 6 more matches
nsDependentString
this class does not own its data, so the creator of objects of this type must take care to ensure that a nstdependentstring continues to reference valid memory for the duration of its use.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prun...
...ichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 6 more matches
nsDependentString external
@return the offset of astr, or -1 if not found parameters nsastring& astr print32 (*)(prunichar*, prunichar*, pruint32) c print32 find(const nsastring&, pruint32, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsastring& astr pruint32 aoffset print32 (*)(prunichar*, prunichar*, pruint32) c print32 find(const char*, prbool) const - source find an ascii string within this string.
... @return the offset of astr, or -1 if not found.
...And 6 more matches
nsDependentSubstring external
@return the offset of astr, or -1 if not found parameters nsastring astr print32* c find(const nsastring&, pruint32, print32 (*) print32 find(const nsastring&, pruint32, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsastring astr pruint32 aoffset print32* c find print32 find(const char*, prbool) const - source find an ascii string within this string.
... @return the offset of astr, or -1 if not found.
...And 6 more matches
nsLiteralCString (External)
@return the offset of astr, or -1 if not found parameters nsacstring& astr print32 (*)(char*, char*, pruint32) c print32 find(const nsacstring&, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsacstring& astr pruint32 aoffset print32 (*)(char*, char*, pruint32) c print32 find(const char*, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
... @return the offset of astr, or -1 if not found parameters char* astr print32 (*)(char*, char*, pruint32) c print32 find(const char*, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* astr pruint32 alen print32 (*)(char*, char*, pruint32) c rfind print32 rfind(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the last occurrence of astr in this string.
...And 6 more matches
nsLiteralString (External)
@return the offset of astr, or -1 if not found parameters nsacstring& astr print32 (*)(char*, char*, pruint32) c print32 find(const nsacstring&, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsacstring& astr pruint32 aoffset print32 (*)(char*, char*, pruint32) c print32 find(const char*, print32 (*)(const char*, const char*, pruint32)) const - source find the first occurrence of astr in this string.
... @return the offset of astr, or -1 if not found parameters char* astr print32 (*)(char*, char*, pruint32) c print32 find(const char*, pruint32, print32 (*)(const char*, const char*, pruint32)) const - source parameters char* astr pruint32 alen print32 (*)(char*, char*, pruint32) c rfind print32 rfind(const nsacstring&, print32 (*)(const char*, const char*, pruint32)) const - source find the last occurrence of astr in this string.
...And 6 more matches
nsString
names: nsstring for wide characters nscstring for narrow characters this class is also known as nsaflat[c]string, where "flat" is used to denote a null-terminated string.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prun...
...ichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 6 more matches
nsStringContainer (External)
@return the offset of astr, or -1 if not found parameters nsastring& astr print32 (*)(prunichar*, prunichar*, pruint32) c print32 find(const nsastring&, pruint32, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsastring& astr pruint32 aoffset print32 (*)(prunichar*, prunichar*, pruint32) c print32 find(const char*, prbool) const - source find an ascii string within this string.
... @return the offset of astr, or -1 if not found.
...And 6 more matches
nsString external
@return the offset of astr, or -1 if not found parameters nsastring& astr print32 (*)(prunichar*, prunichar*, pruint32) c print32 find(const nsastring&, pruint32, print32 (*)(const prunichar*, const prunichar*, pruint32)) const - source find the first occurrence of astr in this string, beginning at aoffset.
... @return the offset of astr, or -1 if not found parameters nsastring& astr pruint32 aoffset print32 (*)(prunichar*, prunichar*, pruint32) c print32 find(const char*, prbool) const - source find an ascii string within this string.
... @return the offset of astr, or -1 if not found.
...And 6 more matches
mozISpellCheckingEngine
not currently used.
... note: setting this value to a value that doesn't match an existing dictionary throws a ns_error_file_not_found exception.
... when this attribute's value is changed, a "spellcheck-dictionary-update" notification is sent.
...And 6 more matches
nsIChannelEventSink
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) channels will try to get this interface from a channel's notificationcallbacks or, if not available there, from the loadgroup's notificationcallbacks.
... note: prior to gecko 2.0, redirect handling was synchronous, using the onchannelredirect() method.
...if this flag is not set, this is a temporary redirect.
...And 6 more matches
nsIHttpChannelInternal
using features exposed by this interface is not recommended, as it will change in unpredictable ways.
... channelisfordownload boolean external handlers may set this to true to notify the channel that it is open on behalf of a download.
... forceallowthirdpartycookie boolean force relevant cookies to be sent with this load even if normally they would not be.
...And 6 more matches
nsIInputStream
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.
...if a stream is at end-of-file, but not closed, then this method returns 0 bytes available.
...And 6 more matches
nsILoginInfo
ninfo alogininfo); void init(in astring ahostname, in astring aformsubmiturl, in astring ahttprealm, in astring ausername, in astring apassword, in astring ausernamefield, in astring apasswordfield); boolean matches(in nsilogininfo alogininfo, in boolean ignorepassword); attributes attribute type description formsubmiturl astring the origin, not url, a form-based login was submitted to.
... hostname astring the origin, not hostname, to which the login applies (for example, "https://www.site.com").
...if the result did not include a realm, or it was blank, the hostname is used instead.
...And 6 more matches
nsIParserUtils
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.
... note: if -moz-binding is absent, properties that might be xss risks in other web engines are preserved!
... at present, sanitizing css backgrounds, and so on., is not supported, so setting this together with sanitizerallowstyle doesn't make sense.
...And 6 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.
... 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.
...an implementation of this interface can be passed to a channel via the channel's notificationcallbacks attribute.
...And 6 more matches
nsIPromptService
note: some of these interface methods use out and inout parameters.
...the implementation may interpret this loosely, as the intent is to ensure that the user does not click through a security dialog too quickly.
...a delay can be useful not only to give the user more time to think before acting, but also as a countermeasure against malicious web sites that intentionally create a race condition whereby the user intends to click or type a key responding, for example, to the web site's prompt but the security dialog pops up unexpectedly and its button is unintentionally activated.
...And 6 more matches
nsIProtocolHandler
note: starting with firefox 3, one of uri_loadable_by_anyone, uri_dangerous_to_load, uri_is_ui_resource, or uri_is_local_file must be set on every protocol handler.
... current versions of firefox assume that the uri has uri_loadable_by_anyone set, but this will not work starting with the mozilla 2 platform.
... uri_forbids_automatic_document_replacement 1<<5 "automatic" loads that would replace the document (such as a meta refresh, certain types of xlinks, and other non-user-triggered loads) are not allowed if the originating uri has this protocol flag.
...And 6 more matches
nsIScriptError
to create an instance, use: var scripterror = components.classes["@mozilla.org/scripterror;1"] .createinstance(components.interfaces.nsiscripterror); note: the nsiscripterror2 interface was merged into this interface in gecko 12.0.
... note: nsiconsolemessage.message will return the error formatted with file/line information.
...you may pass null if it's not applicable.
...And 6 more matches
nsIScriptableInputStream
note: this method should not be used to determine the total size of a stream, even if the stream corresponds to a local file.
...note: the close method may be called more than once, but subsequent calls are ignored.
...note: the init method may be called more than once, allowing a nsiscriptableinputstream instance to be reused.
...And 6 more matches
nsIXULTemplateQueryProcessor
some queries may not need the reference variable if the syntax or the form of the data implies the value.
...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.
...the reference aref may be used to determine the reference when calculating the value for the binding, for example when a value should depend on the value of another variable.
...And 6 more matches
Troubleshooting XPCOM components registration
there are several common reasons that registration can fail: a component that is a binary (shared library) fails to load a javascript component has parsing errors the shared library loaded correctly, but registration was not successful did registration succeed?
... it is important to not misdiagnose the problem.
...this should not occur if you uninstalled/installed your extension via the extension manager.
...And 6 more matches
Using nsIDirectoryService
bear in mind that this list is not static.
...os and xpcom level nsdirectoryservicedefs.h these locations are provided by xpcom, are constant with the system, and and should not need customization.
... although you will not customize these locations, you may need to tell xpcom where its /bin directory is.
...And 6 more matches
Using the clipboard
one reason is that some systems do not copy the data right away.
...another reason is that the transferable can hold multiple representations of the same data.
...this allows the clipboard to be used by another application right away.
...And 6 more matches
Weak reference
in xpcom, a weak reference is a special object that contains a pointer to an xpcom object, but doesnot keep that object alive.
...after all, the observable must send messages to each observer, notifying it of the appropriate state changes.
...a weak reference does not hold its referent in existence, but also will not dangle.
...And 6 more matches
XPIDL Syntax
MozillaTechXPIDLSyntax
purpose of this document this document is not an introduction to xpidl or idl in general.
...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.
...libidl only considers a single line feed as a newline, and not carriage returns (although xpidl begs to differ).
...And 6 more matches
Creating a gloda message query
(use nsimsgtagservice to access message tags.) query.starred(true/false): add the constraint that the message must be (or not be) starred (flagged).
... query.read(true/false): add the constraint that the message must be (or not be) marked as read.
... create a collection from the query your listener is notified as messages are added to the collection as the database query completes.
...And 6 more matches
Using the Multiple Accounts API
smtp servers (nsismtpserver): an smtp server is not tied to any of the above and can be retrieved from the smtp service (nsismtpservice).
... (you may have noticed that identities 2 and 3 are shared between a few accounts...more on that later) servers servers are show in the folder pane, and in any place where the user must browse or choose folders, such as the new folder dialog, search, filters, etc.
...you should not use createinstance() to create any of the relevant objects because the account manager needs to keep track of all of these objects as they are created.
...And 6 more matches
Using Objective-C from js-ctypes
objective-c has its own syntax, it cannot be written directly with js-ctypes.
...this code returns an allocated nsspeechsynthesizer instance that has not yet been initialized.
... objc_msgsend for the method which returns the value in a register, or returns nothing.
...And 6 more matches
Int64
note: it's important to note that the 64-bit integer objects created by int64 are not int64 objects; rather, they're opaque objects whose values you manipulate through the other methods on the int64 object.
...this may be specified as an integer (if the value can be represented as a 32-bit value), another 64-bit integer object (either signed or unsigned), or as a string, which may consist of an optional minus sign, followed by either a decimal number or "0x" or "0x" followed by a hexadecimal number.
... exceptions thrown typeerror the specified value cannot be converted into a 64-bit integer.
...And 6 more matches
Debugger.Environment - Firefox Developer Tools
this allows the code using each debugger instance to place whatever properties it likes on its own debugger.object instances, without worrying about interfering with other debuggers.) if a debugger.environment instance’s referent is not a debuggee environment, then attempting to access its properties (other than inspectable) or call any its methods throws an instance of error.
...(note that with statements have their own environment type.) “with”, indicating that the environment was introduced by a with statement.
... function properties of the debugger.environment prototype object the methods described below may only be called with a this value referring to a debugger.environment instance; they may not be used as methods of other kinds of objects.
...And 6 more matches
Examine and edit CSS - Firefox Developer Tools
this can help you understand why certain styles are not being applied.
... inactive rules (not shown): if a rule is inactive (e.g., padding on a :visited pseudo-element), it is colored gray, with an info icon that gives more information when clicked.
...(note that this setting is independent of the "browser styles" checkbox in the computed view.) user-agent styles are displayed against a different background, and the link to the filename and line number contains the prefix (user agent): element {} rule the element {} rule at the top of the rules list isn't actually a css rule.
...And 6 more matches
Waterfall - Firefox Developer Tools
one last step is not shown in this sequence: the page may be split into layers, which are painted independently and then combined in a process called "composition".
... not all css property changes cause a reflow.
...however, changing properties that don't alter geometry or position, such as color or opacity, will not.
...And 6 more matches
DataTransfer - Web APIs
gecko properties note: all of the properties in this section are gecko-specific.
...if the type is empty or not specified, the data associated with all types is removed.
... if data for the specified type does not exist, or the data transfer contains no data, this method will have no effect.
...And 6 more matches
Document.evaluate() - Web APIs
WebAPIDocumentevaluate
*/ var thisheading = headings.iteratenext(); var alerttext = "level 2 headings in this document are:\n"; while (thisheading) { alerttext += thisheading.textcontent + "\n"; thisheading = headings.iteratenext(); } alert(alerttext); // alerts the text of all h2 elements note, in the above example, a more verbose xpath is preferred over common shortcuts such as //h2.
...this is because the evaluation of the query spends does not waste time visiting unnecessary nodes.
...for example, if you know the content you are looking for is somewhere inside the body tag, you can use this: document.evaluate(".//h2", document.body, null, xpathresult.any_type, null); notice in the above document.body has been used as the context instead of document so the xpath starts from the body element.
...And 6 more matches
Element.requestFullscreen() - Web APIs
it's not guaranteed that the element will be put into full screen mode.
... note: this method must be called while responding to a user interaction or a device orientation change; otherwise it will fail.
...currently, the only option is navigationui, which controls whether or not to show navigation ui while the element is in full-screen mode.
...And 6 more matches
FileSystemFlags - Web APIs
methods which accept an options parameter of this type may specify zero or more of these flags as fields in an object, like this: datadirectoryentry.getdirectory("workspace", { create: true }, function(entry) { }); here, we see that the create property is provided, with a value of true, indicating that the directory should be created if it's not already there.
... note that these option flags currently don't have any useful meaning when used in the scope of web content, where security precautions prevent the creation of new files or the replacement of existing ones.
... exclusive optional if true, and the create option is also true, the file must not exist prior to issuing the call.
...And 6 more matches
Using the Gamepad API - Web APIs
var gamepads = {}; function gamepadhandler(event, connecting) { var gamepad = event.gamepad; // note: // gamepad === navigator.getgamepads()[gamepad.index] if (connecting) { gamepads[gamepad.index] = gamepad; } else { delete gamepads[gamepad.index]; } } window.addeventlistener("gamepadconnected", function(e) { gamepadhandler(e, true); }, false); window.addeventlistener("gamepaddisconnected", function(e) { gamepadhandler(e, false); }, false); this previous example also demons...
...this is not strictly specified, but in firefox it will contain three pieces of information separated by dashes (-): two 4-digit hexadecimal strings containing the usb vendor and product id of the controller, and the name of the controller as provided by the driver.
...note that disconnecting a device and then connecting a new device may reuse the previous index.
...And 6 more matches
HTMLMediaElement.play() - Web APIs
return value a promise which is resolved when playback has been started, or is rejected if for any reason playback cannot be started.
... note: older browsers may not return a value from play().
...possible errors include: notallowederror the user agent (browser) or operating system doesn't allow playback of media in the current context or situation.
...And 6 more matches
HTMLTableCellElement - Web APIs
htmltablecellelement.abbr a domstring which can be used on <th> elements (not on <td>), specifying an alternative label for the header cell..
...header cells can be configured, using the scope property, the apply to a specified row or column, or to the not-yet-scoped cells within the current row group (that is, the same ancestor <thead>, <tbody>, or <tfoot> element).
... if no value is specified for scope, the header is not associated directly with cells in this way.
...And 6 more matches
In depth: Microtasks and the JavaScript runtime environment - Web APIs
javascript execution contexts note: the details here are generally not important to most javascript programmers.
... when greetuser() calls localgreeting(), another context is created to run that function.
... when greetuser() calls localgreeting(), another context is created to run that function.
...And 6 more matches
Using microtasks in JavaScript with queueMicrotask() - Web APIs
this lets the given function run without the risk of interfering with another script's execution, yet also ensures that the microtask runs before the user agent has the opportunity to react to actions taken by the microtask.
... the event loop driving your code handles these tasks one after another, in the order in which they were enqueued.
...however, whereas the event loop runs only the tasks present on the queue when the iteration began, one after another, it handles the microtask queue very differently.
...And 6 more matches
Working with the History API - Web APIs
note: calling history.back() normally behaves the same way as clicking the back button.
... but there is one important exception: after using history.pushstate(), calling history.back() does not raise a popstate event.
...note that the browser won't attempt to load this url after a call to pushstate(), but it might attempt to load the url later, for instance after the user restarts the browser.
...And 6 more matches
IDBObjectStore.deleteIndex() - Web APIs
note that this method must be called only from a versionchange transaction mode callback.
... note that this method synchronously modifies the idbobjectstore.indexnames property.
... note: this feature is available in web workers.
...And 6 more matches
MediaDevices.getDisplayMedia() - Web APIs
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.
... invalidstateerror the call to getdisplaymedia() was not made from code running due to a user action, such as an event handler.
... another potential cause for this event: the document in whose context getdisplaymedia() was called is not fully active; for example, perhaps it is not the frontmost tab.
...And 6 more matches
Transcoding assets for Media Source Extensions - Web APIs
note: the prebuilt ffmpeg does not include libfdk_aac due to licensing reasons.
... 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.
... because the audio codec in the mov container is already aac and the video codec is h.264, we can instruct ffmpeg not to perform transcoding.
...And 6 more matches
ParentNode.querySelectorAll() - Web APIs
note: this method is implemented as element.queryselectorall(), document.queryselectorall(), and documentfragment.queryselectorall() syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against.
... this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown.
... note: characters which are not part of standard css syntax must be escaped using a backslash character.
...And 6 more matches
PaymentResponse.complete() - Web APIs
the paymentrequest method complete() of the payment request api notifies the user agent that the user interaction is over, and causes any remaining user interface to be closed.
...the user agent may or may not present some form of "payment successful" indication to the user.
... fail the payment was not successfully processed.
...And 6 more matches
PushEvent - Web APIs
WebAPIPushEvent
self.addeventlistener('push', function(event) { if (!(self.notification && self.notification.permission === 'granted')) { return; } var data = {}; if (event.data) { data = event.data.json(); } var title = data.title || "something has happened"; var message = data.message || "here's something you might want to check out."; var icon = "images/new-notification.png"; var notification = new self.notification(title, { body: message, ...
... tag: 'simple-push-demo-notification', icon: icon }); notification.addeventlistener('click', function() { if (clients.openwindow) { clients.openwindow('https://example.blog.com/2015/03/04/something-new.html'); } }); }); specifications specification status comment push apithe definition of 'pushevent' in that specification.
... full support 17firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support service workers and the push api.ie no support noopera full support 37safari no support nowebview android ...
...And 6 more matches
RTCIceCandidatePairStats - Web APIs
this does not take into account the size of the ip overhead, nor any other transport layers such as tcp or udp.
...this does not take into account the size of the ip overhead, nor any other transport layers such as tcp or udp.
...timestamps are not recorded for stun packets.
...And 6 more matches
RTCIceTransportState - Web APIs
in this state, checking of candidates to look for those which might be acceptable has not yet begun.
... "completed" the transport has finished gathering local candidates and has received a notification from the remote peer that no more candidates will be sent.
...this is not a failure state (that's "failed").
...And 6 more matches
Using the Resource Timing API - Web APIs
function calculate_load_times() { // check performance support if (performance === undefined) { console.log("= calculate load times: performance not supported"); return; } // get a list of "resource" performance entries var resources = performance.getentriesbytype("resource"); if (resources === undefined || resources.length <= 0) { console.log("= calculate load times: there are no `resource` performance records"); return; } console.log("= calculate load times"); for (var i=0; i < resources.length; i++) { consol...
... if (performance === undefined) { console.log("= display size data: performance not supported"); return; } var list = performance.getentriesbytype("resource"); if (list === undefined) { console.log("= display size data: performance.getentriesbytype() is not supported"); return; } // for each "resource", display its *size property values console.log("= display size data"); for (var i=0; i < list.length; i++) { console.log("== resource[" + i + "] -...
...decodedbodysize[" + i + "] = not supported"); if ("encodedbodysize" in list[i]) console.log("...
...And 6 more matches
SVGSVGElement - Web APIs
if no parent element exists (i.e., <svg> element represents the root of the document tree), if this svg document is embedded as part of another document (e.g., via the html <object> element), then the position and size are unitless values in the coordinate system of the parent document.
...s for transform and viewtarget within currentview will be null if the initial view was a link into a <view> element, then: the values for viewbox, preserveaspectratio and zoomandpan within currentview will correspond to the corresponding attributes for the given <view> element the values for transform and viewtarget within currentview will be null if the initial view was a link into another element (i.e., other than a <view>), then: the values for viewbox, preserveaspectratio and zoomandpan within currentview will match the values for the corresponding dom attributes that are on svgsvgelement directly for the closest ancestor <svg> element the values for transform within currentview will be null the viewtarget within currentview will represent the target of the link i...
...the behavior is undefined for <svg> elements that are not at the outermost level.
...And 6 more matches
WebGL constants - Web APIs
returns never, always, less, equal, lequal, greater, gequal, or notequal.
...returns never, always, less, equal, lequal, greater, gequal, or notequal.
... constant name value description static_draw 0x88e4 passed to bufferdata as a hint about whether the contents of the buffer are likely to be used often and not change often.
...And 6 more matches
Matrix math for the web - Web APIs
after adding the w component to the point, notice how neatly the matrix and the point line up: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] [4, 3, 2, 1] // point at [x, y, z, w] the w component has some additional uses that are out of scope for this article.
...using the identity matrix it should return a matrix identical to the original, since a matrix multiplied by the identity matrix is always equal to itself: // sets identityresult to [4,3,2,1] let identityresult = multiplymatrixandpoint(identitymatrix, [4, 3, 2, 1]); returning the same point is not very useful, but there are other types of matrices that can perform helpful operations on points.
...]; } let's look at this function in action: let somematrix = [ 4, 0, 0, 0, 0, 3, 0, 0, 0, 0, 5, 0, 4, 8, 4, 1 ] let identitymatrix = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; // returns a new array equivalent to somematrix let somematrixresult = multiplymatrices(identitymatrix, somematrix); important: these matrix functions are written for clarity of explanation, not for speed or memory management.
...And 6 more matches
Using textures in WebGL - Web APIs
note: it's important to note that the loading of textures follows cross-domain rules; that is, you can only load textures from sites for which your content has cors approval.
... gl.generatemipmap(gl.texture_2d); } else { // no, it's not a power of 2.
...after that we setup filtering and wrapping for the texture based on whether or not the image we download was a power of 2 in both dimensions or not.
...And 6 more matches
Using bounded reference spaces - Web APIs
not only is it represented by a unique subclass, xrboundedreferencespace, but it's the only one which restricts movement based not upon virtual restrictions but upon limitations imposed by the real world.
... note that if the underlying platform defines a fixed room-scale origin and boundary, it may initialize any uninitialized values to match that predefined information; this is not unexpected behavior for users of these platforms.
... xr hardware that does not have an inherent boundary defined may or may not support the bounded reference space.
...And 6 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
dependencies while we will not rely upon any 3d graphics frameworks such as three.js or the like for this example, we do use the glmatrix library for matrix math, which we've used in other examples in the past.
... enablerotation a boolean indicating whether or not to enable the rotation of the cube at all.
... note: this example always displays what it renders on the screen, even if using immersive-vr mode.
...And 6 more matches
Web audio spatialization basics - Web APIs
it's worth noting that you don't have to move sound within a full 3d space either — you could stick with just a 2d plane, so if you were planning a 2d game, this would still be the node you were looking for.
... note: there's also a stereopannernode designed to deal with the common use case of creating simple left and right stereo panning effects.
... note: the experience is much better if you use headphones, or have some kind of surround sound system to plug your computer into.
...And 6 more matches
window.dump() - Web APIs
WebAPIWindowdump
notes a common use of dump() is to debug javascript.
...if the -console option was not specified then the output goes to stderr.
... output from dump() is not sent to the browser console.
...And 6 more matches
ARIA: article role - Accessibility
<div role="article"> <h2>heading of the segment</h2> <p>paragraph for the segment.</p> <p>another paragraph.</p> ...
... <article> <h2>heading of the segment</h2> <p>paragraph for the segment.</p> <p>another paragraph.</p> ...
...</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.
...And 6 more matches
ARIA: dialog role - Accessibility
however, adding role="dialog" alone is not sufficient to make a dialog accessible.
... labeling even though it is not required for the dialog itself to be able to receive focus, it still needs to be labeled.
...this approach is shown in the code snippet below: <div role="dialog" aria-labelledby="dialog1title" aria-describedby="dialog1desc"> <h2 id="dialog1title">your personal details were successfully updated</h2> <p id="dialog1desc">you can change your details at any time in the user account section.</p> <button>close</button> </div> keep in mind that a dialog's title and description text do not have to be focusable in order to be perceived by screen readers operating in a non-virtual mode.
...And 6 more matches
Mastering Wrapping of Flex Items - CSS: Cascading Style Sheets
flexbox was designed as a single dimensional layout, meaning that it deals with laying out items as a row or as a column — but not both at once.
...once the first row gets to a point where there is not enough space to place another 160 pixel item, a new flex line is created for the items and so on until all of the items are placed.
... note that the reversing is only happening in the inline, row direction.
...And 6 more matches
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
in addition to the ability to place items accurately onto a created grid, the css grid layout specification contains rules that control what happens when you create a grid and do not place some or all of the child items.
...if the grid does not have enough rows in the explicit grid to place all of the items new implicit rows will be created.
...this can be helpful, if you have a document order that reflects the order in which items sit on the grid you may not need to write css rules to place absolutely everything.
...And 6 more matches
Grid template areas - CSS: Cascading Style Sheets
this will not yet create any layout, but we now have named areas to use in a layout.
... max-width: 940px; margin: 0 auto; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } <div class="wrapper"> <div class="header">header</div> <div class="sidebar">sidebar</div> <div class="content">content</div> <div class="footer">footer</div> </div> using this method we do not need to specify anything at all on the individual grid items, everything happens on our grid container.
...the specification does note that a future level might provide this functionality.
...And 6 more matches
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
note that grid is indexed according to the writing mode of the document.
...if we do not place these on to the grid in any way they will lay out according to the auto-placement rules, one item in each of the first four cells.
...note that we can leave cells empty if we wish.
...And 6 more matches
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
these items are sharing the available space and not lining up underneath the items above.
...we do not need to set anything on the items themselves; they will lay themselves out one into each cell of the created grid.
... in addition to the one-dimensional versus two-dimensional distinction, there is another way to decide if you should use flexbox or grid for a layout.
...And 6 more matches
Shapes From Images - CSS: Cascading Style Sheets
a simple shape from an image to use an image for the shape the image needs to have an alpha channel, an area that is not fully opaque.
...due to this requirement for cors compatible images, if you are previewing your file locally without using a local web server, your shape will not work.
...in firefox if you inspect the property you will be alerted to the fact that the image could not be loaded.
...And 6 more matches
Shorthand properties - CSS: Cascading Style Sheets
tricky edge cases even if they are very convenient to use, there are a few edge cases to keep in mind when using them: a value which is not specified is set to its initial value.
...therefore: background-color: red; background: url(images/bg.gif) no-repeat left top; will not set the color of the background to red but to background-color's default, transparent, as the second rule has precedence.
...the keyword inherit can be applied to a property, but only as a whole, not as a keyword for one value or another.
...And 6 more matches
Syntax - CSS: Cascading Style Sheets
WebCSSSyntax
the pair is separated by a colon, ':' (u+003a colon), and white spaces before, between, and after properties and values, but not necessarily inside, are ignored.
...not all pairs of properties and values are allowed and each property defines what are the valid values.
... when a value is not valid for a given property, the declaration is deemed invalid and is wholly ignored by the css engine.
...And 6 more matches
background-image - CSS: Cascading Style Sheets
if a specified image cannot be drawn (for example, when the file denoted by the specified uri cannot be loaded), browsers handle it as they would a none value.
... note: even 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.
...And 6 more matches
content - CSS: Cascading Style Sheets
WebCSScontent
/* keywords that cannot be combined with other values */ content: normal; content: none; /* <image> values */ content: url("http://www.example.com/test.png"); content: linear-gradient(#e66465, #9198e5); /* alt text for generated content, added in the level 3 specification */ content: url("http://www.example.com/test.png") / "this is the alt text"; /* values below can only be applied to generated content using ::before and ::after */ /* <string> value */ content: "prefix"; /* <counter> values */ content: counter(chapter_counter); content: counters(section_counter, "."); /* attr() value linked to the html attribute value */ content: attr(value...
... string); /* language- and position-dependent keywords */ content: open-quote; content: close-quote; content: no-open-quote; content: no-close-quote; /* except for normal and none, several values can be used simultaneously */ content: open-quote chapter_counter; /* global values */ content: inherit; content: initial; content: unset; syntax values none the pseudo-element is not generated.
... <image> an <image>, denoted by the <url> or <gradient> data type, or part of the webpage, defined by the element() function, denoting the content to display.
...And 6 more matches
font-variant - CSS: Cascading Style Sheets
stylistic(), historical-forms, styleset(), character-variant(), swash(), ornaments(), annotation() specifies the keywords and functions related to the font-variant-alternates longhand property.
...ritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | none | [ <common-lig-values> | <discretionary-lig-values> | <historical-lig-values> | <contextual-alt-values> | stylistic( <feature-value-name> ) | historical-forms | styleset( <feature-value-name># ) | character-variant( <feature-value-name># ) | swash( <feature-value-name> ) | ornaments( <feature-value-name> ) | annotation( <feature-value-name> ) | [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] | <numeric-figure-values> | <numeric-spacing-values> | <numeric-fraction-values> | ordinal | slashed-zero | <east-asian-variant-values> | <east-asian-width-values> | ruby ]where <common-lig-values> = [ common-ligatures | no-common-ligatures ]<discretionary-lig-values> = [ discre...
...to change preferences in firefox, visit about:config.opera android full support 41safari ios full support 9.3samsung internet android full support 6.0greek accented characterschrome no support nonotes no support nonotes notes some operating systems may correctly omit accents in all-uppercase greek text.edge no support nonotes no support nonotes notes some operating systems may correctly omit accents in all-uppercase greek text.firefox no sup...
...And 6 more matches
max-height - CSS: Cascading Style Sheets
accessibility concerns ensure that elements set with a max-height are not truncated and/or do not obscure other content when the page is zoomed to increase text size.
...if the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as none.computed valuethe percentage as specified or the absolute length or noneanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmax-heightchrome full support 18edge full support 12firefox full support 1notes full support 1notes notes css 2.1 leaves the behavior of max-height with table undefined.
...And 6 more matches
max-width - CSS: Cascading Style Sheets
WebCSSmax-width
accessibility concerns ensure that elements set with a max-width are not truncated and/or do not obscure other content when the page is zoomed to increase text size.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmax-widthchrome full support 1edge full support 12firefox full support 1notes full support 1notes notes css 2.1 leaves the behavior of max-width with table undefined.
... firefox supports applying max-width to table elements.ie full support 7opera full support 4notes full support 4notes notes css 2.1 leaves the behavior of max-width with table undefined.
...And 6 more matches
Writing Web Audio API code that works in every browser - Developer guides
furthermore, as a result of the spec being still in flux, some browsers use deprecated properties and method names that are not present in standards-compliant browsers: safari uses the old method names, firefox uses the new ones, and chrome and opera use both.
... in addition, not all features of web audio are already implemented in firefox yet.
...also, if new methods such as start are not detected in some nodes, the library will also alias them to their old names.
...And 6 more matches
Audio and video manipulation - Developer guides
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.
... note: you can find the source code of this demo on github (see it live also).
... note that the playbackrate property works with both <audio> and <video>, but in both cases, it changes the playback speed but not the pitch.
...And 6 more matches
Content categories - Developer guides
it's also possible for elements to not be a member of any of these categories.
... note: a more detailed discussion of these content categories and their comparative functionalities is beyond the scope of this article; for that, you may wish to read the relevant portions of the html specification.
... do not confuse this content model with the sectioning root category, which isolates its content from the regular outline.
...And 6 more matches
Localizations and character encodings - Developer guides
unfortunately, using utf-8 and declaring that utf-8 was used was not always the prevalent way of offering web content.
...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.
...new-authored locale-native utf-8 content is expected to declare its encoding, in which case the fallback encoding does not participate in the processing of content.
...And 6 more matches
User input and controls - Developer guides
note: have a look at the events reference and keyboardevent guide to find out more about keyboard events.
... note: for further information about what you can do with touch events, please read our touch events guide.
... note: pointer events are not widely supported yet, but a pointer.js polyfill is available on mozilla github.
...And 6 more matches
<area> - HTML: Hypertext Markup Language
WebHTMLElementarea
tag omission must have a start tag and must not have an end tag.
...the <area> element must have an ancestor <map>, but it need not be a direct parent.
... alt a text string alternative to display on browsers that do not display images.
...And 6 more matches
<input type="date"> - HTML: Hypertext Markup Language
WebHTMLElementinputdate
the resulting value includes the year, month, and day, but not the time.
... note: when the data entered by the user doesn't adhere to the stepping configuration, the user agent may round to the nearest valid value, preferring numbers in the positive direction when there are two equally close options.
... note: you should be able to use the step attribute to vary the number of days jumped each time the date is incremented (e.g.
...And 6 more matches
itemprop - HTML: Hypertext Markup Language
roperty, "image", whose value is a url <div itemscope> <img itemprop="image" src="google-logo.png" alt="google"> </div> when a string value can't be easily read and understood by a person (e.g., a long string of numbers and letters), it can be displayed using the value attribute of the data element, with the more easily-understood-by-a human-version given in the element's contents (which is not part of the structured data - see example below).
... an item with a property whose value is a product id the id is not human-friendly, so the product's name is used the human-visible text instead of the id.
...items that are not part of others are called top-level microdata items.
...And 6 more matches
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.
... note: the content-security-policy http header has a frame-ancestors directive which obsoletes this header for supporting browsers.
...And 6 more matches
Array.prototype.filter() - JavaScript
callback is invoked only for indexes of the array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values.
... array elements which do not pass the callback test are simply skipped, and are not included in the new array.
... filter() does not mutate the array on which it is called.
...And 6 more matches
Array.prototype.indexOf() - JavaScript
the indexof() method returns the first index at which a given element can be found in the array, or -1 if it is not present.
...if the index is greater than or equal to the array's length, -1 is returned, which means the array will not be searched.
...note: if the provided index is negative, the array is still searched from front to back.
...And 6 more matches
Array.prototype.lastIndexOf() - JavaScript
the lastindexof() method returns the last index at which a given element can be found in the array, or -1 if it is not present.
...note that even when the index is negative, the array is still searched from back to front.
...the array will not be searched.
...And 6 more matches
Promise.prototype.then() - JavaScript
if one or both arguments are omitted or are provided non-functions, then then will be missing the handler(s), but will not generate any errors.
...if it is not a function, it is internally replaced with an "identity" function (it returns the received argument).
...if it is not a function, it is internally replaced with a "thrower" function (it throws an error it received as argument).
...And 6 more matches
Symbol - JavaScript
the symbol() function returns a value of type symbol, has static properties that expose several members of built-in objects, has static methods that expose the global symbol registry, and resembles a built-in object class, but is incomplete as a constructor because it does not support the syntax "new symbol()".
...note that symbol("foo") does not coerce the string "foo" into a symbol.
... if you really want to create a symbol wrapper object, you can use the object() function: let sym = symbol('foo') typeof sym // "symbol" let symobj = object(sym) typeof symobj // "object" shared symbols in the global symbol registry the above syntax using the symbol() function will not create a global symbol that is available in your whole codebase.
...And 6 more matches
WebAssembly.Module - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsmodulechrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0module() constructorchrome full support 57edge full support 16firefox full support ...
... 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios ...
...And 6 more matches
Nullish coalescing operator (??) - JavaScript
contrary to the logical or (||) operator, the left operand is returned if it is a falsy value which is not null or undefined.
... in other words, if you use || to provide some default value to another variable foo, you may encounter unexpected behaviors if you consider some falsy values as usable (eg.
...0; console.log(vala); // "default for a" console.log(valb); // "" (as the empty string is not null or undefined) console.log(valc); // 42 assigning a default value to a variable earlier, when one wanted to assign a default value to a variable, a common pattern was to use the logical or operator (||): let foo; // foo is never assigned any value so it is still undefined let somedummytext = foo || 'hello!'; however, due to || being a boolean logical operator, the left hand-side operand...
...And 6 more matches
Spread syntax (...) - JavaScript
function myfunction(v, w, x, y, z) { } const args = [0, 1]; myfunction(-1, ...args, 2, ...[3]); apply for new operator when calling a constructor with new it's not possible to directly use an array and apply() (apply() does a [[call]] and not a [[construct]]).
... copy an array const arr = [1, 2, 3]; const arr2 = [...arr]; // like arr.slice() arr2.push(4); // arr2 becomes [1, 2, 3, 4] // arr remains unaffected note: spread syntax effectively goes one level deep while copying an array.
...without spread syntax, this is done as: const arr1 = [0, 1, 2]; const arr2 = [3, 4, 5]; // append all items from arr2 onto arr1 arr1 = arr1.concat(arr2); with spread syntax this becomes: let arr1 = [0, 1, 2]; let arr2 = [3, 4, 5]; arr1 = [...arr1, ...arr2]; // arr1 is now [0, 1, 2, 3, 4, 5] // note: not to use const otherwise, it will give typeerror (invalid assignment) array.prototype.unshift() is often used to insert an array of values at the start of an existing array.
...And 6 more matches
for...of - JavaScript
can iterate over the arguments object to examine all of the parameters passed into a javascript function: (function() { for (const argument of arguments) { console.log(argument); } })(1, 2, 3); // 1 // 2 // 3 iterating over a dom collection iterating over dom collections like nodelist: the following example adds a read class to paragraphs that are direct descendants of an article: // note: this will only work in platforms that have // implemented nodelist.prototype[symbol.iterator] const articleparagraphs = document.queryselectorall('article > p'); for (const paragraph of articleparagraphs) { paragraph.classlist.add('read'); } closing iterators in for...of loops, abrupt iteration termination can be caused by break, throw or return.
...functions generating an iterable object: function* fibonacci() { // a generator function let [prev, curr] = [0, 1]; while (true) { [prev, curr] = [curr, prev + curr]; yield curr; } } for (const n of fibonacci()) { console.log(n); // truncate the sequence at 1000 if (n >= 1000) { break; } } do not reuse generators generators should not be re-used, even if the for...of loop is terminated early, for example via the break keyword.
... upon exiting a loop, the generator is closed and trying to iterate over it again does not yield any further results.
...And 6 more matches
OpenSearch description format
(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.
... note: for icons loaded remotely (that is, from https:// uris as opposed to data: uris), firefox will reject icons larger than 10 kilobytes.
... note: since this element is firefox-specific, and not part of the opensearch specification, we use the moz: xml namespace prefix in the example above to ensure that other user agents that don't support this element can safely ignore it.
...And 6 more matches
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
they finally fix issues that front-end developers have struggled with for years — most notably how to properly cache the assets of a website and make them available when the user’s device is offline.
... they can do a lot more than "just" offering offline capabilities, including handling notifications, performing heavy calculations on a separate thread, etc.
... 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 if('serviceworker' in navigator) { navigator.serviceworker.register('./pwa-examples/js13kpwa/sw.js'); }; if the service worker api is supported in the browser, it is registered against the site using the serviceworkercontainer.register() method.
...And 6 more matches
Graphic design for responsive sites - Progressive web apps (PWAs)
textual content is not a problem, as text boxes are innately responsive, but the picture starts to get ugly when you start including graphics and complex layouts on your pages — especially when those graphics and layouts need to adapt to different displays!
...this means that the default layout before any media queries are encountered in the css is the small screen/mobile layout, not the wide screen/desktop layout.
... so when the page is loaded on a mobile device, the mobile will only download the mobile assets, and not the desktop resource assets.
...And 6 more matches
Structural overview of progressive web apps - Progressive web apps (PWAs)
it also allows the website to be accessible offline if the network connection is not available.
...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.
... 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.
...And 6 more matches
d - SVG: Scalable Vector Graphics
WebSVGAttributed
value <string> default value none animatable yes note: the point of origin (the coordinate 0,0) is usually the upper left corner of the context.
... svg defines 6 types of path commands, for a total of 20 commands: moveto: m, m lineto: l, l, h, h, v, v cubic bézier curve: c, c, s, s quadratic bézier curve: q, q, t, t elliptical arc curve: a, a closepath: z, z note: commands are case-sensitive.
... command parameters notes m (x, y)+ move the current point to the coordinate x,y.
...And 6 more matches
vector-effect - SVG: Scalable Vector Graphics
note: as a presentation attribute, vector-effect can be used as a css property.
... as a presentation attribute, it can be applied to any element but it has effect only on the following ten elements: <circle>, <ellipse>, <foreignobject>, <image>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath> <tspan>, and <use> usage notes value none | non-scaling-stroke | non-scaling-size | non-rotation | fixed-position default value none animatable yes none this value specifies that no vector effect shall be applied, i.e.
...the resulting visual effect of this value is that the stroke width is not dependant on the transformations of the element (including non-uniform scaling and shear transformations) and zoom level.
...And 6 more matches
<use> - SVG: Scalable Vector Graphics
WebSVGElementuse
most attributes (except for x, y, width, height and (xlink:)href) do not override those set in the ancestor.
... most attributes on use do not override those already on the element referenced by use.
...however, any other attributes not set on the referenced element will be applied to the use element.
...And 6 more matches
How to turn off form autocompletion - Web security
however, some data submitted in forms either are not useful in the future (for example, a one-time pin) or contain sensitive information (for example, a unique government identifier or credit card security code).
... as website author, you might prefer that the browser not remember the values for such fields, even if the browser's autocomplete feature is enabled.
... note that the wcag 2.1 success criterion 1.3.5: identify input purpose does not require that autocomplete/autofill actually work - merely that form fields that relate to specific personal user information are programmatically identified.
...And 6 more matches
Types of attacks - Web security
these attacks succeed if the web app does not employ enough validation or encoding.
... the user's browser cannot detect the malicious script is untrustworthy, and so gives it access to any cookies, session tokens, or other sensitive site-specific information, or lets the malicious script rewrite the html content.
...that is, the page itself does not change, but the client side code contained in the page runs in an unexpected manner because of the malicious modifications to the dom environment.
...And 6 more matches
XUL Migration Guide - Archive of obsolete content
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.
... the sdk generally expects you to specify your user interface using html, not xul.
...but the sdk makes a distinction between: add-on scripts, which can use the sdk apis, but are not able to interact with web pages content scripts, which can access web pages, but do not have access to the sdk's apis content scripts and add-on scripts communicate by sending each other json messages: in fact, the ability to communicate with the add-on scripts is the only extra privilege a content script is granted over a normal remote web page script.
...And 5 more matches
windows - Archive of obsolete content
with this module, you can: enumerate the currently opened browser windows open new browser windows listen for 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.
...ewfor(browserwindow); // now we can use the chrome window api console.log(chromewindow.document.location.href); // -> "chrome://browser/content/browser.xul" // convert back to the high-level window var highlevelwindow = modelfor(chromewindow); // now we can use the sdk's high-level window api console.log(highlevelwindow.title); } browserwindows.on("open", converttochromeandback); note that directly accessing low-level chrome objects like this means you're no longer protected by the compatibility guarantees made by the sdk's high-level apis.
... in particular, depending on what you do with these objects, your code might not work with multiprocess firefox.
...And 5 more matches
dev/panel - Archive of obsolete content
note that at the moment you can't debug remote targets (for example, firefox os, the firefox os simulator, or firefox for android) using tools developed with this api.
... you can use the notation "./my-icon.png" as an alias for the url pointing to "data/my-icon.png".
... you can use the notation "./my-file.html" as an alias for the url pointing to "data/my-file.html".
...And 5 more matches
util/array - Archive of obsolete content
returns boolean : a boolean indicating whether or not the element was found in the array.
... returns boolean : a boolean indicating whether or not any of the elements were found in the array.
... add(array, element) if the given array does not already contain the given element, this function adds the element to the array and returns true.
...And 5 more matches
Rosetta - Archive of obsolete content
hence, if you are going to use another scripting language you might expect that most of the browsers will not recognize it.
... also, regarding some languages (like c), it is even not well defined the meaning of part of their semantics in respect to a scope that is more restricted than the full access to the resources they usually deal with – imagine, for example, the meaning of a c pointer within a html page!
... beyond ecmascript this is not the place for showing a full compiler written in ecmascript.
...And 5 more matches
Installing Extensions and Themes From Web Pages - Archive of obsolete content
return false; this last part is the most important - the install function must return false so that when the link is clicked, only the script is run, and the link href is not navigated to.
...if you do not specify an icon, the default icon will be used, usually a green puzzle piece.
...well, xpi is a mozilla-specific extension and so we can have special handling for it, but jar is not - not all .jar files are firefox themes, so if you click on a .jar link you'll be shown the save as decision dialog.
...And 5 more matches
Listening to events in Firefox extensions - Archive of obsolete content
types of events there are multiple types of events that application and extension authors can use to receive notifications from <xul:browser> and <xul:tabbrowser> elements to hear about changes relating to loads of the content contained within them.
...if an unload handler is present, the page will not be cached.
... when a user navigates to a cached page, inline scripts and the onload handler do not run (steps 2 and 3), since in most cases, the effects of these scripts have been preserved.
...And 5 more matches
Adding Events and Commands - Archive of obsolete content
another way to attach event handlers, just like html, is to place the handler in the xul code: <overlay id="xulschoolhello-browser-overlay" onload="xulschoolchrome.browseroverlay.init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> we prefer the first method because it keeps a better separation of content and behavior.
... also, note that the addeventlistener method receives the event name without the "on" prefix, while element attributes do have the prefix.
...these are some notable events you should keep in mind: oncommand.
...And 5 more matches
Adding sidebars - Archive of obsolete content
if not, you can open either one from the view > sidebar menu.
... another, more important difference to take into account is that users can resize the sidebar to their liking, and in most cases, the sidebar is going to be fairly narrow.
...in the following example, the second child will be displayed, not the first which would be the default.
...And 5 more matches
Adding preferences to an extension - Archive of obsolete content
please note that if you are using code from this tutorial to add to an existing extension, you must uninstall and reinstall your extension to enable the preferences button for your extension in the add-ons list.
... establish the defaults in order to set a default preference for the stock to monitor, we need to add a new folder to our extension's package, called "defaults", which in turn contains another folder called "preferences".
... inside that, we create a file, defaults.js, that describes the default value of our preferences: pref("extensions.stockwatcher2.symbol", "goog"); the standard for third-party preferences, such as those used in extensions, is to use the string "extensions", a period, the name of the extension, another period, then a preference name, as seen in the example above.
...And 5 more matches
Underscores in class and ID Names - Archive of obsolete content
note: browser support for underscores in css has greatly improved since this article was originally published in 2001 and the following recommendation is no longer accurate for most circumstances.
...this technical note examines the use of underscores in css, and why they should be generally avoided in most circumstances.
...this should not be done.
...And 5 more matches
Developing New Mozilla Features - Archive of obsolete content
our developers get a lot of mail, and not all of it is helpful.
...it’s possible developers may not pay much attention to you because they believe your proposed feature is not a high priority, or is not wanted at all, or that you haven’t demonstrated that you understand the codebase and mozilla coding practices well enough for them to spend a lot of time with you.
...in other cases, mozilla.org staff may agree with the developers that it does not make sense for them to spend much time assisting with your project.
...And 5 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.
... warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser.
...And 5 more matches
Plugin Architecture - Archive of obsolete content
this page contains some notes on how plugins work internally in gecko.
...note: this document documents how trunk works, i.e.
...note: this document describes how things are, not necessarily how things should be.
...And 5 more matches
Standalone XPCOM - Archive of obsolete content
the contents of this standalone xpcom in general are: nspr : mozilla/nsprpub xpcom : mozilla/xpcom note 1: xpcom apis are not frozen yet.
... note 2: xpcom standalone differs from the xpcom built with mozilla.
... hence cannot be used with the mozilla browser.
...And 5 more matches
Supporting per-window private browsing - Archive of obsolete content
firefox 20 introduced per-window private browsing mode, in which private user data is stored and accessed concurrently with public user data from another window.
... detecting private browsing mode determining whether or not a given dom window is private is simple: import resource://gre/modules/privatebrowsingutils.jsm and use privatebrowsingutils.iswindowprivate(window).
... } } catch(e) { // pre firefox 20 (if you do not have access to a doc.
...And 5 more matches
Running Tamarin performance tests - Archive of obsolete content
(optional) you may compare the performance of the avmshell to another avmshell.
...to compare a build against another build set the avm2 environment variable to the other avmshell or use the "-s --avm2" options.
...le additional output -e --avm avmplus command to use -a --asc compiler to use -g --globalabc deprecated but still works - use builtin.abc (used to be location of global.abc) -b --builtinabc location of builtin.abc -s --shellabc location of shell_toplevel.abc -x --exclude comma separated list of directories to skip -h --help display help and exit -t --notime do not generate timestamps (cleaner diffs) -f --forcerebuild force rebuild all test files -c --config sets the config string [default os-tvm] -q --quiet display minimum output during testrun -l --log also log all output to given logfile --summaryonly only display final summary --rebuildtests rebuild the tests only - do not run against vm --showti...
...And 5 more matches
Extensions - Archive of obsolete content
note that the menu will not appear until it has a <menupopup>.
...for example, to add an item to the end of the tools menu, use the following: <menupopup id="menu_toolspopup"> <menuitem label="thesaurus"/> </menupopup> note that other extensions may be adding their own items into the same menus.
... because of this, the new item might not appear at the end of the menu but before a menuitem added by another extension, depending on the order in which the overlays are applied.
...And 5 more matches
PopupKeys - Archive of obsolete content
if an access key is a pressed that does not correspond to an item within the menu, items that don't have access keys can be selected if the key pressed corresponds to the first letter of the label.
... other keys are ignored by the menu key listener, however, the event does not propagate to the main window.
...the other keys do not apply.
...And 5 more matches
Tooltips - Archive of obsolete content
note that tooltips can only be activated using the mouse, so they should never contain important information that isn't available elsewhere.
...this could also be useful if the toolbar is configured such that labels do not appear.
... if an element does not have a tooltiptext attribute, yet a parent element does, the parent tooltip will apply.
...And 5 more matches
Additional Navigation - Archive of obsolete content
that's not an issue though, since it wouldn't be particularly useful.
... also, you cannot use a variable in the predicate.
...another thing that you cannot have is a triple where both variables would be unknown as in the following: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?category" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> </query> in this case when the template builder gets to the triple, neither the ?category nor the ?title variables can be filled in so the builder doesn't know what to generate.
...And 5 more matches
Multiple Rule Example - Archive of obsolete content
often this will be because a particular result has a property that others do not.
... for instance, in an earlier example, one of the photos had a description and the other photos did not.
...if a photo did not have a title, it would not match any rule.
...And 5 more matches
Rule Compilation - Archive of obsolete content
does this mean that templates cannot be used inside hidden areas of the ui?
...however, there are two cases where content is not generated automatically: menus and child tree items.
... content inside a menu is not generated until the menu is opened.
...And 5 more matches
Tree Selection - Archive of obsolete content
otherwise, the user may select multiple rows, which will not necessarily be contiguous.
...if the user holds down the cursor key to rapidly scroll through the items, the event handler is not called until the user stops.
...the rows that are not displayed are not included in the index count.
...And 5 more matches
Accessibility/XUL Accessibility Reference - Archive of obsolete content
although tutorials claim label and description have the same underlying implementation, description elements appear to not associate correctly with controls whereas labels do.
... <button id="butwrap1"> <label control="butwrap1"> <!--wrapped label--> </label> </button> <button id='butwrap2'> <label control="butwrap2" value="<!--this-->" /> <label control="butwrap2" value="is" /> <label control="butwrap2" value="a" /> <label control="butwrap2" value="button" /> </button> <button image="images/img.xbm" tooltiptext="<!--button text-->"/> note that in the third example, only the first label is read browser jaws 7.10 issues to use a browser element with html, the type="content" attribute should be specified.
...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.
...And 5 more matches
XML - Archive of obsolete content
for example, <html:img src="box.gif" /> is valid, but <html:img src="box.gif"> is not.
...it does not describe the way in which this data is to be presented, like its semantically-challenged cousin html does, and it doesn't have much to say about the data itself.
...note that our language doesn't suffice to describe the content of the memo, which is written in english.
...And 5 more matches
XUL Coding Style Guidelines - Archive of obsolete content
disobeying them might not cause any parsing error for now, however, it might cause future maintenance headache: convert html files to xul files.
...in the new world, mozilla 5.0, this is not true any more.
... localization notes localization notes are the xul writers' notes to the localizers/translators.
...And 5 more matches
XUL Event Propagation - Archive of obsolete content
introduction xul events were introduced in a very general way in a previous xulnote.
... the following image describes in a very basic way how the various actors in the event model interact with one another.
...this button responds to the user action by raising an event, a message meant to travel from one element within the interface to another.
...And 5 more matches
datepicker - Archive of obsolete content
if not specified, the datepicker defaults to the current day.
... attributes disabled, firstdayofweek, readonly, type, tabindex, value properties date, dateleadingzero, datevalue, disabled, month, monthleadingzero, open, readonly, tabindex, value, year, yearleadingzero examples <datepicker type="grid" value="2007-03-26"/> attributes disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
...And 5 more matches
preference - Archive of obsolete content
attributes disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
... in the case of form elements, it will not be submitted.
...And 5 more matches
scale - Archive of obsolete content
ArchiveMozillaXULscale
disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
... in the case of form elements, it will not be submitted.
...And 5 more matches
Debugging a XULRunner Application - Archive of obsolete content
note that -console goes after the application.ini argument: e.g.
... note: if you are not using the stub executable to launch the application, the -jsconsole argument is after the application.ini argument: e.g.
... troubleshooting x-jsd is not a registered protocol if the message "x-jsd is not a registered protocol" appears when trying to open *.js files in venkman, then add an empty file called .autoreg in the same directory as your xulrunner binary.
...And 5 more matches
Theme changes in Firefox 4 - Archive of obsolete content
it's also important to note that skin files are now split into two subfolders within the omni.jar file, and you'll need to look in both places to find all the skin resources you need.
... note: when extracting omni.jar, you may incorrectly get false warnings from some virus protection software.
...the value does not necessarily reflect the user preference in the toolbar customization palette anymore.
...And 5 more matches
Developing cross-browser and cross-platform pages - Archive of obsolete content
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 visiting browser.
... another major problem with this approach is that the browser identity can be "spoofed" because, in many modern browsers, the navigator.appversion and navigator.useragent string properties are user configurable strings.
...moreover, there are many cases where even the accurately-identified browser does not perform as it is reputed/expected to.
...And 5 more matches
background-size - Archive of obsolete content
should not the "browser compatibility" table also list google chrome and konqueror?
... chome is not mentioned at all, but is becoming increasingly popular.
...(sheppy 07 december 2009) we should encourage web developers to ask for layout engines, not for browsers.
...And 5 more matches
XForms Custom Controls - Archive of obsolete content
since firefox 4, xbl and xul are disabled by default for all pages not loaded from a chrome:// url.
...xpcom knowledge will certainly not hurt.
...why do you need this you will probably find that your need for customization will fall into one of the following categories: custom presentation - xforms controls as rendered by the mozilla xforms processor do not provide the right look and feel for you.
...And 5 more matches
Implementing controls using the Gamepad API - Game development
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.
... the code explained below is from the full version of the hungry fridge game, but it's almost identical to the one from the demo — the only difference is that the full version uses the turbo variable to decide whether or not the game will be launched using super turbo mode.
... it works independently, so it could be turned on even if the gamepad is not connected.
...And 5 more matches
Mobile accessibility - Learn web development
note: you can get to your home screen at any time by swiping up and left in a smooth motion.
... note: see get started on android with talkback for more complete documentation.
... note: some older ios devices have the voiceover menu at settings app > general > accessibility > voiceover.
...And 5 more matches
Pseudo-classes and pseudo-elements - Learn web development
instead of adding the class, we could use the :first-child pseudo-class selector — this will always target the first child element in the article, and we will no longer need to edit the html (this may not always be possible anyway, maybe due to it being generated by a cms.) all pseudo-classes behave in this same kind of way.
...take a look at some other examples on mdn: :last-child :only-child :invalid note: it is valid to write pseudo-classes and elements without any element selector preceding them.
... in the example above, you could write :first-child and the rule would apply to any element that is the first child of an <article> element, not just a paragraph first child — :first-child is equivalent to *:first-child.
...And 5 more matches
Type, class, and ID selectors - Learn web development
the universal selector the universal selector is indicated by an asterisk (*) and selects everything in the document (or inside the parent element if it is being chained together with another element and a descendant combinator).
...le> , no matter what element it was, and make it bold, i could use the :first-child selector, which we will learn more about in the lesson on pseudo-classes and pseudo-elements, as a descendant selector along with the <article> element selector: article :first-child { } this could be confused however with article:first-child, which will select any <article> element that is the first child of another element.
... this approach reduces the scope of a rule as the rule will only apply to that particular element & class combination; so you would need to add another selector if you decided the rule should apply to other elements too.
...And 5 more matches
Sizing items in CSS - Learn web development
if you place an image on a page and do not change its height and width, either using attributes on the <img> tag or css, it will be displayed using that intrinsic size.
...in the case of a box inside another container, if you give the child box a percentage width it will be a percentage of the width of the parent container.
... percentage margins and padding if you set margins and padding as a percentage, you may notice some strange behavior.
...And 5 more matches
Styling tables - Learn web development
o do this, add the following css to your style.css file: /* spacing */ table { table-layout: fixed; width: 100%; border-collapse: collapse; border: 3px solid purple; } thead th:nth-child(1) { width: 30%; } thead th:nth-child(2) { width: 20%; } thead th:nth-child(3) { width: 15%; } thead th:nth-child(4) { width: 35%; } th, td { padding: 20px; } the most important parts to note are as follows: a table-layout value of fixed is generally a good idea to set on your table, as it makes the table behave a bit more predictably by default.
...heet' type='text/css'> now add the following css into your style.css file, below the previous addition: /* typography */ html { font-family: 'helvetica neue', helvetica, arial, sans-serif; } thead th, tfoot th { font-family: 'rock salt', cursive; } th { letter-spacing: 2px; } td { letter-spacing: 1px; } tbody td { text-align: center; } tfoot th { text-align: right; } there is nothing really specific to tables here; we are generally tweaking the font styling to make things easier to read: we have set a global sans-serif font stack; this is purely a stylistic choice.
... start by adding the following css to your style.css file, again at the bottom: /* graphics and colors */ thead, tfoot { background: url(leopardskin.jpg); color: white; text-shadow: 1px 1px 1px black; } thead th, tfoot th, tfoot td { background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.5)); border: 3px solid purple; } again, there's nothing specific to tables here, but it is worthwhile to note a few things.
...And 5 more matches
Getting started with CSS - Learn web development
it contains an <em>emphasized</em> element.</p> <ul> <li>item one</li> <li>item two</li> <li>item <em>three</em></li> </ul> </body> </html> note: if you are reading this on a device or an environment where you can't easily create files, then don't worry — live code editors are provided below to allow you to write example code right here in the page.
...if you were to do this then you would no longer be able to apply the class to a <span> or another element by simply adding the class to it; you would have to add that element to the list of selectors: li.special, span.special { color: orange; font-weight: bold; } as you can imagine, some classes might be applied to many elements and you don't want to have to keep editing your css every time something new needs to take on that style.
... therefore it is sometimes best to bypass the element and simply refer to the class, unless you know that you want to create some special rules for one element alone, and perhaps want to make sure they are not applied to other things.
...And 5 more matches
How does the Internet work? - Learn web development
note: for the rest of this article, we will only talk about physical cables, but wireless networks work the same.
... such a network is not limited to two computers.
...to send a message to computer b, computer a must send the message to the router, which in turn forwards the message to computer b and makes sure the message is not delivered to computer c.
...And 5 more matches
Sending forms through JavaScript - Learn web development
a form is not always a form with progressive web apps, single page apps, and framework based apps, it's common to use html forms to send data without loading a new document when response data is received.
... many modern uis only use html forms to collect input from the user, and not for data submission.
... 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 but has some advantages.
...And 5 more matches
HTML basics - Learn web development
html is not a programming language; it is a markup language that defines the structure of your content.
...here, class is the attribute name and editor-note is the attribute value.
... note: simple attribute values that don't contain ascii whitespace (or any of the characters " ' ` = < > ) can remain unquoted, but it is recommended that you quote all attribute values, as it makes the code more consistent and understandable.
...And 5 more matches
Multimedia: Images - Learn web development
loading strategy one of the biggest improvements to most websites is lazy-loading images beneath-the-fold, rather than downloading them all on initial page load regardless of whether a visitor scrolls to see them or not.
...examples for these types of motifs are logos, illustrations, charts or icons (note: svgs are far better than icon fonts!).
...the size is not too big.
...And 5 more matches
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
the todo/todos plural problem the above is fine, but we have another small issue to contend with.
...et's try replacing this part of footer.hbs: <strong>{{this.todos.incomplete.length}}</strong> todos left with the following: <strong>{{this.todos.incomplete.length}}</strong> {{#if this.todos.incomplete.length === 1}} todo {{else}} todos {{/if}} left this will give us an error, however — in ember, these simple if statements can currently only test for a truthy/falsy value, not a more complex expression such as a comparison.
...note that here we need this.incomplete.length, not this.todos.incomplete.length, because we are doing this inside the service, where the incomplete() getter is available directly (in the template, the contents of the service has been made available as todos via the @service('todo-data') todos; line inside the footer class, hence it being this.todos.incomplete.length there).
...And 5 more matches
Client-side tooling overview - Learn web development
if you have found yourself struggling in the past, then don’t worry — you are not alone.
...if you jump on your favourite search engine and look for "front-end developer tools" you're going to hit a huge spectrum of results ranging from text editors, to browsers, to the type of pens you can use to take notes.
... this part of the tooling should be specific to your own development environment, though it’s not uncommon for companies to have some kind of policy or pre-baked configuration available to install so that all their developers are all using the same processes.
...And 5 more matches
Chrome Worker Modules
this module loader should not surprise developers familiar with commonjs, as it implements a minimal commonjs require().
...you only need to do it once for each worker, from within the chrome worker itself: importscripts("resource://gre/modules/workers/require.js"); note: although you only need to do this once for each worker, it doesn't hurt if you do it more than once.
...core.declareffi(...) note that, for the moment, require() only accepts absolute uris.
...And 5 more matches
Accessibility information for UI designers and developers
for example, in this chart, it helps to add labels besides the colored chart lines:people who cannot see the difference between the colors, can use the labels instead.
... here's an example of someone tabbing through a footer, the focus moves around: note: don't remove the focus indicator, as without it, users that can't or don't use a mouse cannot see where they are.
... text spacing users should be able to make the following changes to their text spacing: set line height (leading) to at least 1.5 times the font size set spacing following paragraphs to at least 2 times the font size set letter spacing (tracking) to at least 0.12 times the font size set word spacing to at least 0.16 times the font size this does not mean that your page needs to offer controls to make such changes, merely that if someone does these things in a custom stylesheet, they should not break the interface.
...And 5 more matches
Adding a new CSS property
issues about how to write such a specification (including things such as whether it is appropriate to use prefixes or when properties should be inherited by default) are not covered here.
... remember that each style struct contains only properties that inherit by default or only properties that do not.
... (which set the property is in is given in the specification, which says "inherited: yes" or "inherited: no" in the property's definition.) also note that some of the style structs intentionally contain only properties set/reset by a particular common shorthand property; this improves the effectiveness of some of the performance and memory optimizations done with the rule tree, and thus we should avoid adding a property not reset by that shorthand to such a struct.
...And 5 more matches
Testopia
testopia 3.0 (not yet released) if you upgraded to bugzilla 5.0, you probably noticed that testopia 2.5 is not compatible with this version.
...this is not an trivial task, it takes time (it started in august 2014), and we decided that it was not a good idea to release half-baked code which still needs testing to make sure we didn't regress anything.
...do not ask when we plan to release 3.0, because we really don't know.
...And 5 more matches
Creating Custom Events That Can Pass Data
note that starting with version 6, firefox supports dom level 3 customevent, which lets you dispatch custom events with arbitrary data from javascript.
...as of gecko 1.8, if your event names do not start with "nsdom" and their interfaces do not start with "nsidom" then you can forget about passing data.
...at the time of writing the author is not aware of a way to do this that doesn't involve modifications to trunk.
...And 5 more matches
SVG Guidelines
when choosing whether or not to use svg it is best to understand the advantages and disadvantages of both.
... scalability, with caveats one of the primary advantages of svg is that as it is scaled it does not pixelate.
... however, this is not to say that it always does away with the need to have a collection of raster images for display at different scales.
...And 5 more matches
Cross Process Object Wrappers
note that from firefox 47 onwards, unsafe cpow usage is no longer permitted in browser code.
...set the wrapped object's properties and call its functions: // chrome script windowmm.addmessagelistener("my-e10s-extension-message", handlemessage); function handlemessage(message) { let wrapper = message.objects.clicked; console.log(wrapper.innerhtml); wrapper.innerhtml = "<h2>modified by chrome!</h2>" wrapper.setattribute("align", "center"); } auto-generated cpows add-ons that have not declared themselves multiprocess compatible are set up with a number of compatibility shims.
...this means that examples like this will actually work, even in multiprocess firefox: gbrowser.selectedbrowser.contentdocument.body.innerhtml = "replaced by chrome code"; it's still important to keep in mind, though, that this is access through a cpow and not direct access to content.
...And 5 more matches
Tracking Protection
if blocked content is part of the page layout, users may notice layout issues where firefox blocked these loads.
... sometimes users won’t notice at all, if the page grid works such that other page elements slide in to fill holes left by blocked elements.
... note that with firefox for android, you can access console output using the remote debugger.
...And 5 more matches
PBackground
note: if you want more detailed information on ipdl, start out by reading the ipdl tutorial.
... not every communication between the chrome and content processes necessarily wants to go through the main threads of both (or even either) processes.
...this protocol is called pcompositor, and allows us to bypass the main thread of the parent process, which trims the latency of texture uploads since they will not get bogged down if that thread is busy.
...And 5 more matches
Addon
the interface can represent many different kinds of add-ons and as such, some of the methods and properties are considered "required" and others "optional," which means that the optional methods or property may not exist on addon instances for some types of add-ons.
...rsion) overview of optional methods void uninstall() void canceluninstall() boolean hasresource(in string path) nsiuri getresourceuri(in string path) void getdatadirectory(in datadirectorycallback callback) required properties attribute type description appdisabled read only boolean true if this add-on cannot be used in the application based on version compatibility, dependencies, and blocklisting.
... foreigninstall read only boolean true or false depending on whether the add-on is a third party add-on installation or not.
...And 5 more matches
JNI.jsm
a note about firefox for android, this jsm file is already globally imported and is available from the privileged window scope as window.jni.
...unlike c from js-ctypes, defining constants is not a manual magic number method in jni, it is declared the same way we define functions, except in jni they are called fields.
... method overview cdata getforthread(); cdata loadclass(cdata ajenv, string aclassfullyqualifiedname, [optional] object adeclares); cdata newstring(cdata ajenv, string astr); string readstring(cdata ajenv, cdata ajavastring); void unloadclasses(); methods getforthread() blah blah cdata getforthread(); parameters this function does not take any arguments.
...And 5 more matches
NetUtil.jsm
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.
...}); remarks note: if you specify an nsichannel as the input source, and its notification callbacks have already been set, callers are responsible for implementing nsibadcertlistener and nsisslerrorlistener.
...And 5 more matches
Promise.jsm
its usage is not suggested for new code.
... to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/promise.jsm"); note: a preliminary promise module is also available starting from gecko 17, though it didn't conform to the promises/a+ proposal until gecko 25: components.utils.import("resource://gre/modules/commonjs/promise/core.js"); // gecko 17 to 20 components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js"); // gecko 21 to 24 this implementation also includes helper functions that are specific to the add-on sdk.
... a promise is an object representing a value that may not be available yet.
...And 5 more matches
Deferred
if the associated promise has already been resolved, either to a value, a rejection, or another promise, this method does nothing.
... note: this function is exactly same as promise constructor's resolve argument, and can be called with any value of this.
... note: calling this method with a pending promise as the avalue argument, and then calling it again with another value before the promise is resolved or rejected, will have no effect the second time, as the associated promise is already resolved to the pending promise value as its resolution.
...And 5 more matches
PromiseWorker.jsm
like chromeworker objects, promiseworker is mostly used for js-ctypes but it is not limited to that.
...if the worker function does not have any arguments and the empty array should be passed here.
... aclosure optional an object holding strong references to value that should not be garbage-collected before the reply has been received.
...And 5 more matches
Using JavaScript code modules
creating a javascript code module a very simple javascript module looks like this: var exported_symbols = ["foo", "bar"]; function foo() { return "foo"; } var bar = { name : "bar", size : 3 }; var dummy = "dummy"; notice that the module uses normal javascript to create functions, objects, constants, and any other javascript type.
...for example: components.utils.import("resource://app/my_module.jsm"); alert(foo()); // displays "foo" alert(bar.size + 3); // displays "6" alert(dummy); // displays "dummy is not defined" because 'dummy' was not exported from the module note: when you're testing changes to a code module, be sure to change the application's build id (e.g., the version) before your next test run; otherwise, you may find yourself running the previous version of your module's code.
... 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.
...And 5 more matches
Localizing with Mozilla Translator
migrating contents when the directory structure changes overall, if you are a ''good'' mt user and you do things like: checking "keep original" flags for strings not needing translation, instead of just leaving the translation empty struggling to get empty lists when running "untranslated strings" and "view fuzzy" if you are up to date in localization regularly running qa checks and trying to minimize them.
... |-- browser-region | `-- region.properties `-- ab-cd |-- alerts | `-- notificationnames.properties |-- autoconfig | `-- autoconfig.properties |-- cookie | |-- cookieacceptdialog.dtd | `-- cookieacceptdialog.properties |-- global | |-- about.dtd | |-- apppicker.dtd .
... but in the cvs and mozilla-central repositories the locale part looks like this: toolkit |-- locales | |-- en-us | | |-- chrome | | | |-- alerts | | | | `-- notificationnames.properties | | | |-- autoconfig | | | | `-- autoconfig.properties | | | |-- cookie | | | | |-- cookieacceptdialog.dtd | | | | `-- cookieacceptdialog.properties | | | |-- global | | | | |-- about.dtd | | | | |-- apppicker.dtd .
...And 5 more matches
Localizing without a specialized tool
if you choose to localize mozilla with nothing more than a text editing application and not a specialized tool, this document (along with create a new localization) will enable you to learn just what needs to be done.
... you cannot begin localizing mozilla file by file without a specialized tool without going through the create a new localization page.
...going one-by-one with your compare-locales output open for review, we will start with the first file with "// add and localize this file" note.
...And 5 more matches
Initial setup
they're not required for you to begin contributing, but will be required when you are preparing to produce an official release.
...hg commit access is not necessary to begin localizing.
...it will also notify us when you're having problems unique to your localization team's work.
...And 5 more matches
Investigating leaks using DMD heap scan mode
a garbage collector log will also be created, which you may not need.
... identifying the root in the cycle collector log the next step is to figure out why the cycle collector could not collect the window, using the find_roots.py script from the heapgraph repository.
...most of the time, the actual chain is not important, because the cycle collector can only tell us about what went right.
...And 5 more matches
about:memory
it is present in all builds and does not require any preparation to be used.
... note that in both cases the generated data contains privacy-sensitive details such as the full list of the web pages you have open in other tabs.
... if you do not wish to share this information, you can select the "anonymize" checkbox before clicking on "measure and save..." or "measure...".
...And 5 more matches
L20n HTML Bindings
<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).
...</p> the input element is not on the default whitelist but since it's present in the source html, it is also allowed in the translation.
... the value attribute is allowed on input elements, but type is not.
...And 5 more matches
Introduction to Network Security Services
(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 dynamic .dll .so or .sl in addition, win...
... the following shared libraries are standalone loadable modules, not meant to be linked with directly: libfort.so/libfort.sl/fort32.dll provides support for hardware fortezza.
... support for ilp32 in nss 3.2 and later versions, there are two new shared libraries for the platforms hp-ux for parisc cpus and solaris for (ultra)sparc (not x86) cpus.
...And 5 more matches
NSS tools : ssltab
the tool does not automatically detect ssl sessions.
...-p port change the default rendezvous port (1924) to another port.
...although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful.
...And 5 more matches
NSS tools : ssltap
the tool does not automatically detect ssl sessions.
...-p port change the default rendezvous port (1924) to another port.
...although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful.
...And 5 more matches
NSS tools : pk12util
if the prefix sql: is not used, then the tool assumes that the given databases are in the old format.
...changing the names of the certificate and key databases is not recommended.
...] [-c certcipher] [-m|--key_len keylen] [-n|--cert_key_len certkeylen] [-d [sql:]directory] [-p dbprefix] [-k slotpasswordfile|-k slotpassword] [-w p12filepasswordfile|-w p12filepassword] for example: # pk12util -o certs.p12 -n server-cert -d sql:/home/my/sharednssdb enter password for pkcs12 file: re-enter password: listing keys and certificates the information in a .p12 file are not human-readable.
...And 5 more matches
NSS tools : ssltap
MozillaProjectsNSStoolsssltap
the tool does not automatically detect ssl sessions.
... -p port change the default rendezvous port (1924) to another port.
...although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful.
...And 5 more matches
Necko Architecture
architecture after a few iterations of our original design, the current necko architecture looks something like this: urls necko's primary responsibility is moving data from one location, to another location.
...there is a 1-to-1 relationship between uris and channels (if you go so far as to create a channel from a uri, which is not required if all you need is a parsed representation of a uri string).
...because a uri has no self knowledge about what "protocol" it represents, another component is responsible for deciding which channel implementation will be responsible for "loading" the uri.
...And 5 more matches
Shumway
the project is not exactly a developer tool but it is something that content creators should test against (and report bugs or performance issues to).
... 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.
...And 5 more matches
Functions
(but note that objects of other classes can be callable and can even have typeof obj == "function".) script functions functions written in javascript and compiled to bytecode.
...this is slow, not only because walking the scope chain is a drag, but also because we'd rather avoid actually creating the scope chain at all, if possible.
...if we can prove at compile time that a function does not refer to any locals or arguments of enclosing functions, it is a null closure.
...And 5 more matches
JSClass
if objects of this class do not need finalization, use null.
...if your application does not use the jsapi's security features, use null.
...most objects are not callable.
...And 5 more matches
JS_AlreadyHasOwnProperty
*foundp receives true if the property is found or false if it is not found.
...by design, this search may not find a property that other property lookup functions, such as js_lookupproperty, would find.
...they do not search anywhere else for the property.
...And 5 more matches
JS_malloc
allocate and free memory that is not managed by the garbage collector.
...s must not be null.
...when p is not null, js_realloc(cx, p, 0) behaves like js_free(cx, p) and returns null.
...And 5 more matches
XPCOM changes in Gecko 2.0
note that nsigenericfactory.h has been removed.
...note: binary xpcom components must be recompiled for every new major release of firefox starting with firefox 4.
...also note that extensions using binary components must now use the unpack property in the install manifest.
...And 5 more matches
NS_ConvertASCIItoUTF16
@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prun...
...ichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 rfind(const char*, prbool, print32, print32) const - source parameters char* acstring prbool aignorecase print32 aoffset print32 acount print32 rfind(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 rfind(const prunichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfindchar print32 rfindchar(prunichar, print32, print32) const - source parameters prunichar achar print32 aoffset print3...
...And 5 more matches
NS_ConvertUTF16toUTF8
@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param...
... astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 rfind(const char*, prbool, print32, print32) const - source parameters char* acstring prbool aignorecase print32 aoffset print32 acount rfindchar print32 rfindchar(prunichar, print32, print32) const - source parameters prunichar achar print32 aoffset print32 acount findcharinset print32 findcharinset(const char*, print32) const - source this method searches this string for the first character found in the given string.
...And 5 more matches
NS_ConvertUTF8toUTF16
@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prun...
...ichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 rfind(const char*, prbool, print32, print32) const - source parameters char* acstring prbool aignorecase print32 aoffset print32 acount print32 rfind(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 rfind(const prunichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfindchar print32 rfindchar(prunichar, print32, print32) const - source parameters prunichar achar print32 aoffset print3...
...And 5 more matches
NS_LossyConvertUTF16toASCII
@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param...
... astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 rfind(const char*, prbool, print32, print32) const - source parameters char* acstring prbool aignorecase print32 aoffset print32 acount rfindchar print32 rfindchar(prunichar, print32, print32) const - source parameters prunichar achar print32 aoffset print32 acount findcharinset print32 findcharinset(const char*, print32) const - source this method searches this string for the first character found in the given string.
...And 5 more matches
nsFixedCString
@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param...
... astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 rfind(const char*, prbool, print32, print32) const - source parameters char* acstring prbool aignorecase print32 aoffset print32 acount rfindchar print32 rfindchar(prunichar, print32, print32) const - source parameters prunichar achar print32 aoffset print32 acount findcharinset print32 findcharinset(const char*, print32) const - source this method searches this string for the first character found in the given string.
...And 5 more matches
nsFixedString
@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prun...
...ichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 rfind(const char*, prbool, print32, print32) const - source parameters char* acstring prbool aignorecase print32 aoffset print32 acount print32 rfind(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 rfind(const prunichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfindchar print32 rfindchar(prunichar, print32, print32) const - source parameters prunichar achar print32 aoffset print3...
...And 5 more matches
nsPromiseFlatCString
@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param...
... astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 rfind(const char*, prbool, print32, print32) const - source parameters char* acstring prbool aignorecase print32 aoffset print32 acount rfindchar print32 rfindchar(prunichar, print32, print32) const - source parameters prunichar achar print32 aoffset print32 acount findcharinset print32 findcharinset(const char*, print32) const - source this method searches this string for the first character found in the given string.
...And 5 more matches
nsPromiseFlatString
@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prun...
...ichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 rfind(const char*, prbool, print32, print32) const - source parameters char* acstring prbool aignorecase print32 aoffset print32 acount print32 rfind(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 rfind(const prunichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfindchar print32 rfindchar(prunichar, print32, print32) const - source parameters prunichar achar print32 aoffset print3...
...And 5 more matches
RefPtr
it is similar to nscomptr, but does not require that the type be an xpcom interface.
... so for xpcom interfaces: nscomptr<nsisupports> a; nscomptr<nsifoo> foo; and for concrete classes: refptr<nsfoo> foo; // class that implements nsifoo; refptr<bar> bar; // some random class that i want ref-counted but has nothing to do with xpcom: // just implement addref() and release() and it will work with refptr it is important that nscomptr is not used to hold a pointer to a concrete class since this can cause compile time errors or runtime errors.
... while refptr should not generally be used to hold a pointer to an xpcom interface, this is flexible.
...And 5 more matches
nsXPIDLCString
@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param...
... astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 rfind(const char*, prbool, print32, print32) const - source parameters char* acstring prbool aignorecase print32 aoffset print32 acount rfindchar print32 rfindchar(prunichar, print32, print32) const - source parameters prunichar achar print32 aoffset print32 acount findcharinset print32 findcharinset(const char*, print32) const - source this method searches this string for the first character found in the given string.
...And 5 more matches
nsXPIDLString
@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prun...
...ichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 rfind(const char*, prbool, print32, print32) const - source parameters char* acstring prbool aignorecase print32 aoffset print32 acount print32 rfind(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 rfind(const prunichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfindchar print32 rfindchar(prunichar, print32, print32) const - source parameters prunichar achar print32 aoffset print3...
...And 5 more matches
nsIAccessibleEditableText
exceptions thrown ns_error_failure indicates the text cannot be copied into the clipboard.
... exceptions thrown ns_error_failure indicates the text cannot be deleted or copied into the clipboard.
... exceptions thrown ns_error_failure indicates the text cannot be deleted.
...And 5 more matches
nsIAccessibleStates
state_mixed 0x00000020 indicates that the state of a three-state check box or toolbar button is not determined.
... state_busy 0x00000800 the control cannot accept input at this time.
... state_floating 0x00001000 children "owned" not "contained" by parent.
...And 5 more matches
nsIAccessibleText
text boundary constants constant value description boundary_char 0 boundary_word_start 1 boundary_word_end 2 boundary_sentence_start 3 do not use in new code.
... boundary_sentence_end 4 do not use in new code.
...because it does not represent an existing character its bounding box is defined in relation to preceding characters.
...And 5 more matches
nsIBrowserSearchService
this is not an issue if your code is executed in reaction to a user interaction, as initialization is complete by then, but this is an issue if your code is executed during startup.
...if this value is false, the engine will be added to the list upon successful load, but it will not be selected as the current engine.
... callback a nsisearchinstallcallback that will be notified when the addition is complete, or if the addition fails.
...And 5 more matches
nsICacheEntryDescriptor
this fails if the storage policy is not store_in_memory.
...once doomed a cache entry cannot be undoomed.
...this means that pending requests will not get a cache descriptor.
...And 5 more matches
nsICacheSession
does not block the calling thread.
... instead, the listener will be notified when the descriptor is available.
...listener the cache listener to be notified.
...And 5 more matches
nsIContentSecurityPolicy
calls to this may trigger violation reports when queried, so this value should not be cached.
...calls to this may trigger violation reports when queried, so this value should not be cached.
...this is a barrier for the nsdocument so it doesn't load any sub-content until either it knows that a content security policy is ready or will not be used.
...And 5 more matches
nsIFeed
1.0 66 introduced gecko 1.8 inherits from: nsifeedcontainer last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type description cloud nsiwritablepropertybag2 the cloud element on a feed is used to identify the api endpoint of an rsscloud ping server, which distributes notifications of changes to this feed.
... skipdays nsiarray an array of days of the week on which the feed should not be fetched.
...for example, to skip fetching on mondays, a feed that does not want to be fetched on mondays would specify "monday" in this array.
...And 5 more matches
nsIFilePicker
nit(in nsidomwindow parent, in astring title, in short mode); void open(in nsifilepickershowncallback afilepickershowncallback); short show(); obsolete since gecko 57.0 attributes attribute type description addtorecentdocs boolean if true, the file is added to the operating system's "recent documents" list (if the operating system has one; nothing happens if there is no such concept on the user's platform).
... note: only works with modeopenmultiple mode.
...the filter appended first will be used to display the nsifilepicker dialog, the user may then select another from the list.
...And 5 more matches
nsIModule
ompmgr, in nscidref aclass, in nsiidref aiid, [retval, iid_is(aiid)] out nsqiresult aresult); void registerself(in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr, in string atype); void unregisterself(in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr); methods canunload() this method may be queried to determine whether or not the component module can be unloaded by xpcom.
... return value indicates to the caller whether or not the component module can be unloaded.
... returning true is not a guarantee that the module will be unloaded.
...And 5 more matches
nsIMutableArray
inherits from: nsiarray last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) consumers of nsiarray should not queryinterface to nsimutablearray unless they own the array.
...note also that null elements can be created as a side effect of insertelementat().
... weak whether or not to store the element using a weak reference.
...And 5 more matches
nsINavHistoryContainerResultNode
rview nsinavhistoryresultnode findnodebydetails(in autf8string auristring, in prtime atime, in long long aitemid, in boolean arecursive); nsinavhistoryresultnode getchild(in unsigned long aindex); unsigned long getchildindex(in nsinavhistoryresultnode anode); attributes attribute type description childcount unsigned long the number of child nodes; accessing this throws an ns_error_not_available exception of containeropen is false.
... childrenreadonly boolean false if the node's list of children can be modified (by adding or removing children, or rearranging them), or true if the user interface should not allow the list of children to be altered.
... haschildren boolean indicates whether or not the node can have children, and may be used whether the container is open or closed.
...And 5 more matches
nsINavHistoryResultNode
for items that are not in a bookmark folder, this value is -1.
...it is not the actual uri of the favicon, but, rather, is something that will resolve to the actual image.
... in most cases, this is an annotation uri that will query the favicon service.
...And 5 more matches
nsIPlacesImportExportService
importhtmlfromfile() obsolete since gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) note: this method has been removed; use the bookmarkhtmlutils.jsm javascript code module instead.
... three nsiobserverservice notifications are fired as a result of the import.
... aisinitialimport whether this is an initial import or not.
...And 5 more matches
nsISound
inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) warning: this interface should not be used to play custom sounds in modern code.
... note that nsisound instances may play the sounds using another thread; however, this is not controlled by the caller.
...init() not strictly necessary, but avoids a delay before the first sound.
...And 5 more matches
nsITraceableChannel
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.
... nsistreamlistener setnewlistener( in nsistreamlistener alistener ); parameters alistener an nsistreamlistener to be notified of events on the http channel.
... implementing nsistreamlistener the nsistreamlistener passed to setnewlistener() should implement the following methods, which are called to notify it of events that occur on the http stream: onstartrequest: an http request is beginning.
...And 5 more matches
nsIWebBrowser
the chrome may optionally implement nsiinterfacerequestor, nsiwebbrowserchromefocus, nsicontextmenulistener and nsitooltiplistener to receive additional notifications from the browser object.
... note: the implementation should not refcount the supplied chrome object; it should assume that a non nsnull value is always valid.
...note: nsiinterfacerequestor and nsiweakreference might also need to be implemented by the chrome object.
...And 5 more matches
Version, UI, and Status Information - Plugins
you can also use the status line to notify the user of plug-in-related information.
...for this reason, your message is always displayed, but you have no control over how long it stays in the status line before another message replaces it.
...if the versions are not compatible, the plug-in can let the user know.
...And 5 more matches
Index - Firefox Developer Tools
5 add-ons web development, web development:tools developer tools that are not built into firefox, but ship as separate add-ons.
...the referent’s properties do not appear directly as properties of the debugger.object instance; the debugger can access them only through methods like debugger.object.prototype.getownpropertydescriptor and debugger.object.prototype.defineproperty, ensuring that the debugger will not inadvertently invoke the referent’s getters and setters.
...the referent's properties do not appear directly as properties of the debugger.object instance; the debugger can access them only through methods like debugger.object.prototype.getownpropertydescriptor and debugger.object.prototype.defineproperty, ensuring that the debugger will not inadvertently invoke the referent's getters and setters.
...And 5 more matches
Intensive JavaScript - Firefox Developer Tools
there's also a video version of this walkthrough: the demo website looks like this: it has three controls: a radio button group to control how to run the javascript: as a single blocking operation in the main thread, as a series of smaller operations in the main thread using requestanimationframe(), or in another thread using a worker.
... leaving the radio button set to "use blocking call in main thread", make a recording: press the "start animations" button start recording a performance profile press "do pointless computations!" two or three times stop recording the profile exactly what you see will vary from one machine to another, but it will be something like this: the top half of this is the waterfall overview.
...here's the code, together with its immediate caller: const iterations = 50; const multiplier = 1000000000; function calculateprimes(iterations, multiplier) { var primes = []; for (var i = 0; i < iterations; i++) { var candidate = i * (multiplier * math.random()); var isprime = true; for (var c = 2; c <= math.sqrt(candidate); ++c) { if (candidate % c === 0) { // not prime isprime = false; break; } } if (isprime) { primes.push(candidate); } } return primes; } function dopointlesscomputationswithblocking() { var primes = calculateprimes(iterations, multiplier); pointlesscomputationsbutton.disabled = false; console.log(primes); } we're just running a (very inefficient) primality test 50 times, for some q...
...And 5 more matches
AudioListener - Web APIs
it is important to note that there is only one listener per context and that it isn't an audionode.
...this is why these values are not marked read only, which is how they appear in the specification's idl.
... note: although these methods are deprecated they are currently the only way to set the orientation and position in firefox, internet explorer and safari.
...And 5 more matches
BiquadFilterNode.type - Web APIs
not used highpass standard second-order resonant highpass filter with 12db/octave rolloff.
... not used bandpass standard second-order bandpass filter.
... not used lowshelf standard second-order lowshelf filer.
...And 5 more matches
characteristic - Web APIs
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).
... full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only.
...And 5 more matches
readValue() - Web APIs
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).
... full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only.
...And 5 more matches
uuid - Web APIs
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).
... full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only.
...And 5 more matches
value - Web APIs
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).
... full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only.
...And 5 more matches
writeValue() - Web APIs
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).
... full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only.
...And 5 more matches
Using the CSS Typed Object Model - Web APIs
you'll notice a difference in the margin-top and margin-bottom default computed values.
... you'll note that custom properties retain the value as written in the stylesheet, whereas computed styles will be listed as the computed value — color was listed as an rgb() value and the font-weight returned was 700 even though we use a named color and and the bold keyword.
...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 undefined you'll note the <length> unit returned is px, the <percentage> unit returned is percent, the <time> unit is s for 'seconds', and the unitless <number> unit is number.
...And 5 more matches
CloseEvent - Web APIs
note that the 1xxx codes are only websocket-internal and not for the same meaning by the transported data (like when the application-layer protocol is invalid).
... status code name description 0–999 reserved and not used.
... 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).
...And 5 more matches
Constraint validation API - Web APIs
note: client-side constraint validation doesn't remove the need for validation on the server side.
...you should not rely on it to completely sanitize data received by the server.
... invalid event this event type is fired at a form control element if the element does not satisfy its constraints.
...And 5 more matches
CustomEvent - Web APIs
note: this feature is available in web workers.
... this interface inherits properties from its parent, event: event.bubbles read only a boolean indicating whether or not the event bubbles up through the dom.
... event.composed read only a boolean indicating whether or not the event can bubble across the boundary between the shadow dom and the regular dom.
...And 5 more matches
Document.createNodeIterator() - Web APIs
since attributes are never children of other nodes, they do not appear when traversing over the document tree.
...since entities are not part of the document tree, they do not appear when traversing over the document tree.
... nodefilter.show_notation 2048 shows notation nodes.
...And 5 more matches
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
the dom methods presented here are not specific to html; they also apply to xml.
...extnode("cell in row "+i+", column "+j); cell.appendchild(celltext); row.appendchild(cell); } // add the row to the end of the table body tblbody.appendchild(row); } // put the <tbody> in the <table> tbl.appendchild(tblbody); // appends <table> into <body> body.appendchild(tbl); // sets the border attribute of tbl to 2; tbl.setattribute("border", "2"); } note the order in which we created the elements and the text node: first we created the <table> element.
... myp.appendchild(mytextnode); after testing this sample, note that the words hello and world are together: helloworld.
...And 5 more matches
Element.getClientRects() - Web APIs
firefox 3.5 note firefox 3.5 adds width and height properties to the textrectangle object.
... the returned rectangles do not include the bounds of any child elements that might happen to overflow.
... for html <area> elements, svg elements that do not render anything themselves, display:none elements, and generally any elements that are not directly rendered, an empty list is returned.
...And 5 more matches
Element.innerHTML - Web APIs
WebAPIElementinnerHTML
note: if a <div>, <span>, or <noembed> node has a child text node that includes the characters (&), (<), or (>), innerhtml returns these characters as the html entities "&amp;", "&lt;" and "&gt;" respectively.
... exceptions syntaxerror an attempt was made to set the value of innerhtml using a string which is not properly-formed html.
... usage notes the innerhtml property can be used to examine the current html source of the page, including any changes that have been made since the page was initially loaded.
...And 5 more matches
Element: mousewheel event - Web APIs
note: on macos, the scroll distance (and therefore the value of detail) is computed based on the accelerated scroll distance.
...however, the meaning of the amount of these values is not the same between browsers.
... ie and opera (presto) only support wheeldelta attribute and do not support horizontal scroll.
...And 5 more matches
Event - Web APIs
WebAPIEvent
note: one element can have several such handlers, even for the exact same event—particularly if separate, independent code modules attach them, each for its own independent purposes.
... note that all event interfaces have names which end in "event".
... properties event.bubbles read only a boolean indicating whether or not the event bubbles up through the dom.
...And 5 more matches
FileSystemDirectoryEntry - Web APIs
if you try creating a directory using a full path that includes parent directories that do not exist yet, an error is returned.
... nosafari ios full support 11.3samsung internet android full support yesgetdirectory experimentalchrome full support 8edge full support 79firefox full support 50notes full support 50notes notes in firefox, the errorcallback's input parameter is a domexception rather than a fileerror object.ie no support noopera no support nosafari full support 11.1webview android f...
...ull support ≤37chrome android full support 18firefox android full support 50notes full support 50notes notes in firefox, the errorcallback's input parameter is a domexception rather than a fileerror object.opera android no support nosafari ios full support 11.3samsung internet android full support yesgetfile experimentalchrome full support 8edge full support 79firefox full support ...
...And 5 more matches
FileHandle API - 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.
...both of these are just descriptive and are not used by the database.
...And 5 more matches
msAudioCategory - 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.
... note that you must set the msaudiocategory before setting the src property in code.
...And 5 more matches
HTMLFormElement - Web APIs
htmlformelement.novalidate a boolean reflecting the value of the form's novalidate html attribute, indicating whether the form should not be validated.
... checkvalidity() returns true if the element's child controls are subject to constraint validation and satisfy those contraints; returns false if some controls do not satisfy their constraints.
... fires an event named invalid at any control that does not satisfy its constraints; such controls are considered invalid if the event is not canceled.
...And 5 more matches
HTMLInputElement.stepUp() - Web APIs
the htmlinputelement.stepup() method increments the value of a numeric type of <input> element by the value of the step attribute, or the default step value if the step attribute is not explicitly set.
... the method, when invoked, increments the value by (step * n), where n defaults to 1 if not specified, and step defaults to the default value for step if not specified.
...the method will not cause the value to exceed the set max value, or defy the constraints set by the step attribute.
...And 5 more matches
IDBCursor - Web APIs
WebAPIIDBCursor
note: not to be confused with idbcursorwithvalue which is just an idbcursor interface with an additional value property.
... note: this feature is available in web workers.
... properties note: idbcursorwithvalue is an idbcursor interface with an additional value property.
...And 5 more matches
IDBCursorSync - Web APIs
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.
...And 5 more matches
IDBDatabase.transaction() - Web APIs
note: this feature is available in web workers.
...since such catastrophic events are rare most consumers should not need to concern themselves further.
... note: in firefox, if you wish to ensure durability for some reason (e.g.
...And 5 more matches
IDBDatabase - Web APIs
note: this feature is available in web workers.
... note: everything you do in indexeddb always happens in the context of a transaction, representing interactions with data in the database.
...thus, you cannot execute commands, access data, or open anything outside of a transaction.
...And 5 more matches
IDBFactory.open() - Web APIs
WebAPIIDBFactoryopen
note: this feature is available in web workers.
...if the version is not provided and the database exists, then a connection to the database will be opened without changing its version.
... if the version is not provided and the database does not exist, then it will be created with version 1.
...And 5 more matches
IDBFactory - Web APIs
you open — that is, create and access — and delete a database with this object, and not directly with idbfactory.
... note: this feature is available in web workers.
...for a full working example, see our to-do notifications app (view example live.) // in the following line, you should include the prefixes of implementations you want to test.
...And 5 more matches
IDBIndexSync - Web APIs
if this attribute is null, this index is not auto-populated.
... exceptions this method can raise an idbdatabaseexception with the following code: not_found_err if no record exists in this index for the given key.
... exceptions this method can raise a idbdatabaseexception with the following code: not_found_err if no record exists in this index for the given key.
...And 5 more matches
IDBObjectStore.add() - Web APIs
note: this feature is available in web workers.
... the object store uses in-line keys but no key generator, and the object store's key path does not yield a valid key.
... the key parameter was provided but does not contain a valid key.
...And 5 more matches
IDBObjectStore.put() - Web APIs
the put() method of the idbobjectstore interface updates a given record in a database, or inserts a new record if the given item does not already exist.
... note: this feature is available in web workers.
...this is only needed for object stores that have an autoincrement primary key, therefore the key is not in a field on the record object.
...And 5 more matches
IDBTransaction.oncomplete - Web APIs
note: this feature is available in web workers.
... note: in firefox, if you wish to ensure durability for some reason (e.g.
... you're storing critical data that cannot 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.
...And 5 more matches
IndexedDB API - Web APIs
note: this feature is available in web workers.
... note: indexeddb api is powerful, but may seem too complicated for simple cases.
... note: like most web storage solutions, indexeddb follows a same-origin policy.
...And 5 more matches
LocalFileSystem - Web APIs
for example, if you were to create a mail app, you might create a temporary storage for caching assets (like images and attachments) to speed up performance, while creating persistent storage for unique data—such as drafts of emails that were composed while offline—that should not be lost before they are backed up into the cloud.
... another api, the quota management api, lets you query an origin's current quota usage and allocation using window.webkitpersistentstorage.queryusageandquota().
...this means that your app cannot read, or write the files of another app's files.
...And 5 more matches
MediaStreamTrack - Web APIs
not doing so correctly will result in your code being unreliable.
... mediastreamtrack.enabled a boolean whose value of true if the track is enabled, that is allowed to render the media source stream; or false if it is disabled, that is not rendering the media source stream but silence and blackness.
... note: you can implement standard "mute" functionality by setting enabled to false.
...And 5 more matches
MutationObserver.observe() - Web APIs
the mutationobserver method observe() configures the mutationobserver callback to begin receiving notifications of changes to the dom that match the given options.
... exceptions typeerror thrown in any of the following circumstances: the options are configured such that nothing will actually be monitored.
... (for example, if mutationobserverinit.childlist, mutationobserverinit.attributes, and mutationobserverinit.characterdata are all false.) the value of options.attributes is false (indicating that attribute changes are not to be monitored), but attributeoldvalue is true and/or attributefilter is present.
...And 5 more matches
ProgressEvent.initProgressEvent() - Web APIs
note: this method has been dropped during the standard process.
...do not use it anymore, use the standard constructor, progressevent(), to create a synthetic progressevent syntax progress.initprogressevent(typearg, canbubblearg, cancelablearg, lengthcomputable, loaded, total); parameters typearg is a domstring identifying the specific type of animation event that occurred.
... canbubblearg is a boolean flag indicating if the event can bubble (true) or not (false).
...And 5 more matches
RTCConfiguration - Web APIs
properties bundlepolicy optional specifies how to handle negotiation of candidates when the remote peer is not compatible with the sdp bundle standard.
... this configuration option cannot be changed after it is first specified; once the certificates have been set, this property is ignored in future calls to rtcpeerconnection.setconfiguration().
...a value of relay limits the candidates to those relayed through another server, such as a stun or turn server.
...And 5 more matches
SVGLengthList - Web APIs
note: starting in gecko 5.0,the svglengthlist dom interface is now indexable and can be accessed like arrays interface overview also implement none methods void clear() svglength initialize(in svglength newitem) svglength getitem(in unsigned long index) svglength insertitembefore(in svglength newitem, in unsigned long index) svglength replaceitem(in svglength newitem, in unsigned long index) svglength removeitem(in unsigned long index) svglength appenditem(in svglength newitem) properties ...
...the inserted item is the item itself and not a copy.
...the returned item is the item itself and not a copy.
...And 5 more matches
SVGNumberList - Web APIs
note: starting in gecko 5.0,the svgnumberlist dom interface is now indexable and can be accessed like arrays.
...the inserted item is the item itself and not a copy.
...the returned item is the item itself and not a copy.
...And 5 more matches
ServiceWorkerGlobalScope - Web APIs
developers should keep in mind that the serviceworker state is not persisted across the termination/restart cycle, so each event handler should assume it's being invoked with a bare, default global state.
... additionally, synchronous requests are not allowed from within a service worker — only asynchronous requests, like those initiated via the fetch() method, can be used.
... notificationclick occurs when a user clicks on a displayed notification.
...And 5 more matches
WebGLRenderingContext.vertexAttribPointer() - Web APIs
cannot be larger than 255.
... if stride is 0, the attribute is assumed to be tightly packed, that is, the attributes are not interleaved but each attribute is in a separate block, and the next vertex' attribute follows immediately after the current vertex.
... a gl.invalid_operation error is thrown if stride and offset are not multiples of the size of the data type.
...And 5 more matches
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
note: webrtc actually uses srtp (secure real-time transport protocol) to ensure that the exchanged data is secure and authenticated as appropriate.
...the more time lag there is between one user saying something and another hearing it, the more likely there is to be episodes of cross-talking and other forms of confusion.
... key features of rtp before examining rtp's use in webrtc contexts, it's useful to have a general idea of what rtp does and does not offer.
...And 5 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
note that this code is identical for both peers involved in the connection.
...the stun server listed here is obviously not a real one; you'll need to replace stun.myserver.tld with the address of a real stun server.
... connecting to a remote peer the start() function shown here can be called by either of the two end-points that want to talk to one another.
...And 5 more matches
A simple RTCDataChannel sample - Web APIs
we'll cover the mechanics of accomplishing the connection and transmitting and receiving data, but we will save the bits about locating and linking to a remote computer for another example.
...there's nothing incredibly complicated here.
... note: even though both ends of our connection will be on the same page, we're going to refer to the one that starts the connection as the "local" one, and to the other as the "remote" end.
...And 5 more matches
Using WebRTC data channels - Web APIs
this is the easy way, and works for a wide variety of use cases, but may not be flexible enough for your needs.
...this signals to the peer connection to not attempt to negotiate the channel on your behalf.
...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.
...And 5 more matches
Background audio processing using AudioWorklet - Web APIs
it's worth noting that because audio processing can often involve substantial computation, your processor may benefit greatly from being built using webassembly, which brings near-native or fully native performance to web apps.
... basic code framework the barest framework of an audio processor class looks like this: class myaudioprocessor extends audioworkletprocessor { constructor() { super(); } process(inputlist, outputlist, parameters) { /* using the inputs (or not, as needed), write the output into each of the outputs */ return true; } }; registerprocessor("my-audio-processor", myaudioprocessor); after the implementation of the processor comes a call to the global function registerprocessor(), which is only available within the scope of the audio context's audioworklet, which is the invoker of the processor script as a result of your call ...
...num]; let channelcount = math.min(input.length, output.length); for (let channelnum = 0; channelnum < channelcount; channelnum++) { let samplecount = input[channelnum].length; for (let i = 0; i < samplecount; i++) { let sample = input[channelnum][i]; /* manipulate the sample */ output[channelnum][i] = sample; } } }; return true; } note that when determining the number of sources to process and send through to the corresponding outputs, we use math.min() to ensure that we only process as many channels as we have room for in the output list.
...And 5 more matches
Visualizations with Web Audio API - Web APIs
note: you can find working examples of all the code snippets in our voice-change-o-matic demo.
...or example: var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); this node is then connected to your audio source at some point between your source and your destination, for example: source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(audioctx.destination); note: you don't need to connect the analyser's output to another node for it to work, as long as the input is connected to the source, either directly or via another node.
... the analyser node will then capture audio data using a fast fourier transform (fft) in a certain frequency domain, depending on what you specify as the analysernode.fftsize property value (if no value is specified, the default is 2048.) note: you can also specify a minimum and maximum power value for the fft data scaling range, using analysernode.mindecibels and analysernode.maxdecibels, and different data averaging constants using analysernode.smoothingtimeconstant.
...And 5 more matches
Synchronous and asynchronous requests - Web APIs
console.error("the request for " + url + " timed out."); }; xhr.onload = function() { if (xhr.readystate === 4) { if (xhr.status === 200) { callback.apply(xhr, args); } else { console.error(xhr.statustext); } } }; xhr.open("get", url, true); xhr.timeout = timeout; xhr.send(null); } notice the addition of code to handle the "timeout" event by setting the ontimeout handler.
... note: support for timeout was added in gecko 12.0.
... synchronous request note: starting with gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27), blink 39.0, and edge 13, synchronous requests on the main thread have been deprecated due to their negative impact on the user experience.
...And 5 more matches
XRSession - Web APIs
WebAPIXRSession
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 imagery with it.
... note: environmentblendmode() is part of the webxr augmented reality module, which has not been completed.
... visibilitystate read only a domstring whose value is one of those found in the xrvisibilitystate enumerated type, indicating whether or not the session's imagery is visible to the user, and if so, if it's being visible but not currently the target for user events.
...And 5 more matches
XSL Transformations in Mozilla FAQ - Web APIs
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.
...And 5 more matches
Using the status role - Accessibility
the status role is a type of live region and a container whose content is advisory information for the user that is not important enough to justify an alert, and is often presented as a status bar.
... when the role is added to an element, the browser will send out an accessible status event to assistive technology products which can then notify the user about it.
... status information content must be provided within a status object, and it should be ensured that this object does not receive focus.
...And 5 more matches
Web applications and ARIA FAQ - Accessibility
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.
... no live region support currently note: early versions of these tools often had partial or buggy aria implementations.
...And 5 more matches
-moz-user-input - CSS: Cascading Style Sheets
note: -moz-user-input was one of the proposals leading to the proposed css 3 user-input property, which has not yet reached candidate recommendation (call for implementations).
... syntax values none the element does not respond to user input, and it does not become :active.
...please note that this value is no longer supported in firefox 60 onwards (bug 1405087).
...And 5 more matches
@charset - CSS: Cascading Style Sheets
WebCSS@charset
it must be the first element in the style sheet and not be preceded by any character; as it is not a nested statement, it cannot be used inside conditional group at-rules.
... if several @charset at-rules are defined, only the first one is used, and it cannot be used inside a style attribute on an html element or inside the <style> element where the character set of the html page is relevant.
...this method is obsoleted in html5 and must not be used.
...And 5 more matches
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
note: the alignment properties in flexbox have been placed into their own specification — css box alignment level 3.
...i have targeted the first item using a first-child selector and set that item to align-self: stretch; another item has been selected using its class of selected and given align-self: center.
... the align-content property takes the following values: align-content: flex-start align-content: flex-end align-content: center align-content: space-between align-content: space-around align-content: stretch align-content: space-evenly (not defined in the flexbox specification) in the live example below, the flex container has a height of 400 pixels, which is more than needed to display our items.
...And 5 more matches
Ordering Flex Items - CSS: Cascading Style Sheets
the specification says the following on this matter: “note: the reordering capabilities of flex layout intentionally affect only the visual rendering, leaving speech order and navigation based on the source order.
... this allows authors to manipulate the visual presentation while leaving the source order intact for non-css uas and for linear models such as speech and sequential navigation.” - ordering and orientation if your items were links or some other element that the user could tab to, then the tabbing order would be the order that these items appear in the document source — not your visual order.
...the specification continues with a warning not to use reordering to fix issues in your source: “authors must not use order or the *-reverse values of flex-flow/flex-direction as a substitute for correct source ordering, as that can ruin the accessibility of the document.” note: for some years firefox had a bug whereby it would attempt to follow the visual order and not the source order, making it behave differently to other browsers.
...And 5 more matches
Introduction to formatting contexts - CSS: Cascading Style Sheets
creating a new block formatting context the <html> element is not the only element capable of creating a block formatting context.
...as explained in the guide to in-flow and out of flow elements, the float has been taken out of flow so the background and border of the div only contain the content and not the float.
...in addition, it is potentially not very readable for a future developer, as it may not be obvious why you used overflow for this purpose.
...And 5 more matches
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
.main-head { grid-area: header; } .content { grid-area: content; } .main-nav { grid-area: nav; } .side { grid-area: sidebar; } .ad { grid-area: ad; } .main-footer { grid-area: footer; } this will not create any layout, however our items now have names we can use to do so.
...i have not defined any column or row tracks but this layout dictates a single column, and rows will be created as needed for each of the items in the implicit grid.
...as you can see, we do not need to add any markup to create a row, grid systems need to do this to stop elements popping up into the row above.
...And 5 more matches
Scaling of SVG backgrounds - CSS: Cascading Style Sheets
it's worth noting that the sizing algorithm only cares about the image's dimensions and proportions, or lack thereof.
... note: the screenshots below show the expected rendering.
... not all browsers currently render these correctly.
...And 5 more matches
Specificity - CSS: Cascading Style Sheets
note: proximity of elements in the document tree has no effect on the specificity.
... universal selector (*), combinators (+, >, ~, ' ', ||) and negation pseudo-class (:not()) have no effect on specificity.
... (the selectors declared inside :not() do, however.) for more information, visit: "specificity" in "cascade and inheritance", you can also visit: https://specifishity.com inline styles added to an element (e.g., style="font-weight: bold;") always overwrite any styles in external stylesheets, and thus can be thought of as having the highest specificity.
...And 5 more matches
contain - CSS: Cascading Style Sheets
WebCSScontain
this allows the browser to recalculate layout, style, paint, size, or any combination of them for a limited area of the dom and not the entire page, leading to obvious performance benefits.
... note: if applied (with value: paint, strict or content), this property creates: a new containing block (for the descendants whose position property is absolute or fixed).
... layout indicates that nothing outside the element may affect its internal layout and vice versa.
...And 5 more matches
<easing-function> - CSS: Cascading Style Sheets
the <easing-function> css data type denotes a mathematical function that describes how fast one-dimensional values change during animations.
... the cubic-bezier() class of easing functions the cubic-bezier() functional notation defines a cubic bézier curve.
... not all cubic bézier curves are suitable as easing functions as not all are mathematical functions; i.e., curves that for a given abscissa have zero or one value.
...And 5 more matches
font-variant-alternates - CSS: Cascading Style Sheets
/* keyword values */ font-variant-alternates: normal; font-variant-alternates: historical-forms; /* functional notation values */ font-variant-alternates: stylistic(user-defined-ident); font-variant-alternates: styleset(user-defined-ident); font-variant-alternates: character-variant(user-defined-ident); font-variant-alternates: swash(user-defined-ident); font-variant-alternates: ornaments(user-defined-ident); font-variant-alternates: annotation(user-defined-ident); font-variant-alternates: swash(ident1) annotation(ident2); /* global values */ font-variant-alternates: initial; font-variant-alternates: inherit; font-v...
...ariant-alternates: unset; the @font-feature-values at-rule can define names for alternative glyph functions (stylistic, styleset, character-variant, swash, ornament or annotation), associating the name with opentype parameters.
... historical-forms this keyword enables historical forms — glyphs that were common in the past but not today.
...And 5 more matches
grid-column - CSS: Cascading Style Sheets
the grid-column css shorthand property specifies a grid item's size and location within a grid column by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area.
... values auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1.
... note: named grid areas automatically generate implicit named lines of this form, so specifying grid-column: foo; will choose the start/end edge of that named grid area (unless another line named foo-start/foo-end was explicitly specified before it).
...And 5 more matches
grid-row - CSS: Cascading Style Sheets
WebCSSgrid-row
the grid-row css shorthand property specifies a grid item’s size and location within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area.
...area / 6; /* span + <integer> + <custom-ident> values */ grid-row: span 3; grid-row: span somegridarea; grid-row: 5 somegridarea span; grid-row: span 3 / 6; grid-row: span somegridarea / span someothergridarea; grid-row: 5 somegridarea span / 2 span; /* global values */ grid-row: inherit; grid-row: initial; grid-row: unset; values auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1.
... note: named grid areas automatically generate implicit named lines of this form, so specifying grid-row: foo; will choose the start/end edge of that named grid area (unless another line named foo-start/foo-end was explicitly specified before it).
...And 5 more matches
<integer> - CSS: Cascading Style Sheets
WebCSSinteger
note: there is no official range of valid <integer> values.
... examples valid integers 12 positive integer (without a leading + sign) +123 positive integer (with a leading + sign) -456 negative integer 0 zero +0 zero, with a leading + -0 zero, with a leading - invalid integers 12.0 this is a <number>, not an <integer>, though it represents an integer.
... decimal points are not allowed.
...And 5 more matches
justify-items - CSS: Cascading Style Sheets
note that justify-items is ignored in flexbox layouts.
...note that justify-items is ignored in flexbox layouts.
... flex-start for items that are not children of a flex container, this value is treated like start.
...And 5 more matches
repeating-conic-gradient() - CSS: Cascading Style Sheets
note: rendering of color stops in css gradients follows the same rules as color stops in svg gradients.
... if neither the first nor the last color stops include include a a color stop angle greater than 0deg or less than 360 degrees respectively, the conic-gradient will not repeat.
... to create a conic gradient that doe not repeat, make the gradient a full 360 degree rotation, or use the conic-gradient() function instead.
...And 5 more matches
url() - CSS: Cascading Style Sheets
WebCSSurl()
the url() function can be passed as a parameter of another css functions, like the attr() function.
...the url() functional notation is the value for the <url> data type.
...ds.png); src: url('fantasticfont.woff'); offset-path: url(#path); mask-image: url("masks.svg#mask1"); /* properties with fallbacks */ cursor: url(pointer.cur), pointer; /* associated short-hand properties */ background: url('https://mdn.mozillademos.org/files/16761/star.gif') bottom right repeat-x blue; border-image: url("/media/diamonds.png") 30 fill / 30px / 30px space; /* as a parameter in another css function */ background-image: cross-fade(20% url(first.png), url(second.png)); mask-image: image(url(mask.png), skyblue, linear-gradient(rgba(0, 0, 0, 1.0), transparent); /* as part of a non-shorthand multiple value */ content: url(star.svg) url(star.svg) url(star.svg) url(star.svg) url(star.svg); /* at-rules */ @document url("https://www.example.com/") { ...
...And 5 more matches
Setting up adaptive streaming media sources - Developer guides
other reasons to use live profile over ondemand for vod content may be: your client or server does not support range requests your server cannot cache range requests efficiently your server cannot prefetch range requests efficiently the sidx* is large and having to load it first slows down startup a little you want to use the original files for both dash and other forms of delivery (such as microsoft smooth streaming) as a transition strategy you can use the same media files for both live tra...
... note: you will need to be comfortable with make files and installing dependencies to get this software up and running.
... note: since mpeg-dash decoding is done partially using javascript and mse files are often grabbed using xhr, keep same origin rules in mind.
...And 5 more matches
HTML attribute: multiple - HTML: Hypertext Markup Language
in firefox, the file input reads "no files selected" when the attribute is present and "no file selected" when not, when no files are selected.
...the email input displays the same, but will match the :invalid pseudo-class if more than one comma-separated email address is included if the attribute is not present.
... when multiple is set on the email input type, the user can inlclude zero (if not also required), one or more comma-separated email addresses.
...And 5 more matches
HTML attribute: pattern - HTML: Hypertext Markup Language
if the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored.
... some of the input types supporting the pattern attribute, notably the email and url input types, have expected value syntaxes that must be matched.
...user agents may use the title contents during constraint validation to tell the user that the pattern is not matched.
...And 5 more matches
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
WebHTMLElementembed
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.
...And 5 more matches
<input type="hidden"> - HTML: Hypertext Markup Language
WebHTMLElementinputhidden
<input> elements of type hidden let web developers include data that cannot be seen or modified by users when a form is submitted.
... note: there is a live example below the following line of code — if it is working correctly, you should see nothing!
... note: the input and change events do not apply to this input type.
...And 5 more matches
<keygen> - HTML: Hypertext Markup Language
WebHTMLElementkeygen
tag omission must have a start tag and must not have an end tag.
...defaults to an empty string if not specified.
... disabled this boolean attribute indicates that the form control is not available for interaction.
...And 5 more matches
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
WebHTMLElementtrack
tag omission as it is a void element, the start tag must be present and the end tag must not be present.
... default this attribute indicates that the track should be enabled unless the user's preferences indicate that another track is more appropriate.
...the following keywords are allowed: subtitles subtitles provide translation of content that cannot be understood by the viewer.
...And 5 more matches
<ul>: The Unordered List element - HTML: Hypertext Markup Language
WebHTMLElementul
warning: do not use this attribute, as it has been deprecated: use css instead.
...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.
...And 5 more matches
Evolution of HTTP - HTTP
http/0.9 is extremely simple: requests consist of a single line and start with the only possible method get followed by the path to the resource (not the url as both the protocol, server, and port are unnecessary once connected to the server).
...rvers quickly extended it to be more versatile: versioning information is now sent within each request (http/1.0 is appended to the get line) a status code line is also sent at the beginning of the response, allowing the browser itself to understand the success or failure of the request and to adapt its behavior in consequence (like in updating or using its local cache in a specific way) the notion of http headers has been introduced, both for the requests and the responses, allowing metadata to be transmitted and making the protocol extremely flexible and extensible.
...17 content-type: text/html <html> a page with an image <img src="/myimage.gif"> </html> followed by a second connection and request to fetch the image (followed by a response to that request): get /myimage.gif http/1.0 user-agent: ncsa_mosaic/2.0 (windows 3.1) 200 ok date: tue, 15 nov 1994 08:12:32 gmt server: cern/3.0 libwww/2.17 content-type: text/gif (image content) these novelties have not been introduced as concerted effort, but as a try-and-see approach over the 1991-1995 period: a server and a browser added one feature and it saw if it got traction.
...And 5 more matches
HTTP conditional requests - HTTP
these headers define a precondition, and the result of the request will be different if the precondition is matched or not.
...as comparing the whole resource byte to byte is impracticable, and not always what is wanted, the request transmits a value describing the version.
...for example, a page that would differ from another only by a different date in its footer, or different advertising, would be considered identical to the other with weak validation.
...And 5 more matches
CSP: navigate-to - HTTP
the http content-security-policy (csp) navigate-to directive restricts the urls to which a document can initiate navigations by any means including <form> (if form-action is not specified), <a>, window.location, window.open, etc.
... this is an enforcement on what navigations this document initiates not on what this document is allowed to navigate to.
... note: if the form-action directive is present, the navigate-to directive will not act on navigations that are form submissions.
...And 5 more matches
CSP: style-src - HTTP
you can also specify data schemes (not recommended).
...use this sparingly and definitely not for scripts.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
...And 5 more matches
An overview of HTTP - HTTP
WebHTTPOverview
due to its extensibility, it is used to not only fetch hypertext documents, but also images and videos or to post content to servers, like with html form results.
... a server is not necessarily a single machine, but several server software instances can be hosted on the same machine.
... http is stateless, but not sessionless http is stateless: there is no link between two requests being successively carried out on the same connection.
...And 5 more matches
A typical HTTP session - HTTP
WebHTTPSession
in client-server protocols, like http, sessions consist of three phases: the client establishes a tcp connection (or the appropriate connection if the transport layer is not tcp).
... note: the client-server model does not allow the server to send data to the client without an explicit request for it.
...an absolute url without the protocol or domain name the http protocol version subsequent lines represent an http header, giving the server information about what type of data is appropriate (e.g., what language, what mime types), or other data altering its behavior (e.g., not sending an answer if it is already cached).
...And 5 more matches
Keyed collections - JavaScript
one difference to map objects is that weakmap keys are not enumerable (i.e., there is no method giving you a list of the keys).
...everything exposed on the instance and prototype is public; everything else is inaccessible from the outside world because privates is not exported from the module.
... note: remember that set objects store unique values—so any duplicate elements from an array are deleted when converting!
...And 5 more matches
getter - JavaScript
it is not possible to simultaneously have a getter bound to a property and have that property actually hold a value, although it is possible to use a getter and a setter in conjunction to create a type of pseudo-property.
... note the following when working with the get syntax: it can have an identifier which is either a number or a string; it must have exactly zero parameters (see incompatible es5 change: literal getter and setter functions must now have exactly zero or one arguments for more information); it must not appear in an object literal with another get or with a data entry for the same property ({ get x() { }, get x() { } } and { x: ..., get x() { } } are forbidden).
... const obj = { log: ['example','test'], get latest() { if (this.log.length === 0) return undefined; return this.log[this.log.length - 1]; } } console.log(obj.latest); // "test" note that attempting to assign a value to latest will not change it.
...And 5 more matches
Array.prototype.every() - JavaScript
it is not invoked for indexes which have been deleted, or which have never been assigned values.
... every does not mutate the array on which it is called.
...therefore, callback will not run on elements that are appended to the array after the call to every begins.
...And 5 more matches
Array.prototype.find() - JavaScript
callback is invoked for every index of the array, not just those with assigned values.
...if it is not provided, then undefined is used.
... the find method does not mutate the array on which it is called, but the function provided to callback can.
...And 5 more matches
Array.prototype.slice() - JavaScript
the slice() method returns a shallow copy of a portion of an array into a new array object selected from start to end (end not included) where start and end represent the index of items in that array.
... the original array will not be modified.
...slice extracts up to but not including end.
...And 5 more matches
Boolean - JavaScript
do not confuse the primitive boolean values true and false with the true and false values of the boolean object.
... any object of which the value is not undefined or null, including a boolean object whose value is false, evaluates to true when passed to a conditional statement.
... for example, the condition in the following if statement evaluates to true: var x = new boolean(false); if (x) { // this code is executed } this behavior does not apply to boolean primitives.
...And 5 more matches
Date.parse() - JavaScript
it is not recommended to use date.parse as until es5, parsing of strings was entirely implementation dependent.
... the ecmascript specification states: if the string does not conform to the standard format the function may fall back to any implementation–specific heuristics or implementation–specific parsing algorithm.
... however, invalid values in date strings not recognized as simplified iso format as defined by ecma-262 may or may not result in nan, depending on the browser and values provided, e.g.: // non-iso string with invalid date values new date('23/25/2014'); will be treated as a local date of 25 november, 2015 in firefox 30 and an invalid date in safari 7.
...And 5 more matches
Math.random() - JavaScript
the math.random() function returns a floating-point, pseudo-random number in the range 0 to less than 1 (inclusive of 0, but not 1) with approximately uniform distribution over that range — which you can then scale to your desired range.
... the implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user.
... math.random() does not provide cryptographically secure random numbers.
...And 5 more matches
Math.random() - JavaScript
the math.random() function returns a floating-point, pseudo-random number in the range 0 to less than 1 (inclusive of 0, but not 1) with approximately uniform distribution over that range — which you can then scale to your desired range.
... the implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user.
... math.random() does not provide cryptographically secure random numbers.
...And 5 more matches
NaN - JavaScript
the global nan property is a value representing not-a-number.
... the initial value of nan is not-a-number — the same as the value of number.nan.
...even when this is not the case, avoid overriding it.
...And 5 more matches
Number - JavaScript
a number literal like 37 in javascript code is a floating-point value, not an integer.
...(javascript now has a bigint type, but it was not designed to replace number for everyday uses.
... 37 is still a number, not a bigint.) number may also be expressed in literal forms like 0b101, 0o13, 0x0a.
...And 5 more matches
Object.isFrozen() - JavaScript
return value a boolean indicating whether or not the given object is frozen.
... description an object is frozen if and only if it is not extensible, all its properties are non-configurable, and all its data properties (that is, properties which are not accessor properties with getter or setter components) are non-writable.
... examples using object.isfrozen // a new object is extensible, so it is not frozen.
...And 5 more matches
String.prototype.indexOf() - JavaScript
returns -1 if the value is not found.
... note: for the array method, see array.prototype.indexof().
...'undefine'.indexof() however will return -1, as undefined is not found in the string undefine.
...And 5 more matches
String.prototype.replace() - JavaScript
it is treated as a literal string and is not interpreted as a regular expression.
... description this method does not change the calling string object.
...note that this is 1-indexed.
...And 5 more matches
TypedArray - JavaScript
this constructor is not directly exposed: there is no global %typedarray% or typedarray property.
... the %typedarray% constructor on its own is not particularly useful.
...8×10308 8 64-bit ieee floating point number (16 significant digits e.g., 1.123...15) unrestricted double double bigint64array -263 to 263-1 8 64-bit two's complement signed integer bigint int64_t (signed long long) biguint64array 0 to 264-1 8 64-bit unsigned integer bigint uint64_t (unsigned long long) constructor this object cannot be instantiated directly.
...And 5 more matches
WebAssembly.instantiate() - JavaScript
important: this method is not the most efficient way of fetching and instantiating wasm modules.
... exceptions if either of the parameters are not of the correct type or structure, a typeerror is thrown.
... exceptions if either of the parameters are not of the correct type or structure, a typeerror is thrown.
...And 5 more matches
Destructuring assignment - JavaScript
function f() { return [1, 2]; } let a, b; [a, b] = f(); console.log(a); // 1 console.log(b); // 2 ignoring some returned values you can ignore return values that you're not interested in: function f() { return [1, 2, 3]; } const [a, , b] = f(); console.log(a); // 1 console.log(b); // 3 const [c] = f(); console.log(c); // 1 you can also ignore all returned values: [,,] = f(); assigning the rest of an array to a variable when destructuring an array, you can unpack and assign the remaining part of it to a variable using the rest pattern: const [a, ...b] = [...
...1, 2, 3]; console.log(a); // 1 console.log(b); // [2, 3] be aware that a syntaxerror will be thrown if a trailing comma is used on the left-hand side with a rest element: const [a, ...b,] = [1, 2, 3]; // syntaxerror: rest element may not have a trailing comma // always consider using rest operator as the last element unpacking values from a regular expression match when the regular expression exec() method finds a match, it returns an array containing first the entire matched portion of the string and then the portions of the string that matched each parenthesized group in the regular expression.
... destructuring assignment allows you to unpack the parts out of this array easily, ignoring the full match if it is not needed.
...And 5 more matches
export - JavaScript
exported modules are in strict mode whether you declare them as such or not.
... the export statement cannot be used in embedded scripts.
...as name1, variable2 as name2, …, namen }; // exporting destructured assignments with renaming export const { name1, name2: bar } = o; // default exports export default expression; export default function (…) { … } // also class, function* export default function name1(…) { … } // also class, function* export { name1 as default, … }; // aggregating modules export * from …; // does not set the default export export * as name1 from …; // draft ecmascript® 2o21 export { name1, name2, …, namen } from …; export { import1 as name1, import2 as name2, …, namen } from …; export { default } from …; namen identifier to be exported (so that it can be imported via import in another script).
...And 5 more matches
for...in - JavaScript
deleted, added, or modified properties a for...in loop iterates over the properties of an object in an arbitrary order (see the delete operator for more on why one cannot depend on the seeming orderliness of iteration, at least in a cross-browser setting).
...a property that is deleted before it has been visited will not be visited later.
... in general, it is best not to add, modify, or remove properties from the object during iteration, other than the property currently being visited.
...And 5 more matches
let - JavaScript
just like const the let does not create properties of the window object when declared globally (in the top-most scope).
... console.log(x); // 2 } console.log(x); // 2 } function lettest() { let x = 1; { let x = 2; // different variable console.log(x); // 2 } console.log(x); // 1 } at the top level of programs and functions, let, unlike var, does not create a property on the global object.
... break; } however, it's important to point out that a block nested inside a case clause will create a new block scoped lexical environment, which will not produce the redeclaration errors shown above.
...And 5 more matches
switch - JavaScript
(if multiple cases match the provided value, the first case that matches is selected, even if the cases are not equal to each other.) if no matching case clause is found, the program looks for the optional default clause, and if found, transfers control to that clause, executing the associated statements.
...by convention, the default clause is the last clause, but it does not need to be so.
... see example here: var foo = 0; switch (foo) { case -1: console.log('negative 1'); break; case 0: // foo is 0 so criteria met here so this block will run console.log(0); // note: the forgotten break would have been here case 1: // no break statement in 'case 0:' so this case will run as well console.log(1); break; // it encounters this break so will not continue into 'case 2:' case 2: console.log(2); break; default: console.log('default'); } can i put a default between cases?
...And 5 more matches
<mstyle> - MathML
WebMathMLElementmstyle
the <mstyle> element accepts all attributes of all presentation elements with the following exceptions: height, depth or width do not apply to <mglyph>, <mpadded> or <mtable>.
... rowalign, columnalign, or groupalign do not apply to <mtr>, <mlabeledtr>, <mtd> or <maligngroup>.
... lspace or voffset do not apply to <mpadded>.
...And 5 more matches
Digital audio concepts - Web media technologies
note: it's worth noting that some codecs will actually separate the left and right channels, storing them in separate blocks within their data structure.
...since the sample rate corresponds to the number of "slices" a sound wave is divided into for each second of time, it's sometimes thought of as a frequency (in the sense that it's a description of something that repeats periodically, not in terms of actual audio frequency), and the samples per second measurement therefore uses the hertz as its unit.
...not commonly used yet, but this will change over time.
...And 5 more matches
Critical rendering path - Web Performance
if another set of starttag and endtag tokens come between a set of starttag and endtags, you have a node inside a node, which is how we define the hierarchy of the dom tree.
...while the dom construction is incremental, cssom is not.
...the css object model gets built as the css is parsed, but can't be used to build the render tree until it is completely parsed because styles that are going to be overwritten with later parsing should not be rendered to the screen.
...And 5 more matches
Web Performance
the performance cost of animating a css property can vary from one property to another, and animating expensive css properties can result in jank as the browser struggles to hit a smooth frame rate.critical rendering paththe critical rendering path is the sequence of steps the browser goes through to convert the html, css, and javascript into pixels on the screen.
...that means not running all your startup code in a single event handler on the app's main thread.performance budgetsa performance budget is a limit to prevent regressions.
...in this article, we discuss the various loading metrics, animation, and responsiveness metrics, along with best practices to improve user perception, if not the actual timings.
...And 5 more matches
Progressive web app structure - Progressive web apps (PWAs)
it also allows the website to be accessible offline if the network connection is not available.
...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.
... 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.
...And 5 more matches
Progressive loading - Progressive web apps (PWAs)
previous overview: progressive web apps in previous articles we covered apis that help us make our js13kpwa example a progressive web app: service workers, web manifests, notifications and push.
...it's not unusual to have megabytes of image data to download before announcing the site is ready, but this again creates a bad perception of performance.
...the placeholder image is scaled the same way the original images are, so it will take up the same space and not cause the layout to repaint as the images load.
...And 5 more matches
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
<?xslt-param name="color" value="blue"?> <?xslt-param name="size" select="2"?> <?xml-stylesheet type="text/xsl" href="style.xsl"?> note that these pis have no effect when transformation is done using the xsltprocessor object in javascript.
...parsing of any attribute must not fail due to the presence of an unrecognized attribute as long as that attribute follows the syntax in xml-stylesheet.
...note that multiple xml-stylesheet xslt pis are not supported in firefox currently.
...And 5 more matches
WebAssembly Concepts - WebAssembly
it is not primarily intended to be written by hand, rather it is designed to be an effective compilation target for low-level source languages like c, c++, rust, etc.
... note: webassembly will also have uses outside web and javascript environments (see non-web embeddings).
... webassembly is a different language from javascript, but it is not intended as a replacement.
...And 5 more matches
ui/button/action - Archive of obsolete content
a disabled button will not generate click events and its icon will appear disabled: updating state you can update all the button's properties except for its id.
...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 boole...
...disabled buttons appear disabled in the ui, and do not respond to clicks.
...And 4 more matches
ui/toolbar - Archive of obsolete content
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.
... hidden state persists even over create/destroy cycles: if a toolbar is created, then hidden, then destroyed, and another toolbar with the same title is then created, the new toolbar will be in the hidden state.
... hidden boolean boolean indicating whether the frame should be hidden initially or not.
...And 4 more matches
cfx to jpm - Archive of obsolete content
id handling with jpm when you create an xpi with jpm xpi: if the package.json does not include an id field, then the id written into the install.rdf is the value of the name field prepended with "@".
... if the package.json does include an id field, and it does not contain "@", then jpm xpi raises an error and the xpi will not be built.
... what you need to do all this means that: if your package.json contains an id field, and its value does not contain "@", then you must append "@jetpack" to it when switching to jpm.
...And 4 more matches
Extension Packaging - Archive of obsolete content
note: starting in gecko 2.0, xpi files are no longer unpacked when extensions are installed.
...since most http servers are not configured to return this mime type for the .xpi extension by default, you will probably need to configure your http server.
...otherwise, the extension manager may not function properly with the extension, or the extension itself may not work properly.
...And 4 more matches
Getting Started with Firefox Extensions - Archive of obsolete content
it is also worth noting that there are differences between the definition of extension and add-on.
...plugins are entirely different, and they will not be covered here.
... note: this extension is unsigned.
...And 4 more matches
Promises - Archive of obsolete content
while this api does not have direct support for promises, its standard usage is very easy to adapt to a promise-based approach.
... notifyuser(resp.target.responsetext); }); example using promise-based helper the following example relies on the helper function defined below.
... notifyuser(xhr.responsetext); }); downloading remote files nearly all previous methods of downloading remote files have been superseded by the much simpler downloads.jsm module.
...And 4 more matches
Updating addons broken by private browsing changes - Archive of obsolete content
iwebbrowserpersist ff 19: nsicontentprefservice nsidownloadmanager nsidownload nsihttpauthmanager nsistricttransportsecurityservice ff 20: nsiprivatebrowsingservice nsirecentbadcertservice furthermore, if your code uses any of these common chrome apis: ff 19: saveurl saveinternal openlinkin ff 20: openbrowserwindow gprivatebrowsingui finally, if your code watches for any of these observer notifications: private-browsing private-browsing-cancel-vote private-browsing-change-granted private-browsing-transition-complete then your addon will require updating to correctly support the new per-window private browser feature in firefox 20 (and will require updating to work correctly in releases of firefox since the ones listed).
...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.
...And 4 more matches
Using Dependent Libraries In Extension Components - Archive of obsolete content
the firefox extension system does not provide automatic support for loading these dependent libraries, but it is possible to load these libraries explicitly using a component stub.
...note that the "real" component is no longer in the components/ directory, it is in the libraries/ directory.
...005 benjamin smedberg <benjamin@smedbergs.us> #include "nscore.h" #include "nsmodule.h" #include "prlink.h" #include "nsilocalfile.h" #include "nsstringapi.h" #include "nscomptr.h" static char const *const kdependentlibraries[] = { // dependent1.dll on windows, libdependent1.so on linux moz_dll_prefix "dependent1" moz_dll_suffix, moz_dll_prefix "dependent2" moz_dll_suffix, nsnull // note: if the dependent libs themselves depend on other libs, the subdependencies // should be listed first.
...And 4 more matches
Creating a Microsummary - Archive of obsolete content
note: if you are a web site developer, and you want to create microsummaries for pages on your site, you can write generators to do so, but a simpler and more efficient approach is to create the microsummaries on the server-side using the same tools and languages you already use to generate pages.
... add the xslt transform sheet to the generator by including it within a <template> element: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> </transform> </template> </generator> note that while microsummary generators can include arbitrary xslt, including xslt that produces rich text output, firefox currently only displays the text version of the xslt output.
...?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> <output method="text"/> <template match="/"> <value-of select="id('download-count')"/> <text> fx downloads</text> </template> </transform> </template> </generator> note that white space between xslt tags is not included in the xslt output, unlike in html where that white space is collapsed to a single space, so make sure to prepend a space to the phrase in order to separate it from the download count.
...And 4 more matches
Dehydra Object Reference - Archive of obsolete content
intrinsic types such as "int" are not declared and will not have a .loc.
...for example, a pointer type will have .ispointer == true, but a class type will not have an .ispointer property.
...code can be annotated with arbitrary user attributes: __attribute__((user("customstring"))).
...And 4 more matches
Downloading Nightly or Trunk Builds - Archive of obsolete content
note that this is an attempt at describing the current usage of these terms.
... as it turns out there is a platform number for every firefox number, but they are not the same number.
...however, the numbers are not used all of the time.
...And 4 more matches
Style System Overview - Archive of obsolete content
2+ matching rules: cascade decides which wins: sort by origin (ua, user, author) & weight (!important), then specificity of selector, then order example document source <doc> <title>a few quotes</title> <para class="emph"> franklin said that <quote>"a penny saved is a penny earned."</quote> </para> <para> fdr said <quote>"we have nothing to fear but <span class="emph">fear itself.</span>"</quote> </para> </doc> example document tree doc ↙ ↓ ↘ title para class="emph" para ↓ ↓ quote quote ↓ span class="emph" example stylesheet doc { display: block; ...
... the data format of the structs and selectors is mostly clear from the code and not worth going into (although the implementation of :not() is confusing).
...(the context tree can be deep.) each rule node has a per-struct set of “none bits” that say that the rule node's set of rules (the rules on the path to the root) specify nothing non-inherited for the struct.
...And 4 more matches
Twitter - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
... most of twitter's methods are supported, but not all.
... list methods, spam reporting methods, and oauth are not currently supported.
...And 4 more matches
LIR - Archive of obsolete content
eturn a double 9 livei void extend live range of an int 10 liveq void 64 bit extend live range of a quad 11 lived void extend live range of a double 12 file void source filename for debug symbols 13 line void source line number for debug symbols 14 comment void a comment shown, on its own line, in lir dumps 15 not in use load 16 not in use 17 ldc2i integer load char and sign-extend to an int 18 lds2i integer load short and sign-extend to an int 19 lduc2ui integer load unsigned char and zero-extend to an unsigned int 20 ldus2ui integer load unsigned short and zero-extend to an unsigned int 21 ldi integer lo...
... load double 24 ldf2d double load float and extend to a double store 25 sti2c void store int truncated to char 26 sti2s void store int truncated to short 27 sti void store int 28 stq void 64 bit store quad 29 std void store double 30 std2f void store double as a float (losing precision) 31 not in use call 32 not in use 33 callv void call subroutine that returns void 34 calli integer call subroutine that returns an int 35 callq quad 64 bit call subroutine that returns a quad 36 calld double call subroutine that returns a double branch 37 j void jump always 38 jt void jump ...
...if true 39 jf void jump if false 40 jtbl void jump to address in table 41 label void a jump target (no machine code is emitted for this) 42 not in use guards 43 x void exit always 44 xt void exit if true 45 xf void exit if false 46 xtbl void exit via indirect jump 47 xbarrier void a lir_xbarrier cause no code to be generated, but it acts like a never-taken guard in that it inhibits certain optimisations, such as dead stack store elimination.
...And 4 more matches
Proxy UI - Archive of obsolete content
for example, firefox 3: [ ] no proxy [ ] auto-detect proxy settings for this network [ ] manual proxy configuration: [ ] automatic proxy configuration url: behavior default value: "no proxy" is selected all other "type" radio buttons are enabled, but not selected.
...the previously selected radio button becomes unselected, and the related ui of the previous button is disabled (and is not editable).
... the radio buttons do not map to the proxy type in order (due the evolution of the ui): proxy mode "network.proxy.type" no proxy (direct) network.proxy.type=0 auto-detect proxy settings...
...And 4 more matches
Running Tamarin acceptance tests - Archive of obsolete content
note: the name of the avmshell executable varies among the build systems; use the name of the avm shell produced from the build process you used, above.
...notes on using acceptance runtests.py threading in order to speed up the execution time of the acceptance testsuite, the runtests script automatically detects the number of cores on the machine and sets an equivalent number of threads.
... this can be overrided with the threads flag: python ./runtests.py --threads=3 threading on cygwin / windows due to an issue with cygwin python, threading does not work, and threads will always be set to 1.
...And 4 more matches
Venkman Internals - Archive of obsolete content
notes on venkman source code.
... as with any complex application, aspects of the design may not be clear for new readers of the source.
... these notes are written by such readers: as you learn please correct any errors.
...And 4 more matches
execute - Archive of obsolete content
(note that this path points into the xpi itself.) args a parameter string that is passed to the executable.
...see note below.
...see note below.
...And 4 more matches
XPJS Components Proposal - Archive of obsolete content
now, you might ask: "isn't that what xpconnect does?" and i would 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.
... xjs components are not run in browser windows.
...And 4 more matches
Getting File Information - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes.
...if the file does not exist, a 'file not found' exception will occur.
...And 4 more matches
Namespaces - Archive of obsolete content
an xml namespace is identified by an unique name (called a uri, not a url, even though it can look like a url).
...although there's nothing preventing someone else from using the namespace http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul, it's fairly unlikely anyone would choose that accidentally.
... even if they did accidentally choose it, they may not define the same elements as xul anyway (e.g., <textbox/>) in their schema/dtd.
...And 4 more matches
Positioning - Archive of obsolete content
for both top level menus and submenus, they may appear above or to the left instead of their usual placement if there is not enough room to display the menu at full size below or to the right.
... if there is not enough room on either side, the menu will be shrunk down to fit.
... context menus will always appear in this location, and not respect any position attribute value.
...And 4 more matches
Building Menus With Templates - Archive of obsolete content
this means that a menu created with a template will not have any of the generated items until the user opens the menu, or a script opens the menu.
...this allows for better performance as the entire content of a complex menu does not need to be created until the user needs to use the menu.
...the uri attribute has not been placed on the menupopup element which is the direct child of the action element but has instead been placed on the menuitem element.
...And 4 more matches
Multiple Queries - Archive of obsolete content
however, you will probably notice that the one photo that matches the first query has appeared differently that the others.
...note that two of the results above are actually for the same photo (canal.jpg).
...it doesn't matter whether other variables are the same or not.
...And 4 more matches
Template and Tree Listeners - Archive of obsolete content
you would implement this object with these two methods if you wish to be notified when the template is rebuilt using the builder's rebuild call.
... the template builder might also force a rebuild when the underlying data change notifications require it.
...if you try an example using the code above, you will notice that the first tree will maintain the selection when the rebuild button is pressed, whereas in the second tree does not.
...And 4 more matches
Adding Buttons - Archive of obsolete content
adding buttons to a window the window we've created so far has had nothing in it, so it isn't very interesting yet.
...in most cases, you will not use a class for a button.
...if the button is disabled, the function of the button cannot be performed.
...And 4 more matches
Adding Event Handlers - Archive of obsolete content
although it does not matter what the script file is called, usually it would be the same as the xul file with a .js extension.
...for example, you may use urls of the following form: <script src="findfile.js"/> <script src="chrome://findfiles/content/help.js"/> <script src="http://www.example.com/js/items.js"/> this tutorial does not attempt to describe how to use javascript (except as related to event handling) as this is a fairly large topic and there are plenty of other resources that are available for this.
...note that some events don't do the bubbling phase.
...And 4 more matches
Adding Style Sheets - Archive of obsolete content
this method has the disadvantage because it means your application will not be themeable.
...changing the styles however, there will be times when the default look of elements will not give the look that is desired.
...although this works, it is not really the best thing to do.
...And 4 more matches
Grids - Archive of obsolete content
ArchiveMozillaXULTutorialGrids
the grid does not display anything itself; it is used only to position elements in a tabular form with rows and columns.
...note that you do not need an element to declare a cell -- there is no equivalent of the html td element.
...1"> <columns> <column/> <column flex="1"/> </columns> <rows> <row> <label control="doctitle" value="document title:"/> <textbox id="doctitle" flex="1"/> </row> <row> <label control="docpath" value="path:"/> <hbox flex="1"> <textbox id="docpath" flex="1"/> <button label="browse..."/> </hbox> </row> </rows> </grid> notice in the image how the first column of elements containing the labels has only a single element in each row.
...And 4 more matches
Styling a Tree - Archive of obsolete content
adding a style to the treecol element does not cause the style to be applied to the column but only to the header.
...you can style not only the cell and its text, but the twisty and indentation.
...this special syntax is needed because the cells themselves are not separate elements.
...And 4 more matches
XBL Example - Archive of obsolete content
the content of the pages will be specified in the xul file, not in xbl, but we'll need to add it inside the deck.
...the label widget has not appeared as no value has been specified for it.
...the anonymous array isn't used as the deck is not anonymous from the box.
...And 4 more matches
Using Visual Studio as your XUL IDE - Archive of obsolete content
compared to a simple text-editor, visual studio gives you some special features when writing xul: intellisense / autocompletion for elements and attributes validation syntax coloring (okay, more sophisticated editors like notepad++ provide this as well) before you can use all of this, you have to adjust visual studio a little.
...setting the correct editor as xul files are nothing but xml, you can use the normal xml-editor for writing xul.
... 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.
...And 4 more matches
label - Archive of obsolete content
ArchiveMozillaXULlabel
none the text will be not be cropped using an ellipsis.
...for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
...And 4 more matches
listcell - Archive of obsolete content
none the text will be not be cropped using an ellipsis.
...for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
...And 4 more matches
timepicker - Archive of obsolete content
eseconds, increment, readonly, tabindex, value properties amindicator, datevalue, disabled, hideseconds, hour, hourleadingzero, increment, is24hourclock, ispm, minute, minuteleadingzero, pmindicator, readonly, second, secondleadingzero, tabindex, value examples <timepicker value="12:05"/> attributes disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
... in the case of form elements, it will not be submitted.
...And 4 more matches
Application Update - Archive of obsolete content
ttings you will need to configure the following settings in your application: branding the update process uses branding information, setup branding for your application as described here: xulrunner tips icons the updater process for linux systems requires updater.png to be in your <application folder>/icons/, see https://bugzilla.mozilla.org/show_bug.cgi?id=706846 preferences // whether or not app updates are enabled pref("app.update.enabled", true); // this preference turns on app.update.mode and allows automatic download and // install to take place.
...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.
...And 4 more matches
Building XULRunner with Python - Archive of obsolete content
currently (mar 07) python is not enabled by default so a custom build of mozilla is needed.
... microsoft c++ compiler is required and whilst the current free version is visual studio 8 express (msvc8) you will almost certainly want to use visual studio .net 2003 (msvc71) which is not longer officially available.
...it might also be possible to use the open source mingw compiler with the correct msvc run time but that is apparently not recommended.
...And 4 more matches
CommandLine - Archive of obsolete content
handling command line arguments with xulrunner for multiple instances application it's fairly easy to retrieve application specific command line arguments in xulrunner when it's not a single instance application.
... for the sake of simplicity, the proposed solution involves the observer service to notify observers that the updated arguments are available.
... example notice the changes since gecko 2.0 (component registration has moved into the manifest file).
...And 4 more matches
Why RSS Content Module is Popular - Including HTML Contents - Archive of obsolete content
(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;".
...however, the <description> is not suppose to be used for any of this.
...And 4 more matches
Security Controls - Archive of obsolete content
second, the system should offer only the required functionality to each authorized user, so that no one can use functions that are not necessary.
...an organization may have an acceptable use policy that specifies the conduct of users, including not visiting malicious websites.
... security controls to help thwart phishing, besides the management control of the acceptable use policy itself, include operational controls, such as training users not to fall for phishing scams, and technical controls that monitor emails and web site usage for signs of phishing activity.
...And 4 more matches
Tamarin Tracing Build Documentation - Archive of obsolete content
and performance tests automated in buildbot mac os x 10.4 x86 supported, acceptance and performance tests automated in buildbot linux - ubuntu 8.0.4 x86 supported, acceptance and performance tests automated in buildbot windows mobile (pocket pc 5.0) armv4t supported, acceptance and performance tests automated in buildbot raw image (no os) armv5 supported, acceptance and performance tests not done linux (nokia n810) armv5 supported, acceptance and performance tests not done current build status the current tamarin tracing build status can be found at tamarin tracing build status getting the tamarin source the tamarin tracing source resides in mercurial at tamarin tracing.
...note that additional command-line arguments are only available in the debug configuration.
...(gnu make 3.80 does not work.
...And 4 more matches
Array comprehensions - Archive of obsolete content
do not use!
...do not use it!
... array comprehension was previously proposed to be standardized in ecmascript 2016, it provide a useful shortcut for constructing a new array based on the contents of another.
...And 4 more matches
Fixing Incorrectly Sized List Item Markers - Archive of obsolete content
in fact, the markers were set to be a uniform size that did not change to match the content of the list items, so in rare cases the marker might actually appear to be smaller.
... in addition, when a document is displayed in "quirks" mode in mozilla 0.9.4 and later, the markers of lists will not use the font size of the list item text, but will instead stay the same as the user's default font size.
... since this rule is not valid css, it will prevent the validation of any stylesheet that contains it.
...And 4 more matches
Tiles and tilemaps overview - Game development
this results in performance and memory usage gains — big image files containing entire level maps are not needed, as they are constructed by small images or image fragments multiple times.
... note: for the visual grid, a special value (usually a negative number, 0 or null) is needed to represent empty tiles.
...drawing all the tiles that can not be seen is wasteful, however, and can take a toll on performance.
...And 4 more matches
Plug-in Development Overview - Gecko Plugin API Reference
if nothing is found there, gecko checks for an np_getmimedescription entry point, and will use the information returned by this function.
... note: the resource method described below is deprecated.
...plug-ins must support 'str#' 128 but are not required to support any of these others: str#' 127 can contain a list of mime type descriptions corresponding to the types in 'str#' 128 .
...And 4 more matches
Handling different text directions - Learn web development
the writing-mode property lets us switch from one writing mode to another.
...as we have seen described above, block and inline is tied to the writing mode of the document, and not the physical screen.
...this is not something you are likely to use in a creative sense — if you simply want to line something up on the right there are other ways to do so — however it is important to understand this as part of the nature of css.
...And 4 more matches
What is the difference between webpage, website, web server, and search engine? - Learn web development
make a note of the catalog number of the book.
...each section is like a unique website (two sections do not contain same books).
...each book has its own unique location in the library (two books cannot be kept at the same place) which is specified by the catalog number.
...And 4 more matches
Using data attributes - Learn web development
html5 is designed with extensibility in mind for data that should be associated with a particular element but need not have any defined meaning.
... to get a data attribute through the dataset object, get the property by the part of the attribute name after data- (note that dashes are converted to camelcase).
... css access note that, as data attributes are plain html attributes, you can even access them from css.
...And 4 more matches
Test your skills: Links - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... note: the first link in the example has the target="_blank" attribute set on it, so that when you click on it, it opens the page in a new tab.
... this is not strictly best practice, but we've done it here so that the page doesn't open in the embedded <iframe>, getting rid of your example code in the process!
...And 4 more matches
CSS performance optimization - Learn web development
for this reason, css is render blocking, unless the browser knows the css is not currently needed.
...to optimize the cssom construction, remove unnecessary styles, minify, compress and cache it, and split css not required at page load into additional files to reduce css render blocking.
...the browser blocks rendering until it parses all of these styles but will not block rendering on styles it knows it will not use, such the print stylesheets.
...And 4 more matches
Accessibility/LiveRegionDevGuide
both events should not be acted upon or double announcements would result.
... an event containing an object that does not have state visible is probably from a hidden tab.
... an event containing an object that has state selectable is not a live region.
...And 4 more matches
Theme concepts
you do not need to port your theme.
... a theme and browser extension functionality cannot be defined in one package, such as including a theme to complement an extension.
... return; } currenttheme = theme; browser.theme.update(themes[theme]); } learn more about dynamic themes and see an additional example in the following video: if you have not built a browser extension before, check out your first extension for a step-by-step guide.
...And 4 more matches
Android-specific test suites
these tests are local — they run on your development machine and do not require an android device or android emulator.
...to disable a single test, edit the source code and insert junit's @ignore annotation before the existing @test annotation.
... disabling one failing test in general, it's not sensible to allow java code that doesn't observe the existing coding style; in this respect, this job is equivalent to the eslint jobs that check the javascript coding style throughout the tree.
...And 4 more matches
Creating a spell check dictionary add-on
it is important to choose the right locale code, or the spell checker will not be able to match the language of your dictionary against the language of a web page in order to select the right dictionary to use.
... if you are creating a new dictionary, as opposed to updating an existing one, please make sure that there is not already a dictionary available for your locale.
... if there already is one, try contacting the author to get it updated, or contact amo editors if the author does not respond.
...And 4 more matches
Simple Instantbird build
get the source note: on windows, you won't be able to build the instantbird source code if it's under a directory with spaces in the path (e.g., don't use "documents and settings").
... note: parts of the build process also have problems when the source code is in a directory where the path is long (nested many levels deep).
... on linux, this can manifest as problems setting up the virtualenv for running tests (failure to install pip or virtualenv because of os access denied errors, where access is denied not because of permission problems, but because the paths being accessed have been truncated, and so do not exist).
...And 4 more matches
mozbrowseractivitydone
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.
... note: for activities where the receiving app's activity definition in its manifest does not include returnvalue or returnvalue is false, no mozbrowseractivitydone event will be generated as of the landing of bug 1194525 in firefox os 2.5.
...And 4 more matches
mozbrowsersecuritychange
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.
... bubbles read only boolean whether the event normally bubbles or not.
...And 4 more matches
Gecko SDK
note that in order to develop such components, you do not need the full sources of e.g.
... firefox, since you do not access parts of the front end from within a component.
... do not confuse the gecko/xulrunner sdk with xulrunner itself.
...And 4 more matches
How Mozilla determines MIME Types
contrary to internet explorer's mime type guessing, mozilla will generally not sniff the type of the document.
... however, starting in mozilla 1.7alpha, mozilla does do content sniffing, like this: when the content-type sent by the server is one of (case-sensitively) text/plain text/plain; charset=iso-8859-1 text/plain; charset=iso-8859-1 and the server did not send a content-encoding header, mozilla will sniff the first block of data it gets and check for non-text bytes.
... if the server did not send a content-type header, mozilla uses the unknown decoder to find a mime type.
...And 4 more matches
How to get a stacktrace with WinDbg
debugging to begin debugging, ensure that firefox is not already running and open windbg from the start menu.
...(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.
...while firefox is running, you will not be able to type any commands into the debugger.
...And 4 more matches
How to Report a Hung Firefox
note: this article is intended for developers and technically-knowledgeable users.
... if that's not you, or you just want to fix a firefox hang without reporting it, see firefox hangs or is not responding - how to fix.
... is your firefox not responding?
...And 4 more matches
DownloadList
the returned array does not change when downloads are added or removed, though the download objects it contains are still updated in real time.
... note: when a download is added to the list, its onchange event is registered by the list, thus it cannot be used to monitor the download.
... to receive change notifications for downloads that are added to the list, use the addview() method to register for ondownloadchanged notifications.
...And 4 more matches
Interfacing with the Add-on Repository
enabling the recommendation feature in current builds of firefox 4, the recommendation api doesn't work because the preference for the url to query to get recommended add-ons is not included by default; see bug 628785.
...for example: searchfailed: function() { this.shownotification("i have no recommendations for you right now!", "oh noes!", null); }, here, we call a shownotification() method with some parameters that we'll look at shortly when we get to our shownotification() method below.
... the important thing to note is that this will handle the failure case.
...And 4 more matches
Localization sign-off reviews
the sign-off review process has been notoriously shrouded in mystery.
... focuses on technical accuracy and completion of l10n work, not translation quality.
... evaluates new release revisions, not entire l10n repos.
...And 4 more matches
Fonts for Mozilla's MathML engine
note that most of these instructions may as well apply to other web rendering engines.
... note:cambria math is installed by default on windows 7 and later versions and should ensure relatively good mathml rendering.
... note: a deprecated version of stix is preinstalled starting with os x lion and should ensure relatively good mathml rendering.
...And 4 more matches
Mozilla Style System Documentation
(mozilla has a bunch of its pseudo-elements that are not in the css specification.) we also create style contexts for some things that are not css formatting objects: text nodes and placeholder frames.
...these methods may all return an existing style context rather than a new one (see stylesetimpl::getcontext), if there is a current style context with the same parent, that matches the same rules (a check that is easy because of the ruletree), and is for the same pseudo-element (or not for a pseudo-element, or a "non-element").
...however, siblings in the style context tree are unordered, since the order is not relevant.
...And 4 more matches
TimerFirings logging
note: the power profiling overview is worth reading at this point if you haven't already.
...this is not especially useful.
... -991946880[7f46c365ba00]: [6775] fn timer (one_shot 0 ms): [content] chrome://browser/content/tabbrowser.xml:1816:0 711637568[7f3219c48000]: [6835] fn timer (one_shot 100 ms): [content] http://edition.cnn.com/:5:7231 711637568[7f3219c48000]: [6835] fn timer (one_shot 100 ms): [content] http://a.visualrevenue.com/vrs.js:6:9423 these js timers are annotated with [content] and show the javascript source location where they were created.
...And 4 more matches
About NSPR
it is not a goal to provide a platform for the porting into netscape of externally developed 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.
...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.
...And 4 more matches
PR_CWait
wait for a notification that a monitor's state has changed.
... timeout the amount of time (in printervaltime units) that the thread is willing to wait for an explicit notification before being rescheduled.
... if you specify pr_interval_no_timeout, the function returns if and only if the object is notified.
...And 4 more matches
PR_Wait
ticks the amount of time (in printervaltime units) that the thread is willing to wait for an explicit notification before being rescheduled.
... returns the function returns one of the following values: pr_success means the thread is being resumed from the pr_wait call either because it was explicitly notified or because the time specified by the parameter ticks has expired.
... pr_failure means pr_wait encountered a system error (such as an invalid monitor reference) or the thread was interrupted by another thread.
...And 4 more matches
NSS Certificate Download Specification
this document is currently being revised and has not yet been reviewed for accuracy.
... netscape certificate sequence: this is another pkcs#7 object format, and like the signeddata format, it allows multiple certificates to be imported together.
...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).
...And 4 more matches
NSS Tools pk12util
availability see the release notes for the platforms this tool is available on.
...if not specified the directory defaults to $home/.netscape (when $home exists in the environment), or to ./.netscape (when $home does not exist in the environment).
...changing the names of the certificate and key databases is not recommended.
...And 4 more matches
Multithreading in Necko
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.
...file, finger, datetime) do not worry about threading issues.
...And 4 more matches
Necko walkthrough
then in necko http code (still on the main thread for now): nshttpchannel::asyncopen nshttpchannel::beginconnect() creates nshttpconnectioninfo object for the channel checks if we're proxying or not fires off the dns prefetch request (dispatched to dns thread pool) some other things nshttpchannel::connect might to a speculativeconnect (pre open tcp socket) nshttpchannel::continueconnect some cache stuff nshttpchannel::setuptransaction creates new nshttptransaction, and inits it with mrequesthead (the request headers) and muploadstream (which was crea...
... nshttpconnectionmgr::onmsgnewtransaction nshttpconnectionmgr::processnewtransaction (notice the check that we're on gsocketthread) gets conn info (i.e.
... note: nsconnectionentry has a single nshttpconnectioninfo object attached, a pending queue of nshttptransactions, and 3 arrays for connections: active nshttpconnections idle nshttpconnections nshalfopensockets nshttpconnectionmgr::trydispatchtransaction there is a series of decisions about whether dispatchtransaction is called, along with good code comments: best to read the c...
...And 4 more matches
JS_ConvertArguments
obsolete since jsapi 30 this must be an argv pointer created by the js engine and passed to a jsnative or jsfastnative callback, not an array created by application code.
... variables for optional parameters must already be initialized, because if an optional parameter is not in argv, js_convertarguments does not modify the corresponding variable.
... the variables do not need to be rooted.
...And 4 more matches
JS_MakeStringImmutable
s must not be null.
... description a string's characters can never be changed, but spidermonkey uses two string optimization techniques behind the scenes: a growable string (see js_newgrowablestring ) has a buffer that the javascript engine can reallocate so that concatenating it with another string is much faster.
... a dependent string (see js_newdependentstring) is a substring of another (growable, dependent, or immutable) string.
...And 4 more matches
JS_PropertyStub
bool *succeeded); // obsolete since jsapi 37 bool js_enumeratestub(jscontext *cx, js::handleobject obj); // obsolete since jsapi 37 bool js_convertstub(jscontext *cx, js::handleobject obj, jstype type, js::mutablehandlevalue vp); // obsolete since jsapi 37 void js_finalizestub(jscontext *cx, jsobject *obj); // obsolete since jsapi 14 description the stub functions are not designed to be called directly by a jsapi application.
...it behaves exactly like a property callback that accepts the default property behavior: it does nothing and returns true.
...it behaves exactly like a property callback that accepts the default property behavior: it does nothing and returns true.
...And 4 more matches
SpiderMonkey 1.8.8
these release notes are an incomplete draft and were initially seeded from the 1.8.5 release notes, so lots of the information here isn't actually new to spidermonkey 1.8.8 (nor is it even the case that the version number will be 1.8.8!).
...on some other platforms (sparc, mips), the jit is provided but not supported.
...it's the same language, just not as fast.
...And 4 more matches
SpiderMonkey 17
these release notes are an incomplete draft and were initially seeded from the (now-defunct) 1.8.8 release notes, which were themselves seeded from the 1.8.5 release notes, so lots of the information here isn't actually new to spidermonkey 17.
...on some other platforms (sparc, mips), the jit is provided but not supported.
...it's the same language, just not as fast.
...And 4 more matches
SpiderMonkey 45
these release notes are incomplete.
... if you are compiling with microsoft's visual studio, note the minimum supported version is msvc 2013.
...on several other platforms (sparc, mips), the jit is provided but not supported.
...And 4 more matches
Setting up an update server
you want to use the mar labelled complete, not a partial mar.
...part of the problem is that mars are signed by mozilla and so you cannot really build an "official" mar yourself.
...these changes will need to be made in order to use the locally built mar: put this line in the mozconfig file in root of the build directory (create it if it does not exist): ac_add_options --disable-verify-mar several files contain a line that must be uncommented.
...And 4 more matches
XForms Accessibility
downloading builds notion: xforms is no longer distributed with firefox build.
...note, xforms accessibility is implemented only on trunk.
... trunk builds are not considered stable and should not be installed on top of the firefox used for daily browsing.
...And 4 more matches
Using the Places favicon service
this expiration time is not the time that the favicon will be deleted.
... getting favicon images you can use favicons in the browser ui using special annotation uris.
... nsifaviconservice.getfaviconimageforpage() returns an annotation uri for the favicon for a given page, and nsifaviconservice.getfaviconlinkforicon() returns an annotation uri for the given favicon.
...And 4 more matches
Setting up the Gecko SDK
there is now separate archive with gecko-sdk, just xul-runner-sdk.): linux: http://ftp.mozilla.org/pub/mozi....8.0.4.tar.bz2 windows: http://ftp.mozilla.org/pub/mozi...vc-1.8.0.4.zip mac: http://ftp.mozilla.org/pub/mozi...ac-1.8.0.4.zip note that the version number for the archives above is 1.8.
...note that mozilla-config.h may be need to be included before other includes in your component's source code.
... building a windows project this section is writting for those of you who do not wish to install visual studio or the express edition, allowing the user to be able to create commercial extensions without buying the full version of visual studio and allowing them to use their own editors.
...And 4 more matches
Components.classes
note that components.classes reflects only those component classes that have been previously installed and registered with the component manager using contractids.
... note also that it is possible that a given add-on component with a given contractid will be present on one machine but not have been installed on another machine.
... if the given element in the components.classes object is not registered on the machine then trying to access it will generate a javascript warning in strict mode and the value returned will be the javascript value undefined.
...And 4 more matches
Components.utils.exportFunction
the exported function does not have to be added to the less privileged code's global window object: it can be exported to any object in the target scope.
...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.
... allowcrossoriginarguments: do not check that arguments to the exported function are subsumed by the caller: this allows the caller to pass objects with a different origin into the exported function, which can then use its privileged status to make cross-origin requests with them.
...And 4 more matches
IAccessibleHyperlink
other-licenses/ia2/accessiblehyperlink.idlnot scriptable this interface represents hyperlinks.
...as a result it may be removed in a later version of the idl and it is suggested that implementations should not rely on the inheritance.
...s_false if there is nothing to return, [out] value is null.
...And 4 more matches
mozIAsyncHistory
rfaces.moziasynchistory); method overview void getplacesinfo(in jsval aplaceidentifiers, in mozivisitinfocallback acallback); void isurivisited(in nsiuri auri, in mozivisitedstatuscallback acallback); void updateplaces(in moziplaceinfo, [optional] in mozivisitinfocallback acallback); methods getplacesinfo() starts an asynchronous request to determine whether or not a given uri has been visited; you must implement a callback to receive the result of the request.
... isurivisited() starts an asynchronous request to determine whether or not a given uri has been visited; you must implement a callback to receive the result of the request.
... note that this lets you add to history even in private browsing mode; if that's not desired you can first check whether the window is in private browsing mode.
...And 4 more matches
nsIAppStartup
erestartnotsameprofile 0x100 restart the application after quitting.
... note: size_to_content may be used for width or height.
...this will have no effect if the hidden window has not yet been created.
...And 4 more matches
nsIAuthPrompt2
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) this interface is usually acquired using getinterface on notification callbacks or similar.
...a single prompt will be shown; then the callbacks for all the coalesced prompts will be notified with the resulting authentication information.
... serialize prompts that are all in the same "context" (this might mean application-wide, for a given window, or something else depending on the user interface) so that the user is not deluged with prompts.
...And 4 more matches
nsICache
it does not represent an actual object.
... not_stream_based 0 all entries for a cache session are stored as streams of data or as objects.
... this constant specify that cache session is not a stream based entry when calling nsicacheservice.createsession() method.
...And 4 more matches
nsICacheService
note: starting in gecko 2.0, cache i/o is handled asynchronously.
...); obsolete since gecko 1.9.2 void evictentries(in nscachestoragepolicy storagepolicy); void init(); obsolete since gecko 1.8 void shutdown(); obsolete since gecko 1.8 void visitentries(in nsicachevisitor visitor); attributes attribute type description cacheiotarget nsieventtarget the event target for cache i/o operation notifications.
...the cache session is not "owned" by the cache service.
...And 4 more matches
nsICategoryManager
the category and/or entry are created if they do not exist.
... areplace a flag indicating whether or not to overwrite the value of an existing category entry.
... note: if the category does not exist, then this method does nothing.
...And 4 more matches
nsICommandLine
this may be the original command line of this instance or a command line provided remotely by another instance of the application.
...the application name is not part of the command line.
...do not include the initial hyphen.
...And 4 more matches
nsICookieService
var cookiesvc = components.classes["@mozilla.org/cookieservice;1"] .getservice(components.interfaces.nsicookieservice); notifications this service broadcasts the following notifications when the cookie list is changed, or a cookie is rejected: topic subject data cookie-changed broadcast whenever the cookie list changes in some way.
... there are four possible data strings for this notification; one notification will be broadcast for each change.
... note: this function is redundant and will most likely be removed in a future revision of this interface.
...And 4 more matches
nsICryptoHMAC
note: this method may be called any time after init() is called.
...exceptions thrown ns_error_not_initialized if init() has not been called.
... warning: this approach is not fips compliant.
...And 4 more matches
nsIDOMChromeWindow
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void beginwindowmove(in nsidomevent mousedownevent); void getattention(); void getattentionwithcyclecount(in long acyclecount); void maximize(); void minimize(); void notifydefaultbuttonloaded(in nsidomelement defaultbutton); void restore(); void setcursor(in domstring cursor); attributes attribute type description browserdomwindow nsibrowserdomwindow the related nsibrowserdomwindow instance which provides access to yet another layer of utility functions by chrome script.
... it will be null for domwindows not corresponding to browsers.
...void beginwindowmove( in nsidomevent mousedownevent ); parameters mousedownevent exceptions thrown ns_error_not_implemented if the operating system does not support this method.
...And 4 more matches
nsIDOMFontFace
note: the same physical font may have been found in multiple ways within a range.
... attribute type description fromfontgroup boolean indicates whether or not the font was located in a font group.
... fromlanguageprefs boolean indicates whether or not the font was located using language preferences.
...And 4 more matches
nsIDOMOfflineResourceList
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.
... idle 1 the application cache is not in the process of being updated.
... mozhasitem returns a boolean value indicating whether or not the specified uri represents a resource that's in the application cache's list.
...And 4 more matches
nsIDOMWindowInternal
note: because most of nsidomwindowinternal's functions and attributes are well documented in window, those articles are linked to rather than re-documented.
... however, they are not guaranteed to document all available arguments (i.e.
... method overview firefox 3.5 note the prompt() and find() methods changed in firefox 3.5 to make all their parameters optional; in previous versions, all parameters were required.
...And 4 more matches
nsIEditorIMESupport
obsolete since gecko 1.9.1 void notifyimeonblur(); obsolete since gecko 1.9.1 void notifyimeonfocus(); obsolete since gecko 1.9.1 void querycomposition(in nstexteventreplyptr areply); native code only!
...void getreconversionstring( in nsreconversioneventreplyptr areply ); parameters areply notifyimeonblur() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0)this feature is obsolete.
...notify for ime when the editor lost focus.
...And 4 more matches
nsIFileProtocolHandler
should only be called on files which are not directories.
... warning: this restriction may not be enforced at runtime!
...warning: this restriction may not be enforced at runtime!
...And 4 more matches
nsIGlobalHistory3
method overview void adddocumentredirect(in nsichannel aoldchannel, in nsichannel anewchannel, in print32 aflags, in boolean atoplevel); unsigned long geturigeckoflags(in nsiuri auri); void seturigeckoflags(in nsiuri auri, in unsigned long aflags); methods adddocumentredirect() notifies the history system that the page loading via aoldchannel redirected to anewchannel.
... implementations should generally add the uri for aoldchannel to history for link coloring, but are advised not to expose it in the history user interface.
...this notification must be sent for history consumers for all non-redirect pages.
...And 4 more matches
nsIMsgDBView
note: this return value does not appear to be implemented in the base implementation.
...note: this is not implemented in the base implementation.
...this is not used for all commands and will return the notused value most of the time.
...And 4 more matches
nsIPrefBranch2
aobserver the object to be notified if the preference changes.
... 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.
...this insures that shorter lived objects (say one tied to an open window) will not fall into the cyclical reference trap.
...And 4 more matches
nsIServiceManager
exceptions thrown ns_error_factory_not_registered indicates that the specified class is not registered.
... exceptions thrown ns_error_factory_not_registered indicates that the specified class is not registered.
... isserviceinstantiated() this method tests whether or not a xpcom service, identified by classid, has been instantiated.
...And 4 more matches
nsITextInputProcessorCallback
dom/interfaces/base/nsitextinputprocessor.idlscriptable a callback interface for nsitextinputprocessor user 1.0 66 introduced gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) nsitextinputprocessorcallback is defined for receiving requests and notifications to ime from gecko.
... example of simple js-ime: var simpleime = { _hasfocus: false, _hasrightstocompose: false, _tip: null, _callback: function simpleime_callback(atip, anotification) { try { switch (anotification.type) { case "request-to-commit": atip.commitcomposition(); break; case "request-to-cancel": atip.cancelcomposition(); break; case "notify-focus": this._hasfocus = true; break; case "notify-blur": this._hasfocus = false; break; case "notify-detached": this._hasfocus = false; this._hasrightstocompose = false; break; } return true;...
... }, } method overview boolean onnotify(in nsitextinputprocessor atextinputprocessor, in nsitextinputprocessornotification anotification); methods onnotify() this is called when gecko requests or notifies something to ime.
...And 4 more matches
nsIURL
filepath you can get a nsiurl from an nsiuri, using the queryinterface() method: var myuri = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice) .newuri("http://developer.mozilla.org", null, null); try { var myurl = myuri.queryinterface(components.interfaces.nsiurl); } catch(e) { // the uri is not an url } or using instanceof: if (myuri instanceof components.interfaces.nsiurl) { // your code here } method overview autf8string getcommonbasespec(in nsiuri auritocompare); autf8string getrelativespec(in nsiuri auritocompare); attributes attribute type description directory autf8string directory portion of a url.
... if the url denotes a path to a directory and not a file, for example http://host/foo/bar/, then the directory attribute accesses the complete /foo/bar/ portion, and the filename is the empty string.
... if the trailing slash is omitted, then the directory is /foo/ and the file is bar (that is this is a syntactic, not a semantic breakdown of the path).
...And 4 more matches
nsIUTF8ConverterService
if not, convert to utf-8 assuming it's encoded in acharset and return the converted string in utf-8.
... acharset the charset to convert from if astring is not in utf-8.
... askipcheck determines whether or not to skip 'asciiness' and 'utf8ness' check.
...And 4 more matches
nsIUserInfo
not supported.
... not supported.
... not supported.
...And 4 more matches
nsIWebNavigationInfo
note: this is guaranteed not to change, so that boolean tests can be done on the return value if istypesupported to detect whether a type is supported at all.
...this is not the value returned for "xpcom plug-ins".
... other 1 << 15 note: other return types may be added here in the future as they become relevant.
...And 4 more matches
nsIXPCScriptable
note: this is not really an xpcom interface.
... js/src/xpconnect/idl/nsixpcscriptable.idlnot scriptable please add a summary to this article.
...if idp is non-null and the number of enumerable properties cannot be computed in advance, idp should be set to jsval_zero.
...And 4 more matches
nsIXULTemplateBuilder
a query processor is not required to provide any support for updating results after they have been generated.
...may be null if the datasource has not been loaded yet.
...note: this is a temporary hack so that remote-xul authors can reload remote datasources.
...And 4 more matches
Frequently Asked Questions
it's not in your code, or it's not on your platform, but there's an nscomptr on the line where the error is and you're suspicious.
... 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.
...And 4 more matches
Mozilla technologies
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 2 and thunderbird 2 introduce a series of interfaces that make it easy for extension authors to access rss and atom feeds.life after xul: building firefox interfaces with htmlthis page gathers technical solutions to common problems encountered by tea...
...ms 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.
...it also includes new features including favicon storage and the ability to annotate pages with arbitrary information.
...And 4 more matches
Building a Thunderbird extension 3: install manifest
while this value is in email address format, it is not an email address.
... it should, however, be a unique value so that it does not conflict with other extensions.
...it is not the thunderbird version number (which is stored in the minversion and maxversion fields).
...And 4 more matches
StructType
note: at this time, there isn't a way to denote a packed structure (that is, one created in c using #pragma pack).
... exceptions thrown typeerror the name is not a string, or one or more of the fields does not have a defined size.
... rangeerror the size of the structure, in bytes, cannot be represented both as a size_t and as a javascript number.
...And 4 more matches
Plug-in Development Overview - Plugins
if nothing is found there, gecko checks for an np_getmimedescription entry point, and will use the information returned by this function.
... note: the resource method described below is deprecated.
...plug-ins must support 'str#' 128 but are not required to support any of these others: str#' 127 can contain a list of mime type descriptions corresponding to the types in 'str#' 128 .
...And 4 more matches
Debugger.Memory - Firefox Developer Tools
assignment is fallible: if the debugger cannot track allocation sites, it throws an error instance.
... note that in the presence of multiple debugger instances observing the same allocations within a global’s scope, the maximum allocationsamplingprobability of all the debuggers is used.
... unlike debugger‘s hooks, debugger.memory’s handlers’ return values are not significant, and are ignored.
...And 4 more matches
Network request details - Firefox Developer Tools
earlier versions appeared similarly, but might not include some functionality.
...a script called by another script).
...(see referrer-policy for a description of possible values) blocking: if the request is to a site that is associated with a known tracker, an icon and a message are shown; otherwise, this field is not shown.
...And 4 more matches
Examine and edit HTML - Firefox Developer Tools
for example, //a matches all <a> elements but not the letter "a" within the text content.
... nodes that are not visible are shown faded/desaturated.
... note: there are some useful keyboard shortcuts that can be used in the html tree — see the html pane keyboard shortcuts list.
...And 4 more matches
The JavaScript input interpreter - Firefox Developer Tools
if your input does not appear to be complete when you press enter, then the console treats this as shift+enter , enabling you to finish your input.
... for example, if you type: function foo() { and then enter, the console does not immediately execute the input, but behaves as if you had pressed shift+enter , so you can finish entering the function definition.
...note that the result might be an error message.
...And 4 more matches
AbstractRange - Web APIs
as an abstract interface, you will not directly instantiate an object of type abstractrange.
... usage notes range types all ranges of content within a document are described using instances of interfaces based on abstractrange.
... staticrange a staticrange is a basic range which cannot be changed once it's been created.
...And 4 more matches
Attr - Web APIs
WebAPIAttr
note: dom level 4 removed this property.
... gecko outputs a deprecation note starting from gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4).
... this note was removed again in gecko 49.0 (firefox 49.0 / thunderbird 49.0 / seamonkey 2.46).
...And 4 more matches
AudioNode - Web APIs
WebAPIAudioNode
<a xlink:href="/docs/web/api/audionode" target="_top"><rect x="151" y="1" width="90" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="196" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">audionode</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} note: an audionode can be target of events, therefore it implements the eventtarget interface.
...the exact processing done varies from one audionode to another but, in general, a node reads its inputs, does some audio-related processing, and generates new values for its outputs, or simply lets the audio pass through (for example in the analysernode, where the result of the processing is accessed separately).
...while the actual processing is done internally by the browser and cannot be altered, you could write a wrapper around an audio node to provide custom properties and methods.
...And 4 more matches
CanvasRenderingContext2D - Web APIs
if the shape has already been closed or has only one point, this function does nothing.
... canvasrenderingcontext2d.ispointinpath() reports whether or not the specified point is contained in the current path.
... canvasrenderingcontext2d.ispointinstroke() reports whether or not the specified point is inside the area contained by the stroking of a path.
...And 4 more matches
Basic usage of canvas - Web APIs
note: if your renderings seem distorted, try specifying your width and height attributes explicitly in the <canvas> attributes, and not using css.
... 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.
...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" height="150"> <img src="images/clock.png" width="150" height="150" alt=""/> </canvas> telling the user to use a different browser that supports canvas does not help users who can't read the canvas at all, for example.
...And 4 more matches
Pixel manipulation with canvas - Web APIs
you can also create a new imagedata object with the same dimensions as the object specified by anotherimagedata.
...this does not copy the image data!
... var myimagedata = ctx.createimagedata(anotherimagedata); getting the pixel data for a context to obtain an imagedata object containing a copy of the pixel data for a canvas context, you can use the getimagedata() method: var myimagedata = ctx.getimagedata(left, top, width, height); this method returns an imagedata object representing the pixel data for the area of the canvas whose corners are represented by the points (left,top), (left+width, top), (left, top+height), and (left+width, top+height).
...And 4 more matches
Document.getElementById() - Web APIs
example html <html> <head> <title>getelementbyid example</title> </head> <body> <p id="para">some text here</p> <button onclick="changecolor('blue');">blue</button> <button onclick="changecolor('red');">red</button> </body> </html> javascript function changecolor(newcolor) { var elem = document.getelementbyid('para'); elem.style.color = newcolor; } result usage notes the capitalization of "id" in the name of this method must be correct for the code to function; getelementbyid() is not valid and will not work, however natural it may seem.
... unlike some other element-lookup methods such as document.queryselector() and document.queryselectorall(), getelementbyid() is only available as a method of the global document object, and not available as a method on all element objects in the dom.
...le>document</title> </head> <body> <div id="parent-id"> <p>hello word1</p> <p id="test1">hello word2</p> <p>hello word3</p> <p>hello word4</p> </div> <script> var parentdom = document.getelementbyid('parent-id'); var test1 = parentdom.getelementbyid('test1'); //throw error //uncaught typeerror: parentdom.getelementbyid is not a function </script> </body> </html> if there is no element with the given id, this function returns null.
...And 4 more matches
Document.importNode() - Web APIs
the document object's importnode() method creates a copy of a node or documentfragment from another document, to be inserted into the current document later.
... the imported node is not yet included in the document tree.
... unlike document.adoptnode(), the original node is not removed from its original document.
...And 4 more matches
Document.write() - Web APIs
WebAPIDocumentwrite
note: because document.write() writes to the document stream, calling document.write() on a closed (loaded) document automatically calls document.open(), which will clear the document.
... example <html> <head> <title>write example</title> <script> function newcontent() { document.open(); document.write("<h1>out with the old, in with the new!</h1>"); document.close(); } </script> </head> <body onload="newcontent();"> <p>some original document content.</p> </body> </html> notes the text you write is parsed into the document's structure model.
... if the document.write() call is embedded within an inline html <script> tag, then it will not call document.open().
...And 4 more matches
Element.classList - Web APIs
WebAPIElementclassList
if the class attribute is not set or empty, it returns an empty domtokenlist, i.e.
... examples const div = document.createelement('div'); div.classname = 'foo'; // our starting state: <div class="foo"></div> console.log(div.outerhtml); // use the classlist api to remove and add classes div.classlist.remove("foo"); div.classlist.add("anotherclass"); // <div class="anotherclass"></div> console.log(div.outerhtml); // if visible is set remove it, otherwise add it div.classlist.toggle("visible"); // add/remove visible, depending on test conditional, i less than 10 div.classlist.toggle("visible", i < 10 ); console.log(div.classlist.contains("foo")); // add or remove multiple classes div.classlist.add("foo", "bar", "baz"); div.clas...
...slist.remove("foo", "bar", "baz"); // add or remove multiple classes using spread syntax const cls = ["foo", "bar"]; div.classlist.add(...cls); div.classlist.remove(...cls); // replace class "foo" with class "bar" div.classlist.replace("foo", "bar"); versions of firefox before 26 do not implement the use of several arguments in the add/remove/toggle methods.
...And 4 more matches
Element.getAttributeNS() - Web APIs
if the named attribute does not exist, the value returned will either be null or "" (the empty string); see notes for details.
... note: earlier versions of the dom specification had this method described as returning an empty string for non-existent attributes, but it was not typically implemented this way since null makes more sense.
...-width="2" fill="none" test:foo="hello namespaced attribute!"/> <script type="text/javascript"> var ns = 'http://www.example.com/2014/test'; var circle = document.getelementbyid( 'target' ); console.log( 'attribute test:foo: "' + circle.getattributens( ns, 'foo' ) + '"' ); </script> </svg> in an html5 document the attribute has to be accessed with test:foo since namespaces are not supported.
...And 4 more matches
Element.getBoundingClientRect() - Web APIs
this means that the rectangle's boundary edges (top, right, bottom, left) change their values every time the scrolling position changes (because their values are relative to the viewport and not absolute).
...</div> div { width: 400px; height: 200px; padding: 20px; margin: 50px auto; background: purple; } let elem = document.queryselector('div'); let rect = elem.getboundingclientrect(); for (var key in rect) { if(typeof rect[key] !== 'function') { let para = document.createelement('p'); para.textcontent = `${ key } : ${ rect[key] }`; document.body.appendchild(para); } } notice how the width/height are equal to the equal to its width/height + padding.
... also note how the values of x/left, y/top, right, and bottom are equal to the absolute distance from the relevant edge of the viewport to that side of the element, in each case.
...And 4 more matches
Element - Web APIs
WebAPIElement
note: in firefox 3.5 and earlier, html elements are in no namespace.
... element.undoscope is a boolean indicating if the element is an undo scope host, or not.
... note: dom level 3 defined namespaceuri, localname and prefix on the node interface.
...And 4 more matches
Event.initEvent() - Web APIs
WebAPIEventinitEvent
do not use this method anymore as it is deprecated.
... bubbles is a boolean deciding whether the event should bubble up through the event chain or not.
...var event = document.createevent('event'); // create a click event that bubbles up and // cannot be canceled event.initevent('click', true, false); // listen for the event.
...And 4 more matches
GlobalEventHandlers.onerror - Web APIs
error events are fired at various targets for different kinds of errors: when a javascript runtime error (including syntax errors and exceptions thrown within handlers) occurs, an error event using interface errorevent is fired at window and window.onerror() is invoked (as well as handlers attached by window.addeventlistener (not only capturing)).
...these error events do not bubble up to window, but (at least in firefox) can be handled with a window.addeventlistener configured with usecapture set to true.
... a good example for this is when you are using an image tag, and need to specify a backup image in case the one you need is not available on the server for any reason.
...And 4 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.
... syntax htmlimageelement.alt = alttext; let alttext = htmlimageelement.alt; value a domstring which contains the alternate text to display when the image is not loaded or for use by assistive devices.
... usage notes the fundamental guideline for the alt attribute is that every image's alternate text should be able to replace the image without altering the meaning of the page.
...And 4 more matches
IDBCursor.update() - Web APIs
WebAPIIDBCursorupdate
note: this feature is available in web workers.
... dataerror the underlying object store uses in-line keys and the property in the value at the object store's key path does not match the key in this cursor's position.
... datacloneerror the data being stored could not be cloned by the internal structured cloning algorithm.
...And 4 more matches
IDBDatabase.createObjectStore() - Web APIs
note: this feature is available in web workers.
...note that it is possible to create an object store with an empty name.
...if empty or not specified, the object store is created without a key path and uses out-of-line keys.
...And 4 more matches
databases - Web APIs
note: this feature is available in web workers.
... note: this method is introduced in a draft of a specifications and browser compatibility is limited.
... syntax const promise = indexeddb.databases() parameters the method does not take in any parameters.
...And 4 more matches
IDBTransaction.error - Web APIs
note: this feature is available in web workers.
... this property is null if the transaction is not finished, is finished and successfully committed, or was aborted with the idbtransaction.abort method.
...note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure.
...And 4 more matches
IDBTransaction.mode - Web APIs
note: this feature is available in web workers.
... syntax var mycurrentmode = idbtransaction.mode; value an idbtransactionmode object defining the mode for isolating access to data in the current object stores: value explanation readonly allows data to be read but not changed.
...transactions of this mode cannot run concurrently with other transactions.
...And 4 more matches
IDBTransaction.onerror - Web APIs
note: consider using idbtransaction.onabort instead to handle non- successful completion of the transaction.
... note: this feature is available in web workers.
...note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure.
...And 4 more matches
ImageCapture.takePhoto() - Web APIs
for simplicy it does not show how to instantiate the imagecapture object.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettakephoto experimentalchrome full support 60 full support 60 no support 59 — 60notes notes photosettings argument not supported.edge full support ≤79firefox ?
... opera full support 47 full support 47 no support 46 — 47notes notes photosettings argument not supported.safari ?
...And 4 more matches
KeyboardEvent.location - Web APIs
possible values are: constant value description dom_key_location_standard 0 the key has only one version, or can't be distinguished between the left and right versions of the key, and was not pressed on the numeric keypad or a key that is considered to be part of the keypad.
... note: when numlock is locked, gecko always returns dom_key_location_numpad for the keys on the numeric pad.
...on the other hand, if the keyboard doesn't have a keypad, such as on a notebook computer, some keys become numpad only when numlock is locked.
...And 4 more matches
Using the MediaStream Recording API - Web APIs
if you are not interested in css and want to get straight to the javascript, skip to the basic app setup section.
...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.
...first of all, we style the <label> how we want it, making sure that it has enough z-index to always sit above the other elements and therefore be focusable/clickable: label { font-family: 'notocoloremoji'; font-size: 3rem; position: absolute; top: 2px; right: 3px; z-index: 5; cursor: pointer; } then we hide the actual checkbox, because we don't want it cluttering up our ui: input[type=checkbox] { position: absolute; top: -100px; } next, we style the information screen (wrapped in an <aside> element) how we want it, give it fixed position so that it does...
...And 4 more matches
MouseEvent.initMouseEvent() - Web APIs
do not use this method anymore as it is deprecated.
... canbubble whether or not the event can bubble.
... cancelable whether or not the event's default action can be prevented.
...And 4 more matches
Navigator.msLaunchUri() - 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.
... nohandlercallbackoptional a function matching mslaunchuricallback to be executed if the protocol handler is not present.
...And 4 more matches
Node.cloneNode() - Web APIs
WebAPINodecloneNode
the newclone has no parent and is not part of the document, until it is added to another node that is part of the document (using node.appendchild() or a similar method).
...any text that node contains is not cloned, either (since text is contained by one or more child text nodes).
... *note: in the dom4 specification (since gecko 13.0 (firefox 13 / thunderbird 13 / seamonkey 2.10)), the optional deep argument defaults to true.
...And 4 more matches
OffscreenCanvas.getContext() - Web APIs
the offscreencanvas.getcontext() method returns a drawing context for an offscreen canvas, or null if the context identifier is not supported.
... note: this api is currently implemented for webgl1 and webgl2 contexts only.
... note: the identifiers "experimental-webgl" or "experimental-webgl2" are also used in implementations of webgl.
...And 4 more matches
PerformanceTiming - Web APIs
if there is no previous document, or if the previous document or one of the needed redirects is not of the same origin, the value returned is 0.
...if there is no previous document, or if the previous document, or one of the needed redirects, is not of the same origin, the value returned is 0.
...if there is no redirect, or if one of the redirects is not of the same origin, the value returned is 0.
...And 4 more matches
RTCPeerConnection.addTrack() - Web APIs
note: adding a track to a connection triggers renegotiation by firing a negotiationneeded event.
... note: every rtcrtpsender is paired with an rtcrtpreceiver to make up an rtcrtptransceiver.
... the associated receiver is muted (indicating that it is not able to deliver packets) until and unless one or more streams are added to the receiver by the remote peer.
...And 4 more matches
RTCPeerConnection.setRemoteDescription() - Web APIs
this is typically called after receiving an offer or answer from another peer over the signaling server.
... because descriptions will be exchanged until the two peers agree on a configuration, the description submitted by calling setremotedescription() does not immediately take effect.
... return value a promise which is fulfilled once the value of the connection's remotedescription is successfully changed or rejected if the change cannot be applied (for example, if the specified description is incompatible with one or both of the peers on the connection).
...And 4 more matches
SVGPointList - Web APIs
the inserted item is the item itself and not a copy.
...the returned item is the item itself and not a copy.
...the inserted item is the item itself and not a copy.
...And 4 more matches
SVGStringList - Web APIs
the inserted item is the item itself and not a copy.
...the returned item is the item itself and not a copy.
...the inserted item is the item itself and not a copy.
...And 4 more matches
Selection - Web APIs
WebAPISelection
anchor and focus should not be confused with the start and end positions of a selection.
... notes string representation of a selection calling the selection.tostring() method returns the text contained within the selection, e.g.: var selobj = window.getselection(); window.alert(selobj); note that using a selection object as the argument to window.alert will call the object's tostring method.
...typically, it holds only one range, accessed as follows: var selobj = window.getselection(); var range = selobj.getrangeat(0); selobj is a selection object range is a range object as the selection api specification notes, the selection api was initially created by netscape and allowed multiple ranges (for instance, to allow the user to select a column from a <table>).
...And 4 more matches
ServiceWorkerRegistration - Web APIs
note: this feature is available in web workers.
...this was mentioned as an idea in the sw explainer at some point, but as yet has not been implemented anywhere.
... serviceworkerregistration.getnotifications() returns a promise that resolves to an array of notification objects.
...And 4 more matches
Storage API - Web APIs
the storage api gives sites' code the ability to find out how much space they can use, how much they are already using, and even control whether or not they need to be alerted before the user agent disposes of site data in order to make room for other things.
... note: this feature is available in web workers.
... site storage—the data stored for a web site which is managed by the storage standard—includes: indexeddb databases cache api data service worker registrations web storage api data managed using window.localstorage history state information saved using history.pushstate() application caches notification data other kinds of site-accessible, site-specific data that may be maintained site storage units the site storage system described by the storage standard and interacted with using the storage api consists of a single site storage unit for each origin.
...And 4 more matches
Storage Access API - Web APIs
the semantics around third-party cookie blocking policies in particular differ from browser to browser, but the core functionality is similar: cross-origin resources embedded in a third-party context are not given access to the same cookies and site storage that they would have access to when loaded in a first-party context.
...as an example, federated logins often require access to authentication cookies stored in first-party storage, and will require the user to sign in on each site separately (or completely break) if those cookies are not available.
... in addition, sandboxed <iframe>s cannot be granted storage access by default for security reasons.
...And 4 more matches
TouchEvent - Web APIs
touchevent.altkey read only a boolean value indicating whether or not the alt key was down when the touch event was fired.
... touchevent.ctrlkey read only a boolean value indicating whether or not the control key was down when the touch event was fired.
... touchevent.metakey read only a boolean value indicating whether or not the meta key was down when the touch event was fired.
...And 4 more matches
WebGLRenderingContext - Web APIs
might be null if it is not associated with a <canvas> element.
... webglrenderingcontext.commit() pushes frames back to the original htmlcanvaselement, if the context is not directly fixed to a specific canvas.
... webglrenderingcontext.cullface() specifies whether or not front- and/or back-facing polygons can be culled.
...And 4 more matches
Clearing with colors - Web APIs
note that css sets the background color of the canvas to black, so when the canvas turns green we know that webgl's magic has worked.
... in addition, you may notice that clearing the drawing buffer with a solid color is a two-stage process.
...this only changes some internal state of webgl, but does not draw anything yet.
...And 4 more matches
The structured clone algorithm - Web APIs
things that don't work with structured clone function objects cannot be duplicated by the structured clone algorithm; attempting to throws a data_clone_err exception.
... certain object properties are not preserved: the lastindex property of regexp objects is not preserved.
... property descriptors, setters, getters, and similar metadata-like features are not duplicated.
...And 4 more matches
Window.getComputedStyle() - Web APIs
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.
...And 4 more matches
Window.openDialog() - Web APIs
WebAPIWindowopenDialog
note that this also means the user won't be able to interact with the opener window until he closes the modal dialog.
... example var win = opendialog("http://example.tld/zzz.xul", "dlg", "", "pizza", 6.98); notes new features all - initially activates (or deactivates ("all=no")) all chrome (except the behavior flags chrome, dialog and modal).
...if the features parameter is a zero-length string, or contains only one or more of the behavior features (chrome, dependent, dialog and modal) the chrome features are assumed "os' choice." that is, window creation code is not given specific instructions, but is instead allowed to select the chrome that best fits a dialog on that operating system.
...And 4 more matches
window.requestIdleCallback() - Web APIs
you can call requestidlecallback() within an idle callback function to schedule another callback to take place no sooner than the next pass through the event loop.
...the callback function is passed an idledeadline object describing the amount of time available and whether or not the callback has been run because the timeout period expired.
...currently only one property is defined: timeout: if timeout is specified and has a positive value, and the callback has not already been called by the time timeout milliseconds have passed, the callback will be called during the next idle period, even if doing so risks causing a negative performance impact.
...And 4 more matches
XPathResult - Web APIs
xpathresult.snapshotitem() returns an item of the snapshot collection or null in case the index is not within the range of nodes.
... unlike the iterator result, the snapshot does not become invalid, but may not correspond to the current document if it is mutated.
...note that if the result is a node-set then unordered_node_iterator_type is always the resulting type.
...And 4 more matches
XRWebGLLayer.framebuffer - Web APIs
usage notes how opaque framebuffers are special the framebuffer represented by the framebuffer property is opaque.
... opaque framebuffers are considered incomplete and are not available for rendering other than while executing the requestanimationframe() callback.
... 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.
...And 4 more matches
ARIA: feed role - Accessibility
if the addition of articles occupies the main browser thread, make sure to set aria-busy="true" on the feed itself, and make sure to set it back to false when processing ends, or the user may not see the updates.
...however, if the total number is extremely large, indefinite, or changes often, set aria-setsize="-1" to indicate that the size of the feed is not known.
... another feature of the feed pattern is skim reading: articles within a feed can contain both an accessible name with the aria-label and a description with an aria-describedby, suggesting to screen readers which elements to speak after the label when navigating by article.
...And 4 more matches
Accessibility Information for Web Authors - Accessibility
web content accessibility guidelines (wcag) 1.0 another important set of guidelines from the w3c web accessibility initiative (wai).
...the output data report is displayed in a clear and well structured table where each and all checkpoints are identified and described (along with an helpful clickable link to the related reference guideline) into logical groups and according to measurable results: passed, warning, failed for automated verification, warning for manual verification, not selected, not available, not related, etc.
... wave 4.0 beta (web accessibility versatile evaluator) from webaim and sponsored by temple university institute on disabilities wave 4.0 beta is another powerful, free online webpage accessibility validation service that identifies accessibility errors and reports accessibility warnings about webpage related to section 508 standards and/or the wcag guidelines.
...And 4 more matches
Mobile accessibility checklist - Accessibility
requirements: contrast ratio of 4.5:1 for normal text (less than 18 point or 14 point bold.) contrast ratio of 3:1 for large text (at least 18 point or 14 point bold.) information conveyed via colour must be also available by other means too (underlined text for links, etc.) visibility content hiding techniques such as zero opacity, z-index order and off-screen placement must not be used exclusively to handle visibility.
... unless absolutely unavoidable, aria-hidden attribute should not be used.
... use alt and title where appropriate (see steve faulkner's post about using the html title attribute for a good guide.) if the above attributes are not applicable, use appropriate aria states and properties such as aria-label, aria-labelledby, or aria-describedby.
...And 4 more matches
@import - CSS: Cascading Style Sheets
WebCSS@import
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.
...if the browser does not support any these queries, it does not load the linked resource.
... 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.
...And 4 more matches
@media - CSS: Cascading Style Sheets
WebCSS@media
note: in javascript, the rules created using @media can be accessed with the cssmediarule css object model interface.
... /* 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.
...except when using the not or only logical operators, the media type is optional and the all type will be implied.
...And 4 more matches
Flow Layout and Overflow - CSS: Cascading Style Sheets
this may cause some of your content to not be visible.
... note: in the working draft of overflow level 3, there is an additional value overflow: clip.
... this will act like overflow: hidden however it does not allow for programmatic scrolling, the box becomes non-scrollable.
...And 4 more matches
Layout using named grid lines - CSS: Cascading Style Sheets
then defined the centre block of the grid as content-start and content-end again, both for columns and rows although you do not need to name all of the lines on your grid.
... giving lines multiple names you may want to give a line more than one name, perhaps it denotes the sidebar-end and the main-start for example.
...idents are not quoted.
...And 4 more matches
CSS reference - CSS: Cascading Style Sheets
WebCSSReference
note that css rule definitions are entirely (ascii) text-based, whereas dom-css / cssom (the rule management system) is object-based.
... keyword index note: the property names in this index do not include the javascript names where they differ from the css standard names.
... --webkit-line-clampa:activeadditive-symbols (@counter-style)::after (:after)align-contentalign-itemsalign-selfall<an-plus-b><angle><angle-percentage>animationanimation-delayanimation-directionanimation-durationanimation-fill-modeanimation-iteration-countanimation-nameanimation-play-stateanimation-timing-function@annotationannotation()attr()b::backdropbackdrop-filterbackface-visibilitybackgroundbackground-attachmentbackground-blend-modebackground-clipbackground-colorbackground-imagebackground-originbackground-positionbackground-repeatbackground-size<basic-shape>::before (:before)bleed (@page)<blend-mode>block-sizeblur()borderborder-blockborder-block-colorborder-block-endborder-block-end-colorborder-block-end-styleborder-block-end-widthborder-block-startborder-block-start-colorborder-bl...
...And 4 more matches
border-bottom-left-radius - CSS: Cascading Style Sheets
note: if the value of this property is not set in a border-radius shorthand property that is applied to the element after the border-bottom-left-radius css property, the value of this property is then reset to its initial value by the shorthand property.
...f horizontal(width) and vertical(height) */ border-bottom-left-radius: 20% 20%; /* 20% of horizontal(width) and 10% of vertical(height) */ border-bottom-left-radius: 20% 10%; /* the corner is an ellipse */ /* border-bottom-left-radius: horizontal vertical */ border-bottom-left-radius: 0.5em 1em; border-bottom-left-radius: inherit; with one value: the value is a <length> or a <percentage> denoting the radius of the circle to use for the border in that corner.
... with two values: the first value is a <length> or a <percentage> denoting the horizontal semi-major axis of the ellipse to use for the border in that corner.
...And 4 more matches
border-bottom-right-radius - CSS: Cascading Style Sheets
note: if the value of this property is not set in a border-radius shorthand property that is applied to the element after the border-bottom-right-radius css property, the value of this property is then reset to its initial value by the shorthand property.
... 20%; /* same as above */ /* 20% of horizontal(width) and vertical(height) */ border-bottom-right-radius: 20% 10%; /* 20% of horizontal(width) and 10% of vertical(height) */ /*the corner is an ellipse */ /* border-bottom-right-radius: horizontal vertical */ border-bottom-right-radius: 0.5em 1em; border-bottom-right-radius: inherit; with one value: the value is a <length> or a <percentage> denoting the radius of the circle to use for the border in that corner.
... with two values: the first value is a <length> or a <percentage> denoting the horizontal semi-major axis of the ellipse to use for the border in that corner.
...And 4 more matches
border-top-left-radius - CSS: Cascading Style Sheets
note: if the value of this property is not set in a border-radius shorthand property that is applied to the element after the border-top-left-radius css property, the value of this property is then reset to its initial value by the shorthand property.
... syntax /* the corner is a circle */ /* border-top-left-radius: radius */ border-top-left-radius: 3px; /* the corner is an ellipse */ /* border-top-left-radius: horizontal vertical */ border-top-left-radius: 0.5em 1em; border-top-left-radius: inherit; with one value: the value is a <length> or a <percentage> denoting the radius of the circle to use for the border in that corner.
... with two values: the first value is a <length> or a <percentage> denoting the horizontal semi-major axis of the ellipse to use for the border in that corner.
...And 4 more matches
border-top-right-radius - CSS: Cascading Style Sheets
note: if the value of this property is not set in a border-radius shorthand property that is applied to the element after the border-top-right-radius css property, the value of this property is then reset to its initial value by the shorthand property.
... syntax /* the corner is a circle */ /* border-top-right-radius: radius */ border-top-right-radius: 3px; /* the corner is an ellipse */ /* border-top-right-radius: horizontal vertical */ border-top-right-radius: 0.5em 1em; border-top-right-radius: inherit; with one value: the value is a <length> or a <percentage> denoting the radius of the circle to use for the border in that corner.
... with two values: the first value is a <length> or a <percentage> denoting the horizontal semi-major axis of the ellipse to use for the border in that corner.
...And 4 more matches
cursor - CSS: Cascading Style Sheets
WebCSScursor
more than one <url> may be provided as fallbacks, in case some cursor image types are not supported.
... no-drop an item may not be dropped at the current location.
... bug 275173: on windows and mac os x, no-drop is the same as not-allowed.
...And 4 more matches
<custom-ident> - CSS: Cascading Style Sheets
the <custom-ident> css data type denotes an arbitrary user-defined string used as an identifier.
...it consists of one or more characters, where characters can be any of the following: any alphabetical character (a to z, or a to z), any decimal digit (0 to 9), a hyphen (-), an underscore (_), an escaped character (preceded by a backslash, \), a unicode character (in the format of a backslash, \, followed by one to six hexadecimal digits, representing its unicode code point) note that id1, id1, id1 and id1 are all different identifiers as they are case-sensitive.
... forbidden values a <custom-ident> must not be placed between single or double quotes as this would be identical to a <string>.
...And 4 more matches
env() - CSS: Cascading Style Sheets
WebCSSenv
e whole available space on the screen, and so enabling us to use the env() variables, we need to add a new viewport meta value: <meta name="viewport" content="viewport-fit=cover" /> body { padding: env(safe-area-inset-top, 20px) env(safe-area-inset-right, 20px) env(safe-area-inset-bottom, 20px) env(safe-area-inset-left, 20px); } in addition, unlike custom properties, which cannot be used outside of declarations, the env() function can be used in place of any part of a property value, or any part of a descriptor (e.g.
... note: unlike other css properties, user agent-defined property names are case-sensitive.
...) 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.
...And 4 more matches
filter - CSS: Cascading Style Sheets
WebCSSfilter
except where noted, the functions that take a value expressed with a percent sign (as in 34%) also accept the value expressed as decimal (as in 0.34).
...the parameter is specified as a css length, but does not accept percentage values.
...the function accepts a parameter of type <shadow> (defined in css3 backgrounds), with the exception that the inset keyword is not allowed.
...And 4 more matches
ime-mode - CSS: Cascading Style Sheets
WebCSSime-mode
note: in general, it's not appropriate for a public web site to change the ime mode.
...this value is not supported by internet explorer.
...not supported on linux.
...And 4 more matches
justify-content - CSS: Cascading Style Sheets
t; /* pack items from the start */ justify-content: end; /* pack items from the end */ justify-content: flex-start; /* pack flex items from the start */ justify-content: flex-end; /* pack flex items from the end */ justify-content: left; /* pack items from the left */ justify-content: right; /* pack items from the right */ /* baseline alignment */ /* justify-content does not take baseline values */ /* normal alignment */ justify-content: normal; /* distributed alignment */ justify-content: space-between; /* distribute items evenly the first item is flush with the start, the last is flush with the end */ justify-content: space-around; /* distribute items evenly ...
...for items that are not children of a flex container, this value is treated like start.
...for items that are not children of a flex container, this value is treated like end.
...And 4 more matches
justify-self - CSS: Cascading Style Sheets
note that justify-self is ignored in flexbox layouts.
...note that justify-self is ignored in flexbox layouts.
... flex-start for items that are not children of a flex container, this value is treated like start.
...And 4 more matches
place-content - CSS: Cascading Style Sheets
constituent properties this property is a shorthand for the following css properties: align-content justify-content syntax /* positional alignment */ /* align-content does not take left and right values */ place-content: center start; place-content: start center; place-content: end left; place-content: flex-start center; place-content: flex-end center; /* baseline alignment */ /* justify-content does not take baseline values */ place-content: baseline center; place-content: first baseline space-evenly; place-content: last baseline right; /* distributed alignment */ p...
... important: if the second value is not present, the first value is used for both, provided it is a valid value for both.
...for items that are not children of a flex container, this value is treated like start.
...And 4 more matches
place-items - CSS: Cascading Style Sheets
if the second value is not set, the first value is also used for it.
...for items that are not children of a flex container, this value is treated like start.
...for items that are not children of a flex container, this value is treated like end.
...And 4 more matches
rotate3d() - CSS: Cascading Style Sheets
if, as specified, the vector is not normalized (i.e., if the sum of the square of its three coordinates is not 1), the user agent will normalize it internally.
... note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative.
...the <number>s represent the x-, y-, and z-coordinates of the vector denoting the axis of rotation.
...And 4 more matches
visibility - CSS: Cascading Style Sheets
hidden the element box is invisible (not drawn), but still affects layout as normal.
...the element cannot receive focus (such as when navigating through tab indexes).
... interpolation visibility values are interpolable between visible and not-visible.
...And 4 more matches
Video player styling basics - Developer guides
note: in some cases some basic css is omitted from the code examples here as its use is either obvious or not specifically relevant to styling the video player.
... as mentioned earlier, a data-state attribute is now used to indicate whether the video controls are visible or not and these also need to be styled: .controls[data-state=hidden] { display:none; } .controls[data-state=visible] { display:block; } there are a number of properties that also need to be set for all elements within the video controls: .controls > * { float:left; width:3.90625%; height:100%; margin-left:0.1953125%; display:block; } .controls > *:first-child { margin-left:...
...0; } all elements are floated left, as they are to be aligned next to one another, and each element is set to have a width of nearly 4% (again the actual value was calculated based on the required dimensions of the buttons), and a height of 100%.
...And 4 more matches
Overview of events and handlers - Developer guides
douglas crockford explains this change effectively in several lectures, notably his talk, an inconvenient api: the theory of the dom, which shows the change in flow from the original browser flow to the event driven browser.
...the innovation of the dynamic approach allows for a page to be partially rendered even when the browser has not finished retrieving all resources; this approach also allows for event driven actions, which javascript leverages.
...note that the handler has access to the ev object since it is passed as an argument; the object has information about the event, notably the time at which the event occurred.
...And 4 more matches
A hybrid approach - Developer guides
luckily, we aren’t technically constrained to using client-side techniques here: another option is to use server-side user-agent detection to show the user the proper content.
... using user-agent detection specifically for content and not layout also allows you to have a single url for each piece of content, so that the content can adapt its layout to the user’s browser.
...but even if it does not work, it is no worse with respect to performance than only using fluid images.
...And 4 more matches
HTML attribute: required - HTML: Hypertext Markup Language
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.
...And 4 more matches
HTML attribute: step - HTML: Hypertext Markup Language
WebHTMLAttributesstep
if not explicitly included, step defaults to 1 for number and range, and 1 unit type (minute, week, month, day) for the date/time input types.
... the default stepping value for number inputs is 1, allowing only integers to be entered, unless the stepping base is not an integer.
... (week) <input type="week" min="2019-w23" step="2"> time 60 (seconds) <input type="time" min="09:00" step="900"> datetime-local 1 (day) <input type="datetime-local" min="019-12-25t19:30" step="7"> number 1 <input type="number" min="0" step="0.1" max="10"> range 1 <input type="range" min="0" step="2" max="10"> if any is not explicity set, valid values for the number, date/time input types, and range input types are equal to the basis for stepping - the min value and increments of the step value, up to the max value, if specified.
...And 4 more matches
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
WebHTMLElementabbr
if present, title must contain this full description and nothing else.
... each <abbr> element you use is independent from all others; providing a title for one does not automatically attach the same expansion text to others with the same content text.
... usage notes typical use cases it's certainly not required that all abbreviations be marked up using <abbr>.
...And 4 more matches
<form> - HTML: Hypertext Markup Language
WebHTMLElementform
it is possible to use the :valid and :invalid css pseudo-classes to style a <form> element based on whether or not the elements inside the form are valid.
... content categories flow content, palpable content permitted content flow content, but not containing <form> elements tag omission none, both the starting and ending tag are mandatory.
... this attribute was removed in html5 and should not be used.
...And 4 more matches
<label> - HTML: Hypertext Markup Language
WebHTMLElementlabel
associating a <label> with an <input> element offers some major advantages: the label text is not only visually associated with its corresponding text input; it is programmatically associated with it too.
... alternatively, you can nest the <input> directly inside the <label>, in which case the for and id attributes are not needed because the association is implicit: <label>do you like peas?
... <input type="checkbox" name="peas"> </label> other usage notes: the form control that the label is labeling is called the labeled control of the label element.
...And 4 more matches
<listing> - HTML: Hypertext Markup Language
WebHTMLElementlisting
the html 2 standard recommended that lines shouldn't be broken when not greater than 132 characters.
... note: do not use this element.
... implementation note: up to gecko 1.9.2 inclusive, firefox implements the htmlspanelement interface for this element.
...And 4 more matches
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
WebHTMLElementsource
it is an empty element, meaning that it has no content and does not have a closing tag.
... tag omission it must have a start tag, but must not have an end tag.
...please note that sizes will have its effect only if width dimension descriptors are provided with srcset instead of pixel ratio values (200w instead of 2x for example).
...And 4 more matches
<sub>: The Subscript element - HTML: Hypertext Markup Language
WebHTMLElementsub
usage notes the <sub> element should be used only 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, using <sub> to style the name of a company which uses altered baselines in their wordmark would not be appropriate; instead, css should be used (likely the vertical-align property, such as vertical-align: sub or, to more precisely control the baseline shift, vertical-align: -25%.
... appropriate use cases for <sub> include (but aren't necessarily limited to): marking up footnote numbers.
...And 4 more matches
<template>: The Content Template element - HTML: Hypertext Markup Language
WebHTMLElementtemplate
the html content template (<template>) element is a mechanism for holding html that is not to be rendered immediately when a page is loaded but may be instantiated subsequently during runtime using javascript.
...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.
...also allowed as a child of a <colgroup> element that does not have a span attribute.
...And 4 more matches
<thead>: The Table Head element - HTML: Hypertext Markup Language
WebHTMLElementthead
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.
... = "#00ff00" gray = "#808080" olive = "#808000" white = "#ffffff" yellow = "#ffff00" maroon = "#800000" navy = "#000080" red = "#ff0000" blue = "#0000ff" purple = "#800080" teal = "#008080" fuchsia = "#ff00ff" aqua = "#00ffff" usage note: do not use this attribute, as it is non-standard and only implemented in some versions of microsoft internet explorer: the <thead> element should be styled using css.
...And 4 more matches
Preloading content with rel="preload" - HTML: Hypertext Markup Language
note: there's more detail about these values and the web features they expect to be consumed by in the preload spec — see link element extensions.
... also note that the full list of values the as attribute can take is governed by the fetch spec — see request destinations.
...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.
...And 4 more matches
Configuring servers for Ogg media - HTTP
note: of course, the more key frames you use, the larger your video file is, so you may need to experiment a bit to get the right balance between file size and seek performance.
... configuration for older firefox versions serve x-content-duration headers note: as of firefox 41, the x-content-duration header is no longer supported.
...this header provides the duration of the video in seconds (not in hh:mm:ss format) as a floating-point value.
...And 4 more matches
Connection management in HTTP/1.x - HTTP
it's important point to note that connection management in http applies to the connection between two consecutive nodes, which is hop-by-hop and not end-to-end.
...short-lived connections do not make use of this efficiency feature of tcp, and performance degrades from optimum by persisting to transmit over a new, cold connection.
...this connection will not stay open forever: idle connections are closed after some time (a server may use the keep-alive header to specify a minimum time the connection should be kept open).
...And 4 more matches
CSP: frame-ancestors - HTTP
not setting this allows anything.
... this directive is not supported in the <meta> element.
...it will also not fall back to a default-src setting.
...And 4 more matches
CSP: sandbox - HTTP
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.
...if this keyword is not used, this operation is not allowed.
...if this keyword is not used, that functionality will silently fail.
...And 4 more matches
CSP: script-src - HTTP
this includes not only urls loaded directly into <script> elements, but also things like inline script event handlers (onclick) and xslt stylesheets which can trigger script execution.
...you can also specify data schemes (not recommended).
...use this sparingly and definitely not for scripts.
...And 4 more matches
Network Error Logging - HTTP
defaults to 0, so that no successful network requests will be reported if the key is not present in the json payload.
...defaults to 1, so that all failed network requests will be reported if the key is not present in the json payload.
...ork-error", "url": "https://example.com/previous-page", "body": { "elapsed_time": 338, "method": "post", "phase": "application", "protocol": "http/1.1", "referrer": "https://example.com/previous-page", "sampling_fraction": 1, "server_ip": "137.205.28.66", "status_code": 400, "type": "http.error", "url": "https://example.com/bad-request" } } dns name not resolved note that the phase is set to dns in this report and no server_ip is available to include.
...And 4 more matches
Protocol upgrade mechanism - HTTP
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.
...And 4 more matches
Enumerability and ownership of properties - JavaScript
ownership of properties is determined by whether the property belongs to the object directly and not to its prototype chain.
...enumerable and nonenumerable propertyisenumerable hasownproperty hasownproperty – filtered to exclude enumerables using propertyisenumerable hasownproperty enumerable nonenumerable enumerable and nonenumerable not available without extra code not available without extra code in not available without extra code retrieval enumerable nonenumerable enumerable and nonenumerable object.keys getownpropertynames getownpropertysymbols getownpropertyna...
...mes, getownpropertysymbols – filtered to exclude enumerables using propertyisenumerable getownpropertynames getownpropertysymbols not available without extra code not available without extra code iterable enumerable nonenumerable enumerable and nonenumerable object.keys getownpropertynames getownpropertysymbols getownpropertynames, getownpropertysymbols – filtered to exclude enumerables using propertyisenumerable getownpropertynames getownpropertysymbols enumerable nonenumerable enumerable and nonenumerable...
...And 4 more matches
Concurrency model and the event loop - JavaScript
heap objects are allocated in a heap which is just a name to denote a large (mostly unstructured) region of memory.
... event loop the event loop got its name because of how it's usually implemented, which usually resembles: while (queue.waitformessage()) { queue.processnextmessage() } queue.waitformessage() waits synchronously for a message to arrive (if one is not already available and waiting to be handled).
... this offers some nice properties when reasoning about your program, including the fact that whenever a function runs, it cannot be pre-empted and will run entirely before any other code runs (and can modify data the function manipulates).
...And 4 more matches
Iterators and generators - JavaScript
while it is easy to imagine that all iterators could be expressed as arrays, this is not true.
...terationcount, done: true } } }; return rangeiterator; } using the iterator then looks like this: const it = makerangeiterator(1, 10, 2); let result = it.next(); while (!result.done) { console.log(result.value); // 1 3 5 7 9 result = it.next(); } console.log("iterated over sequence of size: ", result.value); // [5 numbers returned, that took interval in between: 0 to 10] note: it is not possible to know reflectively whether a particular object is an iterator.
...generator functions provide a powerful alternative: they allow you to define an iterative algorithm by writing a single function whose execution is not continuous.
...And 4 more matches
Quantifiers - JavaScript
do not forget to edit it as well, thanks!
... note: in the following, item refers not only to singular characters, but also includes character classes, unicode property escapes, groups and ranges.
...for example, /bo*/ matches "boooo" in "a ghost booooed" and "b" in "a bird warbled", but nothing in "a goat grunted".
...And 4 more matches
TypeError: X.prototype.y called on incompatible type - JavaScript
the javascript exception "called on incompatible target (or object)" occurs when a function (on a given object), is called with a this not corresponding to the type expected by the function.
... message typeerror: 'this' is not a set object (edge) typeerror: function.prototype.tostring called on incompatible object (firefox) typeerror: function.prototype.bind called on incompatible target (firefox) typeerror: method set.prototype.add called on incompatible receiver undefined (chrome) typeerror: bind must be called on a function (chrome) error type typeerror what went wrong?
... when this error is thrown, a function (on a given object), is called with a this not corresponding to the type expected by the function.
...And 4 more matches
Array.prototype.concat() - JavaScript
this method does not change the existing arrays, but instead returns a new array.
... description the concat method creates a new array consisting of the elements in the object on which it is called, followed in order by, for each argument, the elements of that argument (if the argument is an array) or the argument itself (if the argument is not an array).
... it does not recurse into nested array arguments.
...And 4 more matches
Array.prototype.copyWithin() - JavaScript
the copywithin() method shallow copies part of an array to another location in the same array and returns it without modifying its length.
... if target is at or greater than arr.length, nothing will be copied.
...copywithin copies up to but not including end.
...And 4 more matches
Atomics.wait() - JavaScript
it returns a string which is either "ok", "not-equal", or "timed-out".
... note: this operation only works with a shared int32array and may not be allowed on the main thread.
... return value a string which is either "ok", "not-equal", or "timed-out".
...And 4 more matches
BigInt - JavaScript
sohuge = bigint(9007199254740991) // ↪ 9007199254740991n const hugestring = bigint("9007199254740991") // ↪ 9007199254740991n const hugehex = bigint("0x1fffffffffffff") // ↪ 9007199254740991n const hugebin = bigint("0b11111111111111111111111111111111111111111111111111111") // ↪ 9007199254740991n bigint is similar to number in some ways, but also differs in a few key matters — it cannot be used with methods in the built-in math object and cannot be mixed with instances of number in operations; they must be coerced to the same type.
... also unsupported is the unary operator (+), in order to not break asm.js.
... however, since these are bigints and not bigdecimals, this operation will round towards 0 (which is to say, it will not return any fractional digits).
...And 4 more matches
Date - JavaScript
it needs real-world feedback from web developers, but is not yet ready for production use!
... note: it's important to keep in mind that while the time value at the heart of a date object is utc, the basic methods to fetch the date and time or its components all work in the local (i.e.
... it should be noted that the maximum date is not of the same value as the maximum safe integer (number.max_safe_integer is 9,007,199,254,740,991).
...And 4 more matches
Object.prototype.constructor - JavaScript
note that the value of this property is a reference to the function itself, not a string containing the function's name.
...only true, 1, and "test" will not be affected (as they have read-only native constructors).
... this example shows that it is not always safe to rely on the constructor property of an object.
...And 4 more matches
String.prototype.normalize() - JavaScript
let string1 = '\u00f1'; let string2 = '\u006e\u0303'; console.log(string1); // ñ console.log(string2); // ñ however, since the code points are different, string comparison will not treat them as equal.
...in the example below we normalize two representations of the character "ñ": let string1 = '\u00f1'; // ñ let string2 = '\u006e\u0303'; // ñ string1 = string1.normalize('nfd'); string2 = string2.normalize('nfd'); console.log(string1 === string2); // true console.log(string1.length); // 2 console.log(string2.length); // 2 composed and decomposed forms note that the length of the normalized form under "nfd" is 2.
...nsole.log(string1 === string2); // true console.log(string1.length); // 1 console.log(string2.length); // 1 console.log(string2.codepointat(0).tostring(16)); // f1 compatibility normalization in unicode, two sequences of code points are compatible if they represent the same abstract characters, and should be treated alike in some — but not necessarily all — applications.
...And 4 more matches
WebAssembly.Memory - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsmemorychrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0memory() constructorchrome full support 57edge full support 16firefox full support ...
... 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios ...
...And 4 more matches
WebAssembly.validate() - JavaScript
the webassembly.validate() function validates a given typed array of webassembly binary code, returning whether the bytes form a valid wasm module (true) or not (false).
... return value a boolean that specifies whether buffersource is valid wasm code (true) or not (false).
... exceptions if buffersource is not a typed array or arraybuffer, a typeerror is thrown.
...And 4 more matches
if...else - JavaScript
if the condition is falsy, another statement can be executed.
...note that there is no elseif (in one word) keyword in javascript.
...in general, it is a good practice to always use block statements, especially in code involving nested if statements: if (condition) { statements1 } else { statements2 } do not confuse the primitive boolean values true and false with truthiness or falsiness of the boolean object.
...And 4 more matches
label - JavaScript
note: labeled loops or blocks are very uncommon.
... syntax label : statement label any javascript identifier that is not a reserved word.
... note that javascript has no goto statement, you can only use labels with break or continue.
...And 4 more matches
var - JavaScript
duplicate variable declarations using var will not trigger an error, even in strict mode, and the variable will not lose its value, unless another assignment is performed.
... 'use strict'; console.log(x); // undefined (note: not referenceerror) console.log('still going...'); // still going...
...this means its property descriptor cannot be changed and it cannot be deleted using delete.
...And 4 more matches
with - JavaScript
use of the with statement is not recommended, as it may be the source of confusing bugs and compatibility issues.
... using with is not recommended, and is forbidden in ecmascript 5 strict mode.
...the scope chain change required by 'with' is not computationally expensive.
...And 4 more matches
JavaScript
this section is dedicated to the javascript language itself, and not the parts that are specific to web pages or other host environments.
... do not confuse javascript with the java programming language.
... javascript guide javascript guide a much more detailed guide to the javascript language, aimed at those with previous programming experience either in javascript or another language.
...And 4 more matches
Mapping the width and height attributes of media container elements to their aspect-ratio - Web media technologies
without the width and height attributes, no placeholder space would be created, and when the image finally loaded you would get a noticeable jank in the page layout.
... keep images from breaking out of their containers when the container becomes narrower than the image, developers started using css like the following: img { max-width: 100%; height: auto; } this is really useful for responsive layouts, but unfortunately it causes the jank problem to return — the above css overrides the width and height attribute information, meaning that if the image has not loaded for some reason, its height will be set to 0.
... note: currently this effect is being limited to actual <img> elements, as applying to other such elements may have undesirable results.
...And 4 more matches
Progressive web apps (PWAs)
being a secure site is not only a best practice, but it also establishes your web application as a trusted site especially if users need to make secure transactions.
...this guide explains how a2hs is used, and what you need to do as a developer to allow your users to take advantage of it.how to make pwas installablein 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.how to make pwas re-engageable using notifications and pushhaving the ability to cache the contents of an app to work offline is a great feature.
...but instead of relying only on user actions, we can do more, using push messages and notifications to automatically re-engage and deliver new content whenever it is available.introduction to progressive web appsthis article provides an introduction to progressive web apps (pwas), discussing what they are and the advantages they offer over regular web apps.making pwas work offline with service workersin this article we took a simple look at how you can make your pwa work offline with service workers.
...And 4 more matches
glyph-orientation-vertical - SVG: Scalable Vector Graphics
otherwise, if the angle is not a multiple of 180 degrees, then the current text position is incremented according to the horizontal metrics of the glyph.
... note: as a presentation attribute, glyph-orientation-vertical can be used as a css property.
... as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> context notes value auto | <angle> default value auto animatable no auto fullwidth ideographic and fullwidth latin text will be set with a glyph orientation of 0 degrees.
...And 4 more matches
href - SVG: Scalable Vector Graphics
WebSVGAttributehref
note: specifications before svg 2 defined an xlink:href attribute, which is now rendered obsolete by the href attribute.
...if the url points to multiple target elements, if the given target element is not capable of being a target of the given animation element, or if the given target element is not part of the current document, then the animation element will not affect any target element.
... if the href attribute or the deprecated xlink:href attribute is not provided, then the target element will be the immediate parent element of the current animation element.
...And 4 more matches
xlink:href - SVG: Scalable Vector Graphics
note: svg 2 removed the need for the xlink namespace, so instead of xlink:href you should use href.
... if the xlink:href attribute is not provided, the target element will be the immediate parent element of the current animation element.
... value <iri> default value none animatable yes filter for <filter>, xlink:href defines the reference to another <filter> element within the current svg document fragment.
...And 4 more matches
Introduction - SVG: Scalable Vector Graphics
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.
...a simple svg document consists of nothing more than the <svg> root element and several basic shapes that build a graphic together.
...And 4 more matches
Features restricted to secure contexts - Web security
note: only the browsers that actually support secure contexts are listed in this document.
... api chrome/opera edge safari firefox async clipboard api 66 not supported not supported 63 background sync (see syncmanager, for example) 49 not supported not supported not supported cache-control: immutable not supported 15 11 49 credential management api 51 not supported not supported not supported generic sensor api 67 not supported not supported not supported payment request api (and basic card payment).
... push api 42 17 not supported 44 reporting api supported not supported not supported behind flag since fx 65 service workers 40 17 11.1 44 storage api 55 not supported not supported 51 web authentication api 65 in preview (17) in development 60 web bluetooth 56 not supported not supported not supported web midi (see midiaccess, for example) 43 not supported not supported not supported web crypto api 60 79 not supported 75 secure context restrictions that vary by browser some browsers may decide to disable certain apis in non-secure co...
...And 4 more matches
Web Components
this has traditionally not been so easy for custom markup structures — think of the complex html (and associated style and script) you've sometimes had to write to render custom ui controls, and how using them multiple times can turn your page into a mess if you are not careful.
... html templates: the <template> and <slot> elements enable you to write markup templates that are not displayed in the rendered page.
... reference custom elements customelementregistry contains functionality related to custom elements, most notably the customelementregistry.define() method used to register new custom elements so they can then be used in your document.
...And 4 more matches
Index - XPath
WebXPathIndex
it can also be used to test addressed nodes within a document to determine whether they match a pattern or not.
...if an xpath expression does not specify an axis, the child axis is understood by default.
... since only the root node or element nodes have children, any other use will select nothing.
...And 4 more matches
Communicating using "port" - Archive of obsolete content
to send messages from one side to the other, use port.emit() to receive messages sent from the other side, use port.on() messages are asynchronous: that is, the sender does not wait for a reply from the recipient but just emits the message and continues processing.
... accessing port accessing port in the content script note that the global self object is completely different from the self module, which provides an api for an add-on to access its data files and id.
... however, the worker is not exposed to add-on code in quite the same way in all modules.
...And 3 more matches
private-browsing - Archive of obsolete content
opting into private browsing add-ons built using the sdk must opt into private browsing by setting the following key in their package.json file: "permissions": {"private-browsing": true} if an add-on has not opted in, then the high-level sdk modules will not expose private windows, or objects (such as tabs) that are associated with private windows: the windows module will not list any private browser windows, generate any events for private browser windows, or let the add-on open any private browser windows the tabs module will not list any tabs that belong to private browser windows, and...
... the add-on won't receive any events for such tabs any ui components will not be displayed in private browser windows any menus or menu items created using the context-menu will not be shown in context menus that belong to private browser windows the page-mod module will not attach content scripts to documents belonging to private browser windows any panel objects will not be shown if the active window is a private browser window the selection module will not include any selections made in private browser windows add-ons that have opted in will see private windows, so they will need to use the private-browsing module to check whether objects are private, so as to avoid storing data derived from such objects.
... additionally, add-ons that use low-level modules such as window/utils may see private browser windows with certain functions, even if they have not explicitly opted into private browsing.
...And 3 more matches
url - Archive of obsolete content
any api in the sdk which has a url parameter will accept url objects, not raw strings, unless otherwise noted.
...if source is not a valid uri, this constructor will throw an exception.
...if is not a valid uri, this constructor will throw an exception.
...And 3 more matches
Chrome Authority - Archive of obsolete content
components an alias for components itself (note the lower-case).
... note: the require("chrome") statement is the only way to access chrome functionality and the components api.
... the components object should not be accessed from modules.
...And 3 more matches
Localization - Archive of obsolete content
the string is inserted as text, so you can't insert html using a statement like: # does not work.
... further the localization of the aria attributes aria-label, aria-valuetext and aria-moz-hint are supported with the same aliases as on firefox os: arialabel ariavaluetext ariamozhint using localized strings in javascript to reference localized strings from your main add-on code, you do this: var _ = require("sdk/l10n").get; console.log(_("hello_id")); assigning to "_" in particular is not required, but is a convention from the gettext tools and will make it possible to work with existing tools that expect "_" to indicate localizable strings.
... note that because you can't require() modules in content scripts, you can't yet reference localized strings from content scripts.
...And 3 more matches
Dialogs and Prompts - Archive of obsolete content
explicit if you are not satisfied with the layout of predefined buttons in dialog, you can put explicit button elements in your xul file and add a dlgtype attribute to them.
...the header to the right of the sections buttons is made with <dialogheader>: <dialogheader title="general" description="whatever"/> note, that you should only use this element in a <dialog>, because otherwise it may be not styled properly.
...typically, nothing is done here.
...And 3 more matches
Downloading Files - Archive of obsolete content
the following methods of downloading files may not work as expected after firefox 26, and should no longer be used.
...if, and only if, the url is not // related to a window, null should be used instead.
...if, and only if, the url is not // related to a window, null should be used instead.
...And 3 more matches
JavaScript Debugger Service - Archive of obsolete content
note that onerror is called for every exception.
...type; if (flags & jsdierrorhook.report_error) messagetype = "error"; if (flags & jsdierrorhook.report_warning) messagetype = "warning"; if (flags & jsdierrorhook.report_exception) messagetype = "uncaught-exception"; if (flags & jsdierrorhook.report_strict) messagetype += "-strict"; dump(messagetype + "\n"); return false; // trigger debughook // return true; if you do not wish to trigger debughook } }; // note that debughook does not _always_ trigger when jsd.errorhook[onerror] returns false // it is not well-known why debughook sometimes fails to trigger jsd.debughook = { onexecute: function(frame, type, rv) { stacktrace = ""; for (var f = frame; f; f = f.callingframe) { stacktrace += f.script.filename + "@" + f.line + "@" + f.functionname + "\n"; }...
...note that the jsdifilter only applies to jsdiexecutionhooks, which are breakpointhook, debughook, debuggerhook, interrupthook and throwhook.
...And 3 more matches
LookupNamespaceURI - Archive of obsolete content
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).
...And 3 more matches
Displaying web content in an extension without security issues - Archive of obsolete content
in particular, a content document can only go up in the frame hierarchy until the topmost content document, it cannot access the chrome documents above it.
...note: this has really nothing to do with the source of the document.
...note: dynamic changes of the "type" attribute have no effect, the frame type is read out when the frame element is inserted into the document and never again.
...And 3 more matches
Downloading JSON and JavaScript in extensions - Archive of obsolete content
this practice is dangerous and will not, in fact, pass an amo review.
... so the extension will not be allowed to move out of the amo sandbox.
... downloading json if the extension is downloading json, then the developer should be using one of the json decoding methods discussed here and not using eval() at all.
...And 3 more matches
Interaction between privileged and non-privileged pages - Archive of obsolete content
(to better ensure others do not also implement the same event with a different meaning, one might either attach a namespace to <myextensiondataelement/> and check on the event handler for the correct namespaceuri property, or as per the dom specification, use initevent() with an event name that is itself namespaced (xml name characters only): "it is also strongly recommended that third parties adding their own events use their...
... own prefix to avoid confusion and lessen the probability of conflicts with other new events.") in the case where your extension's overlay does not interact directly with browser.xul, such as in a sidebar, it might be easier to add the event listener to the top-level document directly as shown below (also see: accessing the elements of the top-level document from a child window).
... note: if you're using html5's postmessage() to send a message from unprivileged code to privileged code, adding 'true' to the end of your event listener in your privileged chrome code will allow the message to be received.
...And 3 more matches
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
regarding local data, it is debatable if it is good practice to remove it or not.
...another argument in favor of keeping that data is that firefox doesn't delete its profile folders after it is uninstalled, so it would be consistent to keep it.
...the add-on will not be completely removed until the browser is restarted.
...And 3 more matches
Local Storage - Archive of obsolete content
« previousnext » note: you may rather be looking for dom storage (localstorage, etc.), unless you really are doing xul development.
...whether this is necessary or not is a matter of preference.
...appender = new log4moz.rotatingfileappender(logfile, formatter); appender.level = log4moz.level["all"]; root.addappender(appender); after that, you can create a logger object for any object in your project like this: this._logger = log4moz.repository.getlogger("xulschool.someobject"); this._logger.level = log4moz.level["all"]; note: we recommend that you create a logger instance in the constructor of every object and store it in a private variable.
...And 3 more matches
Supporting search suggestions in search plugins - Archive of obsolete content
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.
... descriptions are not supported in firefox, and are ignored if any are specified.
... query urls are not supported in firefox, and are ignored.
...And 3 more matches
Creating reusable content with CSS and XBL - Archive of obsolete content
note: xbl cannot be loaded over http, so this technique is only useful for local content accessed using the file:/// scheme, or from add-on code.
...information: xbl bindings the structure provided by markup languages and css is not ideal for complex applications where parts need to be self-contained and reusable.
...another structural limitation concerns content.
...And 3 more matches
XUL user interfaces - Archive of obsolete content
information: user interfaces although html has some support for user interfaces, it does not support all the features that you need to make a standalone application.
... while (d-- > 0) currentday = currentday.nextsibling currentday.removeattribute("disabled") } datebox.focus(); } function showstatus(adate) { if (adate == null) { status.removeattribute("warning") status.setattribute("label", "") } else if (adate === false || isnan(adate.gettime())) { status.setattribute("warning", "true") status.setattribute("label", "date is not valid") } else { status.removeattribute("warning") status.setattribute("label", adate.tolocaledatestring()) } } to see the result exactly as intended, use the default theme in your browser.
...this wiki does not support xul and javascript in pages, so it is not possible to show the demonstration here.
...And 3 more matches
List of Mozilla-Based Applications - Archive of obsolete content
me) standalone version cloud web operating system cloud browse iphone/ipad/ipod touch browser seems to be firefox running remotely on servers that people access through device conkeror keyboard-oriented browser convertigo enterprise mashup server server tool for transactional web scraping and for web clipping cometbird another firefox mod modified version of firefox correo email couac (fr) web-based email and jabber app couchdb document-oriented database uses spidermonkey courtanet benefit (fr) underwriting software for french insurance brokers crosscheck browserless testing framework uses mozilla rhino crowbar server tool ...
... version 8 will be based on thunderbird evergreen library automation system evolution email client uses nss exe elearning xhtml editor seems to be using xul for some of their webui facebook open platform facebook open platform the fbml parser used in the platform is based on mozilla code fennec browser for mobiles as mark notes: fennec is not firefox, it’s a completely different application findthatfont!
...r linux google’s desktop widget engine uses xulrunner according to the build instructions grani grain sizing assessment tool according to this wiki page grani is based on xul and xpcom daim gwt-mosaic-xul xul builder for google web tools hachette's multimedia encyclopedia electronic encyclopedia this product was using mozilla in 2004 but i’m not sure if new version still does hacketyhack little coders helma web application framework uses mozilla rhino holt mcdougal cd-roms educational cd-roms activity generator and lab generator are both based on custom firefox distributions houdini 3d animation tools uses gecko in embedded help viewer httpunit automated testing fra...
...And 3 more matches
Using XML Data Islands in Mozilla - Archive of obsolete content
this feature is not based on multi-vendor web standards and is not supported in firefox (or other non-ie browsers).
...javascript can use the content of a <script> element as a data block if the src attribute is omitted and the type attribute does not specify an executable script type.
... when putting xml in a data block, you need to make sure that the xml content you are embedding does not have an end tag that case-insensitively matches "</script>".
...And 3 more matches
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
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.
... 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).
...it is advisable to rename the control and not to install somewhere like the windows directory where it is likely to be overridden.
...And 3 more matches
Locked config settings - Archive of obsolete content
putting into place locked configuration settings this feature exists for mozilla and firefox, but not for thunderbird locked settings can be put into a mozilla.cfg file in the c:\program files\mozilla.org\mozilla directory.
...this file also needs to be "called" from c:\program files\mozilla.org\mozilla\defaults\pref\all.js by appending the following line at the end: pref("general.config.filename", "mozilla.cfg"); note: newer versions of mozilla or firefox store the all.js file in greprefs rather than defaults\pref the moz-byteshift.pl script allows to encode...: moz-byteshift.pl -s 13 <mozilla.cfg.txt >mozilla.cfg ...
...note that the file must start with //, or else it is not recognized by mozilla.
...And 3 more matches
Structure of an installable bundle - Archive of obsolete content
basic structure of a bundle a bundle may include any of the following files: path from the root of the bundle description version information /install.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.
...And 3 more matches
Getting Started - Archive of obsolete content
for this reason we suggest that you install a second copy into a second directory (make sure that you use a different profile as stated in the release notes) extract the chrome the chrome is stored in \mozilla\chrome and the individual modules are stored in jar files.
...looking in the directory you'll also notice that there are classic.jar and modern.jar files.
...now all of the css and images are extracted, but if you make some changes and run mozilla as it is, you will not see them because it's still set to look at the files in the jar files.
...And 3 more matches
Creating a Skin for Firefox/Getting Started - Archive of obsolete content
note: starting in gecko 2.0, the new omni.jar file contains the skin, among other resources.
... go to contents/macos/chrome/classic.jar copy classic.jar to another easily accessible folder -- classic is recommended -- extract the contents of that folder, being sure to maintain the directory structure.
... skin skin simply contains another directory, classic which holds all the good stuff.
...And 3 more matches
Using microformats - Archive of obsolete content
note: if a microformat by the specified name already exists, it is replaced by the new one.
... note: you can simply call debug() on a microformat object: microformatobject.debug() instead of using this method if you prefer.
...if the node isn't a microformat, nothing is returned.
...And 3 more matches
GRE - Archive of obsolete content
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.
...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.
... find a compatible gre note: support for locating a standalone glue was removed in gecko 6.0.
...And 3 more matches
Helper Apps (and a bit of Save As) - Archive of obsolete content
nsimimeinfo lookup look in built-in list which the user cannot override (types we handle internally).
... gets notifications from necko as the data comes in.
... puts the data in the file as ondataavailable notifications come in.
...And 3 more matches
Basics - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
...log(stringstring)this method writes a notification message to the console.
...class notifications the notification box appears at the bottom right corner of the browser and displays important information to the user.
...And 3 more matches
Microsummary topics - Archive of obsolete content
you may also use another form appropriate to your extension.
... note: when web sites install generators via window.sidebar.addmicrosummarygenerator(), firefox sets their uri attribute to urn:source:sourceurl, where sourceurl is the url from which the generator was downloaded.
... in the future, firefox may access source urls to download updated versions of generators, so unless you are installing generators which are available from urls, you should not use this form for your programmatically-installed generators.
...And 3 more matches
How to Write and Land Nanojit Patches - Archive of obsolete content
(note: this document is called nanojitmerge for historical reasons -- adobe and mozilla used to have separate copies of nanojit, but this was a maintenance headache so they were merged.
... so, do not land nanojit changes directly to the tracemonkey and tamarin-redux repositories!
...once it passes review, land it on nanojit-central, mark the bug's whiteboard as fixed-in-nanojit, and note the revision in a comment.
...And 3 more matches
BundleLibrary - Archive of obsolete content
note: these bundles have not be tested with the latest version of prism and probably won't run.
...bundles gmail: gmail.webapp google calendar: gcalendar.webapp google docs: gdocs.webapp google groups: groups.webapp google analytics: ganalytics.webapp google reader: greader.webapp facebook: facebook.webapp twitter: twitter.webapp user contributed bundles gmail w/gtalk: gmail.webapp (note: work with latest version of prism!) 32 online todo lists: zip file with web apps for 32 online todo lists anywhere.fm: anywhere.fm@prism.app.webapp a service that lets you upload your entire music library to their servers and listen from anywhere through a slick flash interface.
... aol email : aolemail.webapp bbc radio player bbcradioplayer.webapp bloglines : bloglines.webapp bloglines beta: beta.bloglines.webapp chandler: chandler.webapp flash earth (integrates all major mapping sites) flashearth.webapp flickr: flickr.webapp gollum wikipedia browser in english:gollum_en.webapp google notebook: gnote.webapp google page creator: google_pagecreator.webapp google reader + gtalk : prism-bundle-google-reader-with-gtalk.webapp google webmaster tools: google_webmastertools.webapp grandcentral inbox: grandc.webapp (note: grandcentral requires the flash plugin.
...And 3 more matches
Space Manager High Level Design - Archive of obsolete content
when a float is incrementally reflowed, the space manager is notified if the float's region has changed.
... if so, the vertical space that has been affected (including both the float's old region and the float's new region) is noted in the internal nsintervalset as potential float damage (the method is includeindamage).
... during the incremental reflow of dirty lines the block frame may encounter lines that are not dirty.
...And 3 more matches
File object - Archive of obsolete content
file is non-standard, not generally compiled into distributions, is a potential source of huge security holes, and not well tested.
...bi-directional pipelines are not supported.
...note: calculating the length of the directory is very expensive.
...And 3 more matches
Treehydra Manual - Archive of obsolete content
note that the callbacks interact with other treehydra options.
...in this case, gimple asts will not be available, as gcc does not save earlier intermediate representations--they are modified in place.
... thus, it is not currently possible to get both gimple asts and cfgs in the same run of treehydra.
...And 3 more matches
Using addresses of stack variables with NSPR threads on win16 - Archive of obsolete content
this is a cautionary note that may be old information for some of you.
...the actual copying of the stack is not such a hardship as one would imagine.
...what is a hardship is that addresses of dynamic variables, those allocated on the call stack, in a function's local frame, are not valid across thread boundaries.
...And 3 more matches
When To Use ifdefs - Archive of obsolete content
for instance, xpcom, the spidermonkey javascript engine, and the networking engine do not know anything about xul and should not have any ifdefs based on --disable-xul.
...moz_xul_app ifdefs are not acceptable in tier 9, but are acceptable (even necessary) in later tiers.
...as a general rule, any code in tier 2, tier 9, or tier 50 is shared code, and should not have application-specific ifdefs.
...And 3 more matches
Writing textual data - Archive of obsolete content
the example above passes 0 as the third argument, which disables buffering (note: the implementation of the converter stream might not support buffering).
... unsupported characters you can specify what should happen with characters that are not supported by the selected character encoding.
... 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.
...And 3 more matches
ContextMenus - Archive of obsolete content
you should not assume that a user has used the mouse to open a context menu.
... note that the default attribute just affects how the item is displayed, it performs no other function itself.
...note that this special value must begin with an underscore to distinguish it from an id of 'child'.
...And 3 more matches
Bindings - Archive of obsolete content
to do this all we need to do is add the necessary data to the rdf datasource and add another <triple> element to the template's statements.
...let assume though, that we are only going to add a description to one of the photos in the datasource; the other two photos will not have a description.
... this may mean the description is not known, or that it wasn't filled in by the user.
...And 3 more matches
Building Hierarchical Trees - Archive of obsolete content
note that this test is done on the member value not the reference value.
...it is the result, or the photo, that will be checked, not the container of photos.
... since a photo isn't a container, the tree rows will not become containers, so you will not be able to open them.
...And 3 more matches
Building Trees - Archive of obsolete content
this means that dom nodes are not constructed for any of the items.
... note: while a tree builder can only be used with trees, a content builder can be used with any type of content.
...id="name" label="name" flex="1"/> <treecol id="date" label="date" flex="1"/> </treecols> <template> <treechildren> <treeitem uri="rdf:*"> <treerow> <treecell label="rdf:http://purl.org/dc/elements/1.1/title"/> <treecell label="rdf:http://purl.org/dc/elements/1.1/date"/> </treerow> </treeitem> </treechildren> </template> </tree> note: the tree columns (treecols) are declared outside the template as static content, since they only need to be declared once.
...And 3 more matches
XML Templates - Archive of obsolete content
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.
... the child of the action element has to have a uri attribute, although it does not have to be a direct child.
...when a question mark character followed by a string appears in an attribute value, the label value is not directly, but instead the value of an attribute for the source xml is used.
...And 3 more matches
Tree Widget Changes - Archive of obsolete content
some specific changes you should now get the tree selection object from the view, not the box object, meaning use tree.view.selection instead of tree.treeboxobject.selection.
...previously the value existed but was not implemented.
...note that it's the value attribute you use, not the label attribute.
...And 3 more matches
Adding Properties to XBL-defined Elements - Archive of obsolete content
often, fields would correspond to an attribute placed on the element such as label or disabled, but they do not have to.
...this example isn't quite correct because the field is not assigned a default value.
... note that unlike a field, a property does not hold a value.
...And 3 more matches
Content Panels - Archive of obsolete content
note that xul does have a wizard element which may be used to create wizard interfaces.
...another approach is to use the iframe element, which works much like the html element of the same name.
...this url may point to any kind of file, although it will usually point to an html file or another xul file.
...And 3 more matches
Creating Dialogs - Archive of obsolete content
note: opendialog() requires universalbrowserwrite privilege.
... this means it will not work on remote sites; for those, use window.open() instead.
...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.
...And 3 more matches
Creating a Skin - Archive of obsolete content
« previousnext » this documentation has not updated for firefox quantum.
... modifying userchrome.css is not guaranteed to work between versions of firefox and may lead to hard-to-diagnose bugs.
...note in the image that this style has applied only to the first tab, because it's the selected one.
...And 3 more matches
Cross Package Overlays - Archive of obsolete content
applying overlays to other packages note: this section talks about contents.rdf which has been replaced in gecko 1.8 by manifest files.
... overlays have another very useful feature.
...this is useful because the overlay can modify the user interface of another package without changing the other package.
...And 3 more matches
More Tree Features - Archive of obsolete content
note also that the user cannot hide the primary column using the drop down to the right of the columns.
...notice how the guys row only needs one column as it is a placeholder item for its children.
...for example, a directory with no files in it should still be treated like a container whereas a file should not.
...And 3 more matches
Numeric Controls - Archive of obsolete content
other characters are not allowed and are just ignored if typed.
...if the minimum value is not specified, it has a default value of 0.
...since the min attribute was not specified, it defaults to 0.
...And 3 more matches
The Box Model - Archive of obsolete content
the elements will not wrap at all so the more elements you add, the wider the window will be.
...notice that only the elements that are direct descendants of the box are oriented vertically.
...aligning textboxes if you look closely at the image of the login dialog, you can see that the two textboxes are not aligned with each other horizontally.
...And 3 more matches
XBL Attribute Inheritance - Archive of obsolete content
note how the inherits attribute has been placed in the xbl namespace, by prefixing it with 'xbl:'.
...this technique is used to set the default value if the attribute is not present.
...the syntax <inner attribute>=<outer attribute> is used to map one attribute to another.
...And 3 more matches
Using the standard theme - Archive of obsolete content
at the beginning, there is no style when creating a new xul <tt>window</tt> (or a new <tt>dialog</tt>, for that matter) in your extension, and you do not associate a style sheet with it, your widgets will be unstyled.
...you do not have to specify a specific file; mozilla will determine by its own which files in the directory it needs to use.
... if you are only going to use these global style sheets, you of course do not need a <tt>skin</tt> directory in your extension package, and also do not have to register a style in the <tt>chrome.manifest</tt>.
...And 3 more matches
XUL Template Primer - Bindings - Archive of obsolete content
when displayed in mozilla, something like this appears: note that even though poor lumpy has no nc:address property, he still appears in the content model!
... unlike the <conditions>, bindings do not affect whether or not a rule matches: they just "pull through" additional information if it is available.
... the subject may refer to any variable that has been computed in the <conditions>, or it may refer to another <binding>'s object variable.[1] in our example, the second <binding>'s subject does this: the value for the ?addr variable is computed by the first <binding> the predicate must name the uri of an rdf property, in this case, nc:address.
...And 3 more matches
arrowscrollbox - Archive of obsolete content
disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
... in the case of form elements, it will not be submitted.
...And 3 more matches
checkbox - Archive of obsolete content
checked type: boolean indicates whether the element is checked or not.
... none the text will be not be cropped using an ellipsis.
...for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not.
...And 3 more matches
command - Archive of obsolete content
ly focused element: // first include chrome://global/content/globaloverlay.js godocommand("cmd_paste"); example with two buttons <commandset><command id="cmd_openhelp" oncommand="alert('help');"/></commandset> <button label="help" command="cmd_openhelp"/> <button label="more help" command="cmd_openhelp"/> attributes disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
... in the case of form elements, it will not be submitted.
...And 3 more matches
iframe - Archive of obsolete content
currently, xul iframes running in remote processes are not supported.
...this);"> <menupopup> <menuitem label="mozilla" value="http://mozilla.org" /> <menuitem label="slashdot" value="http://slashdot.org"/> <menuitem label="sourceforge" value="http://sf.net" /> <menuitem label="freshmeat" value="http://freshmeat.net"/> </menupopup> </menulist> <iframe id="myframe" flex="1"/> <script> function donav(obj) { var url = obj.selecteditem.value; // note the firstchild is the menupopup element document.getelementbyid('myframe').setattribute('src', url); } </script> attributes showcaret type: boolean whether or not to cause a typing caret to be visible in the content area.
...if this is not set, the loaded document has the same access as the window containing the browser.
...And 3 more matches
toolbox - Archive of obsolete content
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.
...And 3 more matches
XULRunner tips - Archive of obsolete content
xulrunner 1.8.0 does not load extensions from the application directory; only the xulrunner directory and the user profile directory are checked.
...rome://inspector/content/commandoverlay.xul chrome://inspector/content/viewers/dom/commandoverlay.xul to launch dom inspector in your application, you need to open its main window, with a command like this: window.open("chrome://inspector/content/inspector.xul", "", "chrome"); alternatively, the dom inspector may also be added as an extension: (if you already have inspector installed for another application you can skip to the next step) follow the instructions above through "unzip the package." create a file in the extensions directory of your application with the same name as the dom inspector id (inspector@mozilla.org) containing one line of text -- the exact path to the root directory of dom inspector (where the install.rdf is) like this one: /home/username/.mozilla/firefox/n...
... note: i use this method of installing extensions into all of my mozilla applications.
...And 3 more matches
Windows and menus in XULRunner - Archive of obsolete content
although i have not seen it mentioned yet, i am assuming that you can only have one <window> element per xul file.
...</window> notice the references to css and dtd files.
...the dtd is used to create entity references so strings for titles and labels are not stored directly in the xul file; this makes updating the text -- and localization of the application -- much easier.
...And 3 more matches
NPN_PostURL - Archive of obsolete content
data in buffer cannot be posted for a protocol that requires a header.
... if unsuccessful, the plug-in is not loaded and the function returns an error code.
...you cannot use npn_posturl to specify headers (even a blank line) in a memory buffer.
...And 3 more matches
NPStream - Archive of obsolete content
syntax typedef struct _npstream { void* pdata; /* plug-in private data */ void* ndata; /* netscape private data */ const char* url; uint32 end; uint32 lastmodified; void* notifydata; const char *headers; } npstream; fields the data structure has the following fields: plug-in-private value that the plug-in can use to store a pointer to private data associated with the instance; not modified by the browser.
... ndata browser-private value that can store data associated with the instance; should not be modified by the plug-in.
... notifydata used only for streams generated in response to a npn_geturlnotify or npn_posturlnotify request.
...And 3 more matches
Confidentiality, Integrity, and Availability - Archive of obsolete content
such a failure of confidentiality, commonly known as a breach, typically cannot be remedied.
... integrity integrity refers to ensuring the authenticity of information—that information is not altered, and that the source of the information is genuine.
...another example of a failure of integrity is when you try to connect to a website and a malicious attacker between you and the website redirects your traffic to a different website.
...And 3 more matches
Encryption and Decryption - Archive of obsolete content
with most modern cryptography, the ability to keep encrypted information secret is based not on the cryptographic algorithm, which is widely known, but on a number called a key that must be used with the algorithm to produce an encrypted result or to decrypt previously encrypted information.
... implementations of symmetric-key encryption can be highly efficient, so that users do not experience any significant time delay as a result of the encryption and decryption.
... symmetric-key encryption also provides a degree of authentication, since information encrypted with one symmetric key cannot be decrypted with any other symmetric key.
...And 3 more matches
Vulnerabilities - Archive of obsolete content
an example is an input validation error, such as user-provided input not being properly evaluated for malicious character strings and overly long values associated with known attacks.
... another example is a race condition error that allows the attacker to perform a specific action with elevated privileges.
...one of the trust assumptions in the design of the html content rendering feature was that users would not receive malicious hyperlinks and click on them.
...And 3 more matches
Using SSH to connect to CVS - Archive of obsolete content
anonymous/read-only access via ssh is not available at this time.
...once you have entered a passphrase, ssh-keygen will create two files, ~/.ssh/id_dsa and ~/.ssh/id_dsa.pub do not sendid_dsa.
... setting up cvs to use ssh in your system's environment, make sure thatcvs_rsh is set to whatever your ssh binary is called; a full path is not necessary if ssh is already in your path.
...And 3 more matches
Using the W3C DOM - Archive of obsolete content
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.
... unsupported dom-related properties the following ie proprietary document object properties are not supported in the w3c document object model: document.layers[] id_attribute_value document.all document.all.id_attribute_value document.all[id_attribute_value] the following form related properties (originally from internet explorer) are not supported in the w3c document object model: formname.inputname.value inputname.value formctrlname document.forms(0) (note: document.forms[0] (u...
...for example, the following short sample dynamically sets the left margin of a <div> element with an id of "inset" to half an inch: // in the html: <div id="inset">sample text</div> document.getelementbyid("inset").style.marginleft = ".5in"; note: internet explorer 5 through 7 have a flawed implementation of getelementbyid(), which returns the first element with a matching name or id (id versus name when using getelementbyid, msdn: getelementbyid method).
...And 3 more matches
Using workers in extensions - Archive of obsolete content
this demonstrates not only how to use workers in an extension, but also how to perform xmlhttprequest in a worker, and how workers and main thread code can pass data back and forth.
... the refreshinformation() method is fairly similar to the previous versions, with two notable exceptions: if the ticker symbol has not been set yet, an exception is thrown (lines 4-6).
...let's take a look: startup: function() { // register to receive notifications of preference changes this.prefs = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice) .getbranch("stockwatcher2."); this.prefs.queryinterface(components.interfaces.nsiprefbranch2); this.prefs.addobserver("", this, false); this.tickersymbol = this.prefs.getcharpref("symbol").touppercase(); this...
...And 3 more matches
-ms-filter - Archive of obsolete content
warning: not to be confused with the standard filter property, as the two are fundamentally incompatible with each other.
... endcolor the 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.
...And 3 more matches
Date.prototype.toLocaleFormat() - Archive of obsolete content
however, ordering of the day and month and other localization tasks are not handled automatically since you have control over the order in which they occur.
...be aware that the locale used is not necessarily the same as the locale of the browser.
... extension and xulrunner developers should know that just loading the format string from a .dtd or .properties file using a chrome://somedomain/locale/somefile.ext uri should be avoided, as the .dtd/.properties file and the tolocaleformat() method does not not necessarily use the same locale, which could result in odd looking or even ambiguous or unreadable dates.
...And 3 more matches
Object.prototype.watch() - Archive of obsolete content
deprecation warning: do not use watch() and unwatch()!
... if you delete a property for which a watchpoint has been set, that watchpoint does not disappear.
... in firefox, handler is only called from assignments in script, not from native code.
...And 3 more matches
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
this article was written on august 31, 2001; it is not compatible with current versions of firefox.
...it does not cover netscape 6 and 6.01 introduction plugins that used to take advantage of being scriptable via liveconnect in 4.x netscape browsers lost this possibility in the new world.
... how to call plugin native methods the following html code will do the job:</p> this should be changed, we shouldn't advocate embed <embed type="application/plugin-mimetype"> <script language="javascript"> var embed = document.embeds[0]; embed.nativemethod(); </script> how to build and install having the built mozilla tree is probably not necessary, but building the plugin with a scriptable instance interface will require mozilla headers and the xpcom compatible idl compiler -- xpidl.exe.
...And 3 more matches
Introduction to game development for the Web - Game development
the modern web has quickly become a viable platform not only for creating stunning, high quality games, but also for distributing those games.
...with modern web technologies and a recent browser, it's entirely possible to make stunning, top-notch games for the web.
... and we're not talking about simple card games or multi-player social games that have in the olden days been done using flash®.
...And 3 more matches
Game monetization - Game development
the word itself acquired negative connotations after big companies focused on creating games, the main purpose of which was to get as much money from the players as possible instead of delivering a fun experience.
...google adsense is said to be the most effective one, but it's not designed for games and it's a pretty bad practice to use it for that purpose.
...it should be as subtle as possible so as to not annoy the players too much, but visible enough to make them click it or at least take notice.
...And 3 more matches
2D collision detection - Game development
generally you will have a simple generic shape that covers the entity known as a "hitbox" so even though collision may not be pixel perfect, it will look good enough and be performant across multiple entities.
...any gap means a collision does not exist.
... this.color("green"); } else { // no collision this.color("blue"); } }); note: another example without canvas or external libraries.
...And 3 more matches
3D collision detection - Game development
axis-aligned bounding boxes as with 2d collision detection, axis-aligned bounding boxes (aabb) are the quickest algorithm to determine whether the two game entities are overlapping or not.
...if you have entities that will be rotating, you can either modify the dimensions of the bounding box so it still wraps the object, or opt to use another bounding geometry type, such as spheres (which are invariant to rotation.) the animated gif below shows a graphic example of an aabb that adapts its size to fit the rotating entity.
... note: check out the bounding volumes with three.js article to see a practical implementation of this technique.
...And 3 more matches
Building up a basic demo with the PlayCanvas engine - Game development
if you have already worked through our building up a basic demo with three.js article (or you are familiar with other 3d libraries) you'll notice that playcanvas works on similar concepts: camera, light and objects.
... note: an entity is any object used in the scene — it can be an object like a box, cylinder or cone, but it can also be a camera, light or sound source.
... note: the distance values (e.g.
...And 3 more matches
Desktop gamepad controls - Game development
note: please remember that different devices may have different key mappings, i.e.
... the d-pad right button have an index of 3 on the wireless xbox 360, but may have a different one on another device.
...{}, disconnect: function(event) {}, update: function() {}, buttons: { layout: [], cache: [], status: [], pressed: function(button, state) {} } axes: { status: [] } }; the controller variable stores the information about the connected gamepad, and there's an active boolean variable we can use to know if the controller is connected or not.
...And 3 more matches
Desktop mouse and keyboard controls - Game development
note: the captain rogers: battle at andromeda is built with phaser and managing the controls is phaser-based, but it could also be done in pure javascript.
...to do that we'll hold the information on whether the keys we are interested in are pressed or not: var rightpressed = false; var leftpressed = false; var uppressed = false; var downpressed = false; then we will listen for the keydown and keyup events and act accordingly in both handler functions.
... we could write our own keycode object containing the key codes, for example: var keyboardhelper = { left: 37, up: 38, right: 39, down: 40 }; that way instead of using the codes to compare the input in the handler functions we could do something like this, which is arguably easier to remember: if(event.keycode == keyboardhelper.left) { leftpressed = true; } note: you can also find a list if the different keycodes and what keys they relate to in the keycode reference page.
...And 3 more matches
Efficient animation for web games - Game development
when you animate position with javascript, the browser cannot easily make that same assumption, and so you might end up causing it to draw only the newly-exposed region of content, which may introduce slow-down.
... use requestanimationframe when you are animating <canvas> content, or when your dom animations absolutely must synchronise with canvas content animations, do make sure to use window.requestanimationframe, and not older methods such as window.settimeout.
... if (progress < animationlength) { requestanimationframe(doanimation); } } // start animation requestanimationframe(doanimation); you will note that we set starttime to -1 at the beginning, when we could just as easily have set the time using the date() object and avoided the extra code in the animation callback.
...And 3 more matches
2D maze game with device orientation - Game development
if there's nothing specified in that last argument or the element is not found, the canvas will be added to the <body> tag.
... note: you can read the building monster wants candy article for the in-depth introduction to the basic phaser-specific functions and methods.
...in particular, take note of the update() function (executed at every frame), which updates things such as the ball position.
...And 3 more matches
Multiple-column layout - Learn web development
this means that you will not get exactly the width that you specify, unless your container is exactly divisible by that width.
...cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div> .container { column-width: 200px; } styling the columns the columns created by multicol cannot be styled individually.
...cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div> something to take note of is that the rule does not take up any width of its own.
...And 3 more matches
Normal Flow - Learn web development
previous overview: css layout next this article explains normal flow, or the way that webpage elements lay themselves out if you have not changed their layout.
... as detailed in the last lesson introducing layout, elements on a webpage lay out in the normal flow, if you have not applied any css to change the way they behave.
...if you want to control the size of an inline element in this manner, you need to set it to behave like a block level element with display: block; (or even,display: inline-block; which mixes characteristics from both.) that explains individual elements, but what about how elements interact with one another?
...And 3 more matches
create fancy boxes - Learn web development
it's also a good idea, but not a prerequisite, to be familiar with some css layout basics.
...it will not be done in one day, and some web developers spend their whole life having fun with it.
... if it's not a square, we'll get an ellipsis rather than a circle ;) */ width : 4em; height : 4em; /* and let's turn the square into a circle */ border-radius: 100%; } yes, we get a circle: backgrounds when we talk about a fancy box, the core properties to handle that are background-* properties.
...And 3 more matches
How much does it cost to do something on the Web? - Learn web development
summary when launching a website, you may spend nothing, or your costs may go through the roof.
... software text editors you likely have a text editor: such as, notepad on windows, gedit on linux, textedit on mac.
... price does not reliably reflect a text editor's quality or usefulness.
...And 3 more matches
How do I start to design my website? - Learn web development
yes, it seems obvious, but too many projects fail not from a lack of technical know-how, but from lack of goals and vision.
... note: there are countless ways to carry out project ideation.
... we cannot lay them all out here (a whole book wouldn't be enough).
...And 3 more matches
What are hyperlinks? - Learn web development
before the web, it was quite hard to access documents and move from one to another.
... deeper dive as we said, a link is a text string tied to a url, and we use links to allow easy jumping from one document to another.
...note that you don't have to link back when someone links to your site.
...And 3 more matches
Define terms with HTML - Learn web development
we do that in html too, except html is not a visual medium and so we don't use bold.
...note that <dfn> tags go around the word to be defined, not the definition (the definition consists of the entire paragraph): <p><dfn>firefox</dfn> is the web browser created by the mozilla foundation.</p> another use for bold is to emphasize content.
...however, this is not an acceptable alternative for providing an inline expansion.
...And 3 more matches
Function return values - Learn web development
you've already met return values a number of times, although you may not have thought about them explicitly.
... let's return to a familiar example (from a previous article in this series): let mytext = 'the weather is cold'; let newstring = mytext.replace('cold', 'warm'); console.log(newstring); // should print "the weather is warm" // the replace() string function takes a string, // replaces one substring with another, and returns // a new string with the replacement made the replace() function is invoked on the mytext string, and is passed two parameters: the substring to find ('cold').
...if the entered value is not a number, an error message is printed to the paragraph.
...And 3 more matches
Object building practice - Learn web development
note that we are chaining multiple assignments together, to get the variables all set quicker — this is perfectly ok.
... last but not least, add the following line to the bottom of your code — we need to call the function once to get the animation started.
... adding collision detection now for a bit of fun, let's add some collision detection to our program, so our balls know when they have hit another ball.
...And 3 more matches
Test your skills: Object basics - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... note: in the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
... object basics 1 in this task you are provided with an object literal, and your tasks are to store the value of the name property inside the catname variable, using bracket notation.
...And 3 more matches
Properly configuring server MIME types - Learn web development
this article may contain out of date information, as it has not been significantly updated in many years.
... serving content using the correct mime type can also be important for security reasons; it's possible for malicious content to affect the user's computer by pretending to be a safe type of document when it is in fact not.
... note: historically, firefox has loaded css files even if they had the wrong mime type, as long as the html document that requested them was being processed in quirks mode.
...And 3 more matches
omni.ja (formerly omni.jar)
note: starting with firefox 10 and thunderbird 10, the file extension .ja is used because windows system restore does not back up files with the .jar extension, but it does back up .ja files.
... inspecting and repacking omni.ja note: when extracting omni.ja, you may incorrectly get false warnings from some virus protection software.
... several unzip tools and archives (except for the latest version of 7-zip) currently cannot read omni.ja, due to the optimization that is applied to the file.
...And 3 more matches
Adding a new event
it's not a dom event.
...this is useful for widget notifying dom tree of something or retrieving something from dom tree.
... please note that aname must not be same as other event classes even if aprefix is different.
...And 3 more matches
Browser chrome tests
note: be careful when naming your functions and variables.
...notice that any function call in head.js main scope will run before the main test() method.
...be aware that this is not a solution; you should investigate why your test is taking so long, since it's most likely due to a bad test design or a performance problem.
...And 3 more matches
Reviewer Checklist
the patch is not unnecessarily complicated.
... the patch does not add duplicates of existing code ('almost duplicates' could mean a refactor is needed).
... remove debug logging that is not needed in production.
...And 3 more matches
Frame script environment
in particular, note that a frame script accesses the dom window using content, not window: // frame script var links = content.document.getelementsbytagname("a"); all the frame scripts running in a tab share this global.
... however, any top-level variables defined by a script are not stored on the global: instead, top-level variables are stored in a special per-script object that delegates to the per-tab global.
... this means you don't have to worry about global variables you define conflicting with global variables defined by another frame script.
...And 3 more matches
mozbrowserasyncscroll
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.
... bubbles read only boolean whether the event normally bubbles or not.
...And 3 more matches
mozbrowsercaretstatechanged
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.
... bubbles read only boolean whether the event normally bubbles or not.
...And 3 more matches
mozbrowserlocationchange
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.
... bubbles read only boolean whether the event normally bubbles or not.
...And 3 more matches
Script security
the rules for determining whether an object is same-origin with another, and what access is allowed cross-origin, are now mostly standardized across browsers.
... having the browser front end in javascript has benefits: it can be much quicker to develop in javascript than in c++, and contributors do not need to learn c++.
... when objects share an origin but not a global - for example two web pages from the same protocol, port, and domain - they belong to two different compartments, and the caller gets a transparent wrapper to the target object.
...And 3 more matches
How to get a stacktrace for a bug report
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.
... note: when filing a crash report, it is important to know whether the crash occurs with firefox safe mode.
... the "details" button gives additional data about the incident, however this is not useful in a bug report.
...And 3 more matches
DownloadSummary
for downloads that do not have a known final size, the number of bytes currently transferred is reported as part of this property.
... note: this method is already called internally by the downloads.getsummary() function.
...addview() adds a view that will be notified of changes to the summary.
...And 3 more matches
OS.File.Info
uccess(info) { // |info| is an instance of |os.file.info| if (info.isdir) { // |somepath| represents a directory } else if (info.issymlink) { // |somepath| represents a symbolic link } else { // |somepath| represents a regular file } }, function onfailure(reason) { if (reason instanceof os.file.error && reason.becausenosuchfile) { // |somepath| does not represent anything } else { // some other error } } ) example: determining the owner of a file let promise = os.file.stat() promise.then( function onsuccess(info) { if ("unixowner" in info) { // info.unixowner holds the owner of the file } else { // information is not available on this platform } } ); evolution of this example bug 802534 wil...
...on older unix filesystems it is not possible to get a creation date as it was never stored, on new unix filesystems creation date is stored but the method to obtain this date differs per filesystem, bugzilla :: bug 1167143 explores implementing solutions for all these different filesystems) lastaccessdate the date at which the file was last accessed, as a javascript date object.
... note that the definition of last access may depend on the underlying operating system and file system.
...And 3 more matches
PerfMeasurement.jsm
note: the perfmeasurement.jsm javascript code module can only be used from chrome -- that is, from within the application itself or an add-on.
...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.
...any measurable event that was not being recorded has a value of -1 (that is, 0xffffffffffffffff).
...And 3 more matches
SourceMap.jsm
and an object is returned with the following properties: source: the original source file, or null if this information is not available.
... line: the line number in the original source, or null if this information is not available.
... column: the column number in the original source, or null if this information is not available.
...And 3 more matches
Task.jsm
you can use the yield operator inside the generator function to wait on a promise, spawn another task, or propagate a value: let resolutionvalue = yield (promise/generator/iterator/value); if you specify a promise, the yield operator returns its resolution value as soon as the promise is resolved.
... if you specify a function that is not a generator, it is called with no arguments, and the yield operator returns the return value of the function.
... this comes in handy when iterating over function lists where some items have been converted to tasks and some not.
...And 3 more matches
Index
found 42 pages: # page tags and summary 1 localization at mozilla landing, localization, mozilla, translation, l10n localization (l10n) is the process of translating software user interfaces from one language to another and adapting it to suit a foreign culture.
... 10 localization notes guide, internationalization, localization, mozilla localizers usually work on the localizable files without the context of the source files including the localized strings; it is important to add comments to the localizable files themselves, too.
... these comments are generally referred to as localization notes.
...And 3 more matches
Localizing with Mercurial
this will not only install hg, but also all the tools required to build mozilla products on windows.
... note the dot (".") at the end of the second command, which means the current directory.
... comm-central contains the files for seamonkey and thunderbird which are not already part of firefox.
...And 3 more matches
Release phase
the hg outgoing command compares the two repositories and lists all changesets that are present locally, but not in the remote repository.
... if you don't see this message, try running the same command in a more verbose mode (with the debugging information): $ ssh -vvv hg.mozilla.org this should tell you why your connection is not succeeding.
... focus is on technical accuracy and completion of l10n work; not translation quality.
...And 3 more matches
mozilla::CondVar
wait() nsresult wait( in printervaltime interval = pr_interval_no_timeout ); wait on this condvar until it is notifyed.
... notify() nsresult notify(void); notify one thread waiting on this condvar.
... notifyall() nsresult notifyall(void); notify all threads waiting on this condvar.
...And 3 more matches
mozilla::Monitor
wait() nsresult wait( in printervaltime interval = pr_interval_no_timeout ); wait on this monitor until it is notifyed.
... notify() nsresult notify(void); notify one thread waiting on this monitor.
... notifyall() nsresult notifyall(void); notify all threads waiting on this monitor.
...And 3 more matches
Leak-hunting strategies and tips
strategy for finding leaks when trying to make a particular testcase not leak, i recommend focusing first on the largest object graphs (since these entrain many smaller objects), then on smaller reference-counted object graphs, and then on any remaining individual objects or small object graphs that don't entrain other objects.
... a good general pattern for finding and fixing leaks is to start with a task that you want not to leak (for example, reading email).
...(when i refer to the size of a graph of objects, i'm referring to the number of objects, not the size in bytes.
...And 3 more matches
Power profiling overview
note: the acpi standard specifies four states, c0, c1, c2 and c3.
... the other thing to note about c-states is that they apply both to cores and the entire package — i.e.
... pp1: an uncore device, usually the gpu (not available on all processor models.) dram: main memory (not available on all processor models.) the following relationship holds: pp0 + pp1 <= pkg.
...And 3 more matches
Scroll-linked effects
below are a couple of examples of effects that would not work well with asynchronous scrolling, along with equivalent versions that would work well: example 1: sticky positioning here is an implementation of a sticky-positioning effect, where the "toolbar" div will stick to the top of the screen as you scroll down.
...therefore, with asynchronous scrolling, the event handler will be delayed relative to the user-visible scroll, and so the div will not stay visually fixed as intended.
...therefore, the animation can end up looking janky and not as smooth as intended.
...And 3 more matches
TraceMalloc
if filename is -, nothing is written to a file, but tracemalloc will be active and will track live allocations and their stack traces.
...the output is a large html file that hyperlinks ancestor and descendent libraries, classes, and functions that call into one another, attributing malloc blame up and down each graph.
... tracemalloclogtimestamp(caption) - log a timestamp event to the current log file, annotating the log even with the caption string.
...And 3 more matches
Firefox Sync
mozilla does not hold any keys to your sync data.
...it is not designed for use by end-users, but instead for people who wish to understand the details of how sync is implemented or wish to interact with it.
... general the always prolific richard newman has written a couple of notes about bookmark syncing (first, second) and has a blog where he talks about the various challenges syncing this kind of data.
...And 3 more matches
McCoy
mozilla calls mccoy a "simple system" which is a clear sign that something probably is not working, and indeed, is not.
...it's important that the update information retrieved has not been tampered with since being written by the add-on author.
...it will not run on older versions of linux and there are known problems even on up to date systems.
...And 3 more matches
Midas editor module security preferences
this functionality is completely removed since 2013-12-14 18:23 pst, see: bugs 38966 and 913734 note: if you've reached this page from a message box in firefox or another mozilla product, try using keyboard shortcuts for the cut, copy, and paste commands: copy: ctrl+c or ctrl+insert (command+c on mac) paste: ctrl+v or shift+insert (command+v on mac) cut: ctrl+x or shift+delete (command+x on mac) the information on the rest of this page is for web developers and advanced users.
... please do not try to modify this page.
... to protect users' private information, unprivileged scripts cannot invoke the cut, copy, and paste commands in midas, which is mozilla's rich text editor component.
...And 3 more matches
NSPR Poll Method
this technical note documents the poll method of prfiledesc.
... the poll method is not to be confused with the pr_poll function.
...the nspr library provides a reference implementation of the bottom layer using the sockets api, but you can provide your own implementation of the bottom layer using another network transport api.
...And 3 more matches
PR_Open
if the flags parameter does not include any of the first three flags (pr_rdonly, pr_wronly, or pr_rdwr), the open file can't be read or written, which is not useful.
... note: the constants pr_rdwr and friends are not in any interface (bug 433295).
... thus they cannot be used in javascript, you have to use the octal constants (see file i/o snippets).
...And 3 more matches
FC_GetTokenInfo
on return, the ck_token_info structure that pinfo points to has the following information: label: the label of the token, assigned during token initialization, padded with spaces to 32 bytes and not null-terminated.
... manufacturerid: id of the device manufacturer, "mozilla foundation", padded with spaces to 32 characters and not null-terminated.
... model: model of the device, "nss 3", padded with spaces to 16 characters and not null-terminated.
...And 3 more matches
NSS functions
the deprecated functions are not supported by the new ssl shared libraries.
...d later cert_decodegeneralname mxr 3.4 and later cert_decodenameconstraintsextension mxr 3.10 and later cert_decodeocspresponse mxr 3.6 and later cert_decodeoidsequence mxr 3.2 and later cert_decodeprivkeyusageperiodextension mxr 3.10 and later cert_decodetruststring mxr 3.4 and later cert_decodeusernotice mxr 3.2 and later cert_dernametoascii mxr 3.4 and later cert_destroycertarray mxr 3.2 and later cert_destroycertificate mxr 3.2 and later cert_destroycertificatelist mxr 3.2 and later cert_destroycertificatepoliciesextension mxr 3.2 and later cert_destroycertificaterequest mxr 3.2 and later ...
... cert_destroycertlist mxr 3.2 and later cert_destroyname mxr 3.2 and later cert_destroyocspcertid mxr 3.6 and later cert_destroyocsprequest mxr 3.6 and later cert_destroyocspresponse mxr 3.7 and later cert_destroyoidsequence mxr 3.9 and later cert_destroyusernotice mxr 3.10 and later cert_destroyvalidity mxr 3.5 and later cert_dupcertificate mxr 3.2 and later cert_dupcertlist mxr 3.2 and later cert_enableocspchecking mxr 3.2 and later cert_encodealtnameextension mxr 3.7 and later cert_encodeandaddbitstrextension mxr 3.5 and later cert_encodeauthkeyid mxr 3.5 and later cert_encodebasicco...
...And 3 more matches
NSS tools : crlutil
changing the names of the certificate and key databases is not recommended.
...if options -m|-g is used and -c crl-script-file is not specified, crlutil will read script data from standard input.
...if this argument is not used the output destination defaults to standard output.
...And 3 more matches
sslcrt.html
pr_false means certificate signatures will not be checked.
... if the common name in the subject dn for the certificate is not identical to the domain name passed in the hostname parameter, secfailure.
... description the comparison performed by cert_verifycertname is not a simple string comparison.
...And 3 more matches
NSS Tools crlutil
availability see the release notes for the platforms this tool is available on.
...changing the names of the certificate and key databases is not recommended.
...if options -m|-g is used and -c crl-script-file is not specified, crlutil will read script data from standard input.
...And 3 more matches
Tutorial: Embedding Rhino
here's an example use of runscript from a shell command line: $ java runscript "math.cos(math.pi)" -1 $ java runscript "function f(x){return x+1} f(7)" 8 note that you'll have to have both the rhino classes and the runscript example class file in the classpath.
... collecting the arguments this code is standard java and not specific to rhino.
...for example, $ java runscript3 "x = 7" x = 7 f is undefined or not a function.
...And 3 more matches
Rhino JavaScript compiler
the resulting java class files can then be loaded and executed at another time, providing a convenient method for transferring javascript, and for avoiding translation cost.
... note that the top-level functions available to the shell (such as print) are not available to compiled scripts when they are run outside the shell.
...may not be combined with optimization at an optlevel greater than zero.
...And 3 more matches
Rebranding SpiderMonkey (1.8.5)
for example: ../configure --enable-ctypes --with-system-nspr note: your desired configuration may be different.
...in the unix world we would issue the following command: find ./ -type f -exec sed -i "s/mozjs185/$brand/" {} \; windows users: notepad++ can be used to perform the recursive find and replace text operation.
... "scroll down" a few lines until you see this line: > $@ && chmod 644 $@ that line should be modified to read back: > $brand.pc && chmod 644 $brand.pc "scroll down" a few lines until you see these lines: install:: $(pkg_config_files) @echo pkg_config_file: $(pkg_config_files) those two lines should be modified to read back: install:: $brand.pc @echo pkg_config_file: $brand.pc note: while it is possible to automate the manual editing process, this has been discouraged due to the fact that these files are automatically generated and very little constant data can be depended upon.
...And 3 more matches
Creating JavaScript tests
jit-tests do not load extra test functionality automatically.
...if they're not, throw an exception (which will cause the test to fail).
... performance testing and general advice do not attempt to test the performance of engine features in the test suite.
...And 3 more matches
JS::CompileOptions
to counter this attack, html5 specifies that script errors should be sanitized ("muted") when the script is not same-origin with the global for which it is loaded.
...(note that one may assign both strings and functions to dom elements' event handler idl attributes.
... if one assigns a function, that function's script's source does not belong to the dom element; the function's definition must appear elsewhere.) jsstring *elementattributename() const if this source belongs to a dom element because it is an event handler content attribute or an event handler idl attribute, this returns the name of that attribute, a string.
...And 3 more matches
JSObjectOps.dropProperty
jsobjectops is not a supported api.
...this documentation should be considered spidermonkey internals documentation, not api documentation.
...it may not otherwise call into the jsapi in ways that might trigger other property accesses.
...And 3 more matches
JSPropertyOp
the callback does not need to call js_beginrequest()).
... if a jspropertyop or jsstrictpropertyop does nothing and returns true, then property get, set, or add is unaffected.
...note that in javascript, an object can inherit properties from its prototype.
...And 3 more matches
JS_AliasProperty
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.
...creating an alias does not change the length of the property array.
...And 3 more matches
JS_ClearContextThread
transfer a jscontext from one thread to another.
... syntax jsword js_clearcontextthread(jscontext *cx); jsword js_setcontextthread(jscontext *cx); name type description cx jscontext * the context to transfer from one thread to another.
... there must not be any active or suspended requests using this context.
...And 3 more matches
JS_InitClass
this must not be null.
... unlike other jsnatives, this function must not call js_this or js_this_object.
...the jsclass is an internal data structure that is not exposed outside the javascript engine.
...And 3 more matches
JS_SetGCCallback
but even if the callback returns true, the garbage collector may determine that gc is not necessary, in which case the other three callbacks are skipped.
...the callback may use js_isabouttobefinalized to clean up weak references to js objects (that is, pointers that are not traced by the gc).
...sometimes jsgc_begin happens and the rest of garbage collection does not happen, so the other three callbacks are not called.
...And 3 more matches
Gecko states
state_checked the object is checked state_mixed indicates that the state of a three-state check box or toolbar button is not determined.
... state_busy the control cannot accept input at this time.
... state_floating children "owned" not "contained" by parent state_checkable indicates scrolling or moving text or graphics.
...And 3 more matches
AT APIs Support
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.
... on mac platform camino - web browser for os x xul applications xul applications make full use of the gecko architecture, not only for html content, but also for the entire user interface.
...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.
...And 3 more matches
extIPreferenceBranch
boolean has(in astring aname) parameters aname the name of preference return value true if the preference exists, false if not get() gets an object representing a preference extipreference get(in astring aname) parameters aname the name of preference return value a preference object, or null if the preference does not exist getvalue() gets the value of a preference.
... returns a default value if the preference does not exist.
... this will be passed back to you without any processing and can be something which would not be valid as a preference.
...And 3 more matches
XPCOM hashtable guide
also note that mfbt/hashtable.h now exists.
... unsorted: stored unsorted; cannot be iterated over in a sorted manner.
... some: hashtables are not packed structures; depending on the implementation, there may be significant wasted memory.
...And 3 more matches
XPCOM Stream Guide
MozillaTechXPCOMGuideStreams
it is not that sequence of characters, though: the characters may not all be available when you read from the stream.
... using streams in c++ using streams in javascript input streams input streams are not scriptable - you cannot directly call .read() on them, for example.
...mponents.interfaces.nsistoragestream) .getoutputstream(); var instream = components.classes["@mozilla.org/io/string-input-stream;1"] .createinstance(components.interfaces.nsistringinputstream); var data = "hello world"; instream.setdata(data, data.length); while (instream.available()) { outstream.writefrom(instream, instream.available()); } note this is an inefficient example: the only important part is how to feed the output stream.
...And 3 more matches
How to build a binary XPCOM component using Visual Studio
not the simplest thing to do and it may be incompatible with production releases of firefox, thunderbird, and xulrunner from mozilla.
... note: wintools.zip seems old and lots of newer mdc documentation refers to moztools.zip archive, but the version of xpidl.exe that comes with the gecko-sdk crashes with the dll’s from moztools.
... recap: use the right gecko sdk for your xulrunner release use a microsoft compiler use pre-built glib-1.2.dll & libidl-0.6.dll libraries from wintools.zip download the sample project here is what the folder structure looks like: create a vc++ project visual studio project and file templates (or wizards) for creating xpcom modules and components do not currently exist.
...And 3 more matches
Components.isSuccessCode
note: a non-zero xpcom return code (that is, not ns_ok) does not necessarily indicate failure.
... components.issuccesscode() is functionally equivalent to the following javascript: function issuccesscode(returncode) { return (returncode & 0x80000000) === 0; } since failure error codes are turned into exceptions when encountered in javascript, this function usually is not necessary.
...for example, if you ask a component or service to asynchronously perform some task, you must usually pass in an object which will be notified when the task is completed.
...And 3 more matches
IAccessibleAction
other-licenses/ia2/accessibleaction.idlnot scriptable this interface gives access to actions that can be executed for accessible objects.
...s_false if there is nothing to return, [out] value is null.
...since these key sequences are to be used when the object has focus, they are like mnemonics (access keys), and not like shortcut (accelerator) keys.
...And 3 more matches
mozIPersonalDictionary
note that this method is not currently implemented.
...note that this parameter is currently unused.
...note that this parameter is currently ignored.
...And 3 more matches
mozIRegistry
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.
...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.
... there's another component that turns out to also be real important when you go to hook up your code with other mozilla components.
...And 3 more matches
nsIAccessibleSelectable
if the specified object is already selected, then it does nothing.
... exceptions thrown ns_error_failure if the specified object is not selectable.
... return value true if the child is selected, false if not.
...And 3 more matches
nsIArray
the convention is that the elements of the array should not be modified.
...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.
...null is a valid entry in the array, and as such any nsisupports parameters may be null, except where noted.
...And 3 more matches
nsIAuthInformation
if the protocol for this authentication does not support schemes, this will be the empty string.
...auth prompts should ignore flags they do not understand; especially, they should not throw an exception because of an unsupported flag.
...the password should not be shown in clear.
...And 3 more matches
nsICharsetResolver
inherits from: nsisupports last changed in gecko 1.7 method overview void notifyresolvedcharset(in acstring charset, in nsisupports closure); acstring requestcharset(in nsiwebnavigation awebnavigation, in nsichannel achannel, out boolean awantcharset, out nsisupports aclosure); methods notifyresolvedcharset() some implementations may request that they be notified when the charset is actually detected.
... void notifyresolvedcharset( in acstring charset, in nsisupports closure ); parameters charset the detected charset.
...if the charset cannot be resolved, but the implementation of nsicharsetresolver wants to be notified of the final resolved charset when one is available, it can set awantcharset to true.
...And 3 more matches
nsICompositionStringSynthesizer
this means that the clause is not converted.
... attr_selectedrawtext 0x03 a clause attribute but this is typically not used.
... this means that the clause is not converted but selected to convert or modify.
...And 3 more matches
nsIConsoleService
note: see the code samples below for how to call getmessagearray.
... registerlistener() registers a listener, to notify when an error is logged.
... note: to guard against stack overflows from listeners which could log messages (this could be done inadvertently through listeners implemented in javascript), we do not call any listeners when another error is already being logged.
...And 3 more matches
nsICookieManager2
'.foo.com', not '.com'), otherwise an exception will be thrown.
... cookieexists() returns whether or not a matching cookie already exists.
...therefore, if the specified host is "weather.yahoo.com", host or domain cookies for "weather.yahoo.com" and "yahoo.com" would both be counted, while a cookie for "my.weather.yahoo.com" would not.
...And 3 more matches
nsIEnvironment
an empty string will be returned when the env variable does not exist or when the value itself is an empty string - please use exists() to probe whether the env variable exists or not.
...this method checks whether an environment variable is present in the environment or not.
... note: * for unix/linux platforms we follow the unix definition: an environment variable exists when getenv() returns a non-null value.
...And 3 more matches
nsIFocusManager
constants constant value description flag_raise 1 flag_noscroll 2 do not scroll the element to focus into view.
... flag_noswitchframe 4 if attempting to change focus in a window that is not focused, do not switch focus to that window.
...this is similar to a normal focus except that the widget focus is not changed.
...And 3 more matches
nsILivemarkService
you can also use this check whether something is a livemark or not.
... ns_error_malformed_uri if the site uri annotation has somehow been corrupted (and can't be turned into an nsiuri) getlivemarkidforfeeduri() determines whether the feed uri is a currently registered livemark.
... ns_error_malformed_uri if the site uri annotation has somehow been corrupted (and can't be turned into an nsiuri) islivemark() this method determines whether the folder with the given folder id identifies a livemark container.
...And 3 more matches
nsILoadGroup
if the default load request is null, then the group's load flags are not changed.
... groupobserver nsirequestobserver the group observer is notified when requests are added to and removed from this load group.
... notificationcallbacks nsiinterfacerequestor notification callbacks for the load group.
...And 3 more matches
nsIMsgSearchSession
endterm(searchterm); searchsession.search(null); inherits from: nsisupports method overview void addsearchterm(in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, in boolean booleanand, in string arbitraryheader); nsimsgsearchterm createterm(); void appendterm(in nsimsgsearchterm term); void registerlistener(in nsimsgsearchnotify listener); void unregisterlistener(in nsimsgsearchnotify listener); void getnthsearchterm(in long whichterm, in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value); long countsearchscopes(); void getnthsearchscope(in long which,out nsmsgsearchscopevalue scopeid, out nsimsgfolder folder); void addscopeterm(in nsmsgsea...
...hdr(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 booleanor 0 booleanand 1 methods addsearchterm() void addsearchterm(in nsmsgsearchattribvalue attrib, in nsmsgsearchopval...
... void registerlistener(in nsimsgsearchnotify listener); parameters listener unregisterlistener() removes a listener from the search session.
...And 3 more matches
nsIMsgWindow
you should not store this in a global variable.
... notificationcallbacks nsiinterfacerequestor these are currently used to set notification callbacks on protocol channels to handle things like bad cert exceptions.
...void displayhtmlinmessagepane(in astring title, in astring body, in boolean clearmsghdr); parameters title not used.
...And 3 more matches
nsIPipe
segmentallocator pass reference to nsimemory to have all pipe allocations use this allocator (pass null to use the default allocator) remarks the reader and writer of a pipe do not have to be on the same thread.
...recall that a non-blocking stream will return ns_base_stream_would_block if it cannot be read or written to without blocking the calling thread.
... for example, if you try to read from an empty pipe that has not 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.
...And 3 more matches
nsISHistory
requestedindex long the index of the last document that started to load that is not yet finished loading.
...listeners are notified when pages are loaded or purged from history.
... note: a listener object must implement nsishistorylistener and nssupportsweakreference.
...And 3 more matches
nsISelectionController
if not set, posts a request which is processed at some point after the method returns.
... return value true if visible, false if not.
...if not will scroll right.
...And 3 more matches
nsISupports proxies
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.
...for instance, if you need to not only use an object remotely, but also have it created remotely, use the second api.
...if this flag is not specified, the proxy object manager will compare the eventq which you pass to the eventq which is on the current thread.
...And 3 more matches
nsITaskbarPreview
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 not directly instantiate this interface.
...method overview void invalidate(); attributes attribute type description active boolean indicates whether or not the preview is marked as active (currently selected) in the taskbar.
...the controller is not allowed to be null.
...And 3 more matches
nsIThreadPool
listener nsithreadpoollistener an optional listener that will be notified when a thread is created or destroyed in the course of the thread pool's operation.
... a listener will only receive notifications about threads created after the listener is set so it is recommended that the consumer set the listener before dispatching the first event.
... a listener that receives an nsithreadpoollistener.onthreadcreated() notification is guaranteed to always receive the corresponding nsithreadpoollistener.onthreadshuttingdown() notification.
...And 3 more matches
nsITreeBoxObject
focused boolean whether or not we are currently focused.
... width the width of the element height the height of the element iscellcropped() determine if the text of a cell is being cropped or not.
... boolean iscellcropped(in long row, in nsitreecolumn col); parameters row the index of the row col the nsitreecolumn rowcountchanged() notify the tree that the number of rows changed.
...And 3 more matches
nsIWebSocketChannel
notificationcallbacks nsiinterfacerequestor the notification callbacks for authorization and so forth.
... status code name description 0-999 reserved and not used.
... 1003 close_unsupported 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).
...And 3 more matches
nsIXmlRpcClient
coding(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 server was unreachable or not yet contacted.
...null if the server was unreachable or not yet contacted.
...And 3 more matches
nsMsgFolderFlagType
const nsmsgfolderflagtype mail = 0x00000004; /** @} */ /** whether this is a directory: newshosts are always directories; * newsgroups can be directories if we are in ``show all groups'' mode; * mail folders will have this bit if they are really directories, not files.
... * (note that directories may have zero children.) */ const nsmsgfolderflagtype directory = 0x00000008; /** whether the children of this folder are currently hidden in the listing.
... */ const nsmsgfolderflagtype elided = 0x00000010; /// whether this is a virtual search folder const nsmsgfolderflagtype virtual = 0x00000020; /** @name news folder flags * these flags only occur in folders which have * the nsmsgfolderflags::newsgroup bit set, and do * not have the nsmsgfolderflags::directory or * nsmsgfolderflags::elided bits set.
...And 3 more matches
Working with Multiple Versions of Interfaces
the problem in this short note we illustrate how one can update an xpcom module in order for it to work in both firefox 2 and firefox 3, even if the interfaces have changed in the interim.
... in the extension that prompted this note, i needed to obtain the hwnd of the document (yes its on windows) in order to identify each particular extension instance.
...the bad news is that the thing we get back is not a valid hwnd.
...And 3 more matches
XUL Overlays
MozillaTechXULOverlays
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.
...if you are developing a mozilla extension, note that the id namespace is shared by all the extensions.
...when the component is not present, only the base files are loaded.
...And 3 more matches
Autoconfiguration in Thunderbird
author: ben bucksch please do not change this document without consulting the author thunderbird 3.1 and later (and 3.0 to some degree) includes mail account autoconfiguration functionality.
... it was added because we cannot assume that all big isps (including microsoft) will set up a configuration server for thunderbird.
...for more complicated setups, for example when the login name does not appear in the email address, the xml file can also be generated by the isp.
...And 3 more matches
Buddy icons in mail
(see this document for info about that.) for the addressbook card pane, the icon will show is on disk at: <profile home>/nim/<value of pref aim.session.screenname>/picture/<screenname for card>.gif if aim.session.screenname is not set, the icon will not appear.
... if there is no card matching the email, the icon will not appear.
... if there is a card, but no screenname, the icon will not appear.
...And 3 more matches
Main Windows
some of the code was written based off of early firefox code, but is not exactly the same.
...the rest is loaded from overlays: mailwindowoverlay.xul this is the red sections shown in the interface above (where?), including the toolbars, notification bars, and the status bar, but also includes most of the commands, keysets, and context menus of thunderbird, along with a whole lot of javascript.
... mailwindowoverlay.xul this is the red sections shown in the interface above, including the toolbars, notification bars and the status bar.it also includes most of the commands, keysets, and context menus of thunderbird, along with a whole lot of javascript.
...And 3 more matches
Creating a Custom Column
getting started in this example we will be developing a small extension that will be adding a column that will display the "reply-to:" field of an email (if it exists, it if often not set).
...to attach our column we add another treecol tag ("colreplyto") with the settings that we would like to use.
...note that an object that implements this interface can also take control of an existing, built-in column, but more about that later.
...And 3 more matches
Styling the Folder Pane
hasunreadmessages-true afolder.getnumunread(false) > 0 indicates that the folder (but not subfolders) has unread messages.
... biffstate-biffstate afolder.biffstate == nsimsgfolder.nsmsgbiffstate_<name> indicates whether or not the folder has new messages.
... issecure-{true, false} afolder.server.issecure indicates whether or not the connection to the server will be secure.
...And 3 more matches
ArrayType
ctype arraytype() type[ length] ); parameters type: it represents the type of the elements or variable which is going to be present in an array length optional it denotes the number of entries present in an array or the number of elements that an array should contain.
... exceptions thrown typeerror type is not a ctype, or type.size is undefined.if the length is specifed but if it is not a valid one,then it is also thrown rangeerror the size of the resulting array can't be represented as both a size_t and as a javascript number.
... note: ctypes.void_t.size is undefined.
...And 3 more matches
PKCS #11 Netscape Trust Objects - Network Security Services
it does not specify a way to store trust objects.
...this is not a new design, but documentation of the method already in use.
...conceptually a trust object contains the following: certificate reference purpose + level of trust (multiple) purpose + level of trust a trust object ultimately denotes a level of trust in a certificate.
...And 3 more matches
Blocking By Domain - Plugins
effects of plugin blocking once a site is included in plugin blocking, it is not possible for that site or any subframes within that site to use plugins.
... any attempt to use a plugin (via the <object> or <embed> element) will behave as if the plugin was not installed, and use fallback content as specified by the html standard.
... plugin detection mechanisms such as navigator.mimetypes and navigator.plugins will also behave as if the plugin were not installed.
...And 3 more matches
Initialization and Destruction - Plugins
plug-ins consume no resources, other than disk space, if not referenced.
... no plug-in api calls can take place in either direction until the initialization completes successfully, with the exception of the functions np_initialize and np_shutdown, which are not in the function tables.
... you should not perform any graphics operations in npp_destroy because the instance window is no longer guaranteed to be valid.
...And 3 more matches
DOM Inspector FAQ - Firefox Developer Tools
these can include chrome documents, but it's not suggested that you inspect xul documents by directly inspecting them via url, since some behavior may rely on the document being contained in another xul document, or the converse, where it won't behave correctly because it doesn't expect to be loaded as a framed document.
... these nodes are anonymous content nodes, meaning they are not in the dom generated by the original document.
...note that not all empty text nodes will be hidden.
...And 3 more matches
Debugging service workers - Firefox Developer Tools
if this is not enough to help you figure out the problem, you could also try going to the javascript debugger and stepping through your code to pinpoint exactly where it is going wrong.
... that last time the service worker was updated (if the service has not been updated, this is when it was first installed).
... the server worker’s status, which can be one of the following: stopped: the service worker is installed, but not currently running.
...And 3 more matches
Tutorial: Set a breakpoint - Firefox Developer Tools
it does not work in firefox 57.
... save the following text to an html file: <div onclick="report('the best div');">click me!</div> <div onclick="report('another great div');">or me!</div> <script> function report(what) { console.log('clicked: ' + what); } </script> visit the html file in your browser, and open the browser content toolbox by opening the firefox menu, choosing “web developer”, and then “browser content toolbox”.
... our example code is long enough that the best way to run it is to use the scratchpad panel, which is not enabled by default.
...And 3 more matches
Debugger-API - Firefox Developer Tools
debugger has three essential qualities: it is a source level interface: it operates in terms of the javascript language, not machine language.
...by design, it ought not to introduce security holes, so in principle it could be made available to content as well; but it is hard to justify the security risks of the additional attack surface.
... the debugger api cannot currently observe self-hosted javascript.
...And 3 more matches
Animating CSS properties - Firefox Developer Tools
the performance cost of animating a css property can vary from one property to another, and animating expensive css properties can result in jank as the browser struggles to hit a smooth frame rate.
... however, the performance cost of modifying a css property can vary from one property to another.
...one last step is not shown in this sequence: the page may be split into layers, which are painted independently and then combined in a process called "composition".
...And 3 more matches
Responsive Design Mode - Firefox Developer Tools
note: the device you select when in responsive design mode and the orientation (portrait or landscape) is saved between sessions.
... dpr (pixel ratio) - beginning with firefox 68, the dpr is no longer editable; create a custom device in order to change the dpr throttling - a drop-down list where you can select the connection throttling to apply, for example 2g, 3g, or lte enable/disable touch simulation - toggles whether or not responsive design mode simulates touch events.
...(note that when touch simulation is enabled, this toolbar icon is blue; when simulation is disabled, it is black.
...And 3 more matches
Attr.namespaceURI - Web APIs
WebAPIAttrnamespaceURI
the attr.namespaceuri read-only property returns the namespace uri of the attribute, or null if the element is not in a namespace.
... if (attribute.localname == "value" && attribute.namespaceuri == "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul") { // this is a xul value } notes this is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope.
... per the namespaces in xml specification, an attribute does not inherit its namespace from the element it is attached to.
...And 3 more matches
CSS.registerProperty() - Web APIs
the css.registerproperty() method registers custom properties, allowing for property type checking, default values, and properties that do or do not inherit their value.
... inherits a boolean value defining whether the defined property should be inherited (true), or not (false).
... typeerror the required name and/or inherits dictionary members were not provided.
...And 3 more matches
CSSStyleSheet - Web APIs
for example, one rule might be a cssstylerule object containing a style such as: h1, h2 { font-size: 16pt; } another rule might be an at-rule such as @import or @media, and so forth.
... see the notes section for the various ways a cssstylesheet object can be obtained.
... legacy properties these properties are legacy properties first introduced by microsoft long ago; they shouldn't be used but are not likely to be removed anytime soon.
...And 3 more matches
Using dynamic styling information - Web APIs
note also that, as with individual element's dom styles, when speaking of manipulating the stylesheets, this is not actually manipulating the physical document(s), but merely the internal representation of the document.
...however, this will not affect any other property declarations for that element's styles, such as padding or margin or font, for example.
...</p> <!-- passes the 'p1' id of another element's style to modify.
...And 3 more matches
CanvasRenderingContext2D.drawWindow() - Web APIs
this api cannot be used by web content.
... notes: if "rgba(0,0,0,0)" is used for the background color, the drawing will be transparent wherever the window is transparent.
... top-level browsed documents are usually not transparent because the user's background-color preference is applied, but iframes are transparent if the page doesn't set a background.
...And 3 more matches
CustomElementRegistry.define() - Web APIs
note that custom element names must contain a hyphen.
... 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.
...And 3 more matches
Binary strings - Web APIs
WebAPIDOMStringBinary
a subset of these strings is represented by utf-16 strings containing only ascii characters (i.e., characters whose code point does not exceed 127).
... for instance, the string "hello world!" belongs to the ascii subset, while the string "ÀÈÌÒÙ" does not.
...its purpose however is not to represent characters, but binary data.
...And 3 more matches
DataTransfer.setDragImage() - Web APIs
this image is created automatically, so you do not need to create it yourself.
... if element is an img element, then set the drag data store bitmap to the element's image (at its intrinsic size); otherwise, set the drag data store bitmap to an image generated from the given element (the exact mechanism for doing so is not currently specified).
...note the example refers to an image file named example.gif.
...And 3 more matches
DirectoryReaderSync - Web APIs
this interface has been abandonned: it was on a standard track and it proves not a good idea.
... do not use it anymore.
...but directoryentrysync (as well as fileentrysync) is not a data type that you can pass between a calling app and web worker thread.
...And 3 more matches
Document.createTreeWalker() - Web APIs
since attributes are never children of other nodes, they do not appear when traversing over the document tree.
...since entities are not part of the document tree, they do not appear when traversing over the document tree.
... nodefilter.show_notation 2048 shows notation nodes.
...And 3 more matches
Document.getElementsByTagNameNS() - Web APIs
syntax elements = document.getelementsbytagnamens(namespace, name) elements is a live nodelist (but see the note below) of found elements in the order they appear in the tree.
... note: while the w3c specification says elements is a nodelist, this method returns a htmlcollection both in gecko and internet explorer.
... note: currently parameters in this method are case-sensitive, but they were case-insensitive in firefox 3.5 and before.
...And 3 more matches
Document.querySelector() - Web APIs
note: the matching is done using depth-first pre-order traversal of the document's nodes starting with the first element in the document's markup and iterating through sequential nodes by order of the number of child nodes.
... note: characters that are not part of standard css syntax must be escaped using a backslash character.
... usage notes if the specified selector matches an id that is incorrectly used more than once in the document, the first element with that id is returned.
...And 3 more matches
Element.animate() - Web APIs
WebAPIElementanimate
although this is technically optional, keep in mind that your animation will not run if this value is 0.
...this is primarily of use when sequencing animations based on the end time of another animation.
... you can also include a composite operation or iteration composite operation in your options list: composite optional determines how values are combined between this animation and other, separate animations that do not specify their own specific composite operation.
...And 3 more matches
Element.scrollHeight - Web APIs
the element.scrollheight read-only property is a measurement of the height of an element's content, including content not visible on the screen due to overflow.
...the height is measured in the same way as clientheight: it includes the element's padding, but not its border, margin or horizontal scrollbar (if present).
... element.scrollheight - element.scrolltop === element.clientheight when the container does not scroll, but has overflowing children, these checks determine if the container can scroll: window.getcomputedstyle(element).overflowy === 'visible' window.getcomputedstyle(element).overflowy !== 'hidden' scrollheight demo associated with the onscroll event, this equivalence can be useful to determine whether a user has read a text or not (see also the element.scrolltop and element.clientheight...
...And 3 more matches
Event.composed - Web APIs
WebAPIEventcomposed
the read-only composed property of the event interface returns a boolean which indicates whether or not the event will propagate across the shadow dom boundary into the standard dom.
... note: this property was formerly named scoped.
...most other types of events are not composed, and so will return false.
...And 3 more matches
EventSource - Web APIs
when not used over http/2, sse suffers from a limitation to the maximum number of open connections, which can be specially painful when opening various tabs as the limit is per browser and set to a very low number (6).
...this limit is per browser + domain, so that means that you can open 6 sse connections across all of the tabs to www.example1.com and another 6 sse connections to www.example2.com.
... eventsource.withcredentials read only a boolean indicating whether the eventsource object was instantiated with cross-origin (cors) credentials set (true), or not (false, the default).
...And 3 more matches
EventTarget.removeEventListener() - Web APIs
usecapture optional specifies whether the eventlistener to be removed is registered as a capturing listener or not.
...removal of a capturing listener does not affect a non-capturing version of the same listener, and vice versa.
...; // succeeds element.removeeventlistener("mousedown", handlemousedown, { capture: true }); // fails element.removeeventlistener("mousedown", handlemousedown, { passive: false }); // succeeds element.removeeventlistener("mousedown", handlemousedown, false); // succeeds element.removeeventlistener("mousedown", handlemousedown, true); // fails it's worth noting that some browser releases have been inconsistent on this, and unless you have specific reasons otherwise, it's probably wise to use the same values used for the call to addeventlistener() when calling removeeventlistener().
...And 3 more matches
ExtendableEvent - Web APIs
this ensures that any functional events (like fetchevent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.
... if waituntil() is called outside of the extendableevent handler, the browser should throw an invalidstateerror; note also that multiple calls will stack up, and the resulting promises will be added to the list of extend lifetime promises.
... note: the behaviour described in the above paragraph was fixed in firefox 43 (see bug 1180274.) this interface inherits from the event interface.
...And 3 more matches
Using files from web applications - Web APIs
if you want to use the dom file api from extensions or other browser chrome code, you can; however, note there are some additional features to be aware of.
... accessing the first selected file using a classical dom selector: const selectedfile = document.getelementbyid('input').files[0]; accessing selected file(s) on a change event it is also possible (but not mandatory) to access the filelist through the change event.
...this is just the file name, and does not include any path information.
...And 3 more matches
HTMLCanvasElement.getContext() - Web APIs
the htmlcanvaselement.getcontext() method returns a drawing context on the canvas, or null if the context identifier is not supported.
... note: the identifier "experimental-webgl" is used in new implementations of webgl.
... these implementations have either not reached test suite conformance, or the graphics drivers on the platform are not yet stable.
...And 3 more matches
Option() - Web APIs
if this is not specified, a default value of "" (empty string) is used.
...if this is not specified, the value of text is used as the value, e.g.
...if this is not specified, a default value of false is used.
...And 3 more matches
The HTML DOM API - Web APIs
the fundamental notion of a node that can represent visual content is introduced by the element interface.
...the htmlelement class, in turn, implements node, so every element is also a node (but not the other way around).
...from node, the element inherits concepts surrounding the ability for the element to be contained by another element, and to contain other elements itself.
...And 3 more matches
HTML Drag and Drop API - Web APIs
(see performing a drop.) note: neither dragstart nor dragend events are fired when dragging a file into the browser from the os.
... note: dragevent and datatransfer are broadly supported on desktop browsers.
... gecko-specific interfaces mozilla and firefox support some features not in the standard drag-and-drop model.
...And 3 more matches
Headers - Web APIs
WebAPIHeaders
note: you can find more out about the available headers by reading our http headers reference.
... methods headers.append() appends a new value onto an existing header inside a headers object, or adds the header if it does not already exist.
... headers.set() sets a new value for an existing header inside a headers object, or adds the header if it does not already exist.
...And 3 more matches
Ajax navigation example - Web APIs
to see how it works, please create the following files (or git clone https://github.com/giabao/mdn-ajax-nav-example.git ): note: for fully integrating the <form> elements within this mechanism, please take a look at the paragraph submitting forms and uploading files.
... if (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 olin...
...k, nidx = 0, nlen = document.links.length; nidx < nlen; document.links[nidx++].onclick = processlink); } const /* customizable constants */ stargetid = "ajax-content", sviewkey = "view_as", sajaxclass = "ajax-nav", /* not customizable constants */ rsearch = /\?.*$/, rhost = /^[^\?]*\?*&*/, rview = new regexp("&" + sviewkey + "\\=[^&]*|&*$", "i"), rendqstmark = /\?$/, oloadingbox = document.createelement("div"), ocover = document.createelement("div"), oloadingimg = new image(), opageinfo = { title: null, url: location.href }, ohttpstatus = /* http://www.iana.org/assignments/http-status-codes/http-status-codes.xml */ { 100: "continue", 101: "switching protocols", 102: "...
...And 3 more matches
IDBObjectStore.autoIncrement - Web APIs
note that every object store has its own separate auto increment counter.
... note: this feature is available in web workers.
... false the object store does not auto increment.
...And 3 more matches
IDBObjectStore.get() - Web APIs
note: this method produces the same result for: a) a record that doesn't exist in the database and b) a record that has an undefined value.
...that method provides a cursor if the record exists, and no cursor if it does not.
... note: this feature is available in web workers.
...And 3 more matches
IDBObjectStore.name - Web APIs
note: this feature is available in web workers.
... invalidstateerror either the object store has been deleted or the current transaction is not an upgrade transaction; you can only rename indexes during upgrade transactions; that is, when the mode is "versionchange".
... transactioninactiveerror the current transaction is not active.
...And 3 more matches
IDBObjectStore - Web APIs
note: this feature is available in web workers.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in db.
... db = dbopenrequest.result; }; // this event handles the event whereby a new version of // the database needs to be created either one has not // been created before, or a new version number has been // submitted via the window.indexeddb.open line above dbopenrequest.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.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique:...
...And 3 more matches
IDBTransaction.commit() - Web APIs
note that commit() doesn't normally have to be called — a transaction will automatically commit when all outstanding requests have been satisfied and no new requests have been made.
... if it is called on a transaction that is not active, it throws an invalidstateerror domexception.
... note: this feature is available in web workers.
...And 3 more matches
IDBTransaction.objectStore() - Web APIs
note: this feature is available in web workers.
... exceptions this method may raise a domexception of one of the following types: exception description notfounderror the requested object store is not in this transaction's scope.
...note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure.
...And 3 more matches
IDBTransaction.onabort - Web APIs
note: this feature is available in web workers.
...note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure.
... note the transaction.onabort = function(event) { }; block, reporting when the transaction has been aborted.
...And 3 more matches
KeyboardEvent.getModifierState() - Web APIs
windows linux (gtk) mac android 2.3 android 3.0 or latter "alt" either alt key or altgr key pressed alt key pressed ⌥ option key pressed alt key or option key pressed "altgraph" both alt and ctrl keys are pressed, or altgr key is pressed 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.
... "fn" not supported function key is pressed, but we're not sure what key makes the modifier state active.
... "fnlock" not supported "hyper" not supported "meta" not supported meta key pressed ⌘ command key pressed not supported ⊞ windows logo key or command key pressed "numlock" during led for num lock turned on a key on numpad pressed not supported while numlock is locked "os" ⊞ windows logo key pressed super key or hyper key pressed (typically, mapped to ⊞ windows logo key) not supported "scrolllock" during led for scroll lock turned on during led for scroll lock turned on, but typically this isn't supported by platform not supported while scrolllock is locked "shift" ⇧ shift key pressed "super" not supp...
...And 3 more matches
KeyframeEffect.setKeyframes() - Web APIs
element.animate([ { opacity: 1 }, { opacity: 0.1, offset: 0.7 }, { opacity: 0 } ], 2000); note: offset values, if provided, must be between 0.0 and 1.0 (inclusive) and arranged in ascending order.
... it is not necessary to specify an offset for every keyframe.
... element.animate({ opacity: [ 0, 1 ], // [ from, to ] color: [ "#fff", "#000" ] // [ from, to ] }, 2000); using this format, the number of elements in each array does not need to be equal.
...And 3 more matches
KeyframeEffectOptions - Web APIs
these properties are all optional, although without setting a duration the animation will not play.
... properties composite optional determines how values are combined between this animation and other, separate animations that do not specify their own specific composite operation.
...for instance with transform, a translatex(-200px) would not override an earlier rotate(20deg) value but result in translatex(-200px) rotate(20deg).
...And 3 more matches
LockManager.request() - Web APIs
ifavailable optional: if true, the lock request will only be granted if it is not already held.
... if it cannot be granted, the callback will be invoked with null instead of a lock instance.
... signal optional: an abortsignal (the signal property of an abortcontroller); if specified and the abortcontroller is aborted, the lock request is dropped if it was not already granted.
...And 3 more matches
MSSiteModeEvent - 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.
...*note that as of microsoft edge, the createevent()/initevent() constructor pattern for synthetic events is deprecated.
...And 3 more matches
MediaQueryList - Web APIs
the resulting object handles sending notifications to listeners when the media query state changes (i.e.
... matchesread only a boolean that returns true if the document currently matches the media query list, or false if not.
... addlistener() adds to the mediaquerylist a callback which is invoked whenever the media query status—whether or not the document matches the media queries in the list—changes.
...And 3 more matches
MediaSessionActionDetails - Web APIs
fastseek optional an seekto action may optionally include this property, which is a boolean value indicating whether or not to perform a "fast" seek.
...fastseek is not included on the final action in the seek sequence in this situation.
...this property is not present for other action types.
...And 3 more matches
MediaStream - Web APIs
mediastream.id read only a domstring containing 36 characters denoting a universally unique identifier (uuid) for the object.
...if the track has already been added to the mediastream object, nothing happens.
...the order is not defined, and may not only vary from one browser to another, but also from one call to another.
...And 3 more matches
MediaStreamTrack.applyConstraints() - Web APIs
for example, you may prefer high-density video but require that the frame rate be a little low to help keep the data rate low enough not overtax the network.
... syntax const appliedpromise = track.applyconstraints([constraints]) parameters constraints optional a mediatrackconstraints object listing the constraints to apply to the track's constrainable properties; any existing constraints are replaced with the new values specified, and any constrainable properties not included are restored to their default constraints.
...if the constraints cannot be applied, the promise is rejected with a mediastreamerror whose name is overconstrainederror, to indicate that the constraints could not be met.
...And 3 more matches
Media Capabilities API - Web APIs
'' : 'not ') + 'supported, ' + (result.smooth ?
... '' : 'not ') + 'smooth, and ' + (result.powerefficient ?
... '' : 'not ') + 'power efficient.') }) .catch(() => { console.log("decodinginfo error: " + contenttype) }); } media capabilities api concepts and usage there are a myriad of video and audio codecs.
...And 3 more matches
Navigator.registerProtocolHandler() - Web APIs
syntax navigator.registerprotocolhandler(scheme, url, title); note: recently updated to navigator.registerprotocolhandler(scheme, url), but no browsers currently support this version.
... note: the handler url must us the https scheme.
... note: the title has been removed from the spec due to spoofing concerns, but all current browsers still require it.
...And 3 more matches
Node.namespaceURI - Web APIs
WebAPINodenamespaceURI
the node.namespaceuri read-only property returns the namespace uri of the node, or null if the node is not in a namespace.
... if (node.localname == "browser" && node.namespaceuri == "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul") { // this is a xul browser } notes this is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope.
... per the namespaces in xml specification, an attribute does not inherit its namespace from the element it is attached to.
...And 3 more matches
PaymentRequest.canMakePayment() - Web APIs
the paymentrequest method canmakepayment() determines whether or not the request is configured in a way that is compatible with at least one payment method supported by the user agent.
... for instance, you might call canmakepayment() to determine if the browser will let the user pay using payment request api, and if it won't, you could fall back to another payment method, or offer a list of methods that aren't handled by payment request api (or even provide instructions for paying by mail or by phone).
... note: if you call this too often, the browser may reject the returned promise with a domexception.
...And 3 more matches
PaymentRequest.show() - Web APIs
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 this is provided, show() will not allow the user to interact with the payment interface until the promise is fulfilled, so that data can be updated prior to the user engaging with the payment process.
... notsupportederror the promise rejects with a notsupportederror if the user agent does not support the payment methods specified when the paymentrequest constructor was called.
...And 3 more matches
Performance - Web APIs
note: this interface and its members are available in web workers, except where indicated below.
... also, note that performance markers and measures are per context.
... if you create a mark on the main thread (or other worker), you cannot see it in a worker thread, and vice versa.
...And 3 more matches
PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() - Web APIs
a user-verifying platform authenticator is a kind of multi-factor authenticator that is part of the client device (it is generally not removable) and that involves an action from the user in order to identify them.
... note: this method may only be used in top-level contexts and will not be available in an <iframe> for example.
... return value a promise which resolves to a boolean indicating whether or a not a user-verifying platform authenticator is available.
...And 3 more matches
PublicKeyCredentialCreationOptions.extensions - Web APIs
note: an analogous option exists for the fetching operation (navigators.credentials.get()), see publickeycredentialrequestoptions.extensions.
...firefox does not seem to support any extension.
...if no matching authenticator is available, the credential is still generated with another available authenticator.
...And 3 more matches
RTCIceTransport.state - Web APIs
this differs from the gatheringstate, which only indicates whether or not ice gathering is currently underway.
...in this state, checking of candidates to look for those which might be acceptable has not yet begun.
... "completed" the transport has finished gathering local candidates and has received a notification from the remote peer that no more candidates will be sent.
...And 3 more matches
RTCPeerConnection.createDataChannel() - Web APIs
this string may not be longer than 65,535 bytes.
... options optional an rtcdatachannelinit dictionary providing configuration options for the data channel rtcdatachannelinit dictionary the rtcdatachannelinit dictionary provides the following fields, any of which may be included in the object passed as the options parameter in order to configure the data channel to suit your needs: ordered optional indicates whether or not messages sent on the rtcdatachannel are required to arrive at their destination in the same order in which they were sent (true), or if they're allowed to arrive out-of-order (false).
... this string may not be longer than 65,535 bytes.
...And 3 more matches
Range - Web APIs
WebAPIRange
range.setstartbefore() sets the start position of a range relative to another node.
... range.setstartafter() sets the start position of a range relative to another node.
... range.setendbefore() sets the end position of a range relative to another node.
...And 3 more matches
ReadableStreamDefaultReader.cancel() - Web APIs
the supplied reason argument will be given to the underlying source, which may or may not use it.
...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().
...And 3 more matches
SecurityPolicyViolationEvent.SecurityPolicyViolationEvent() - Web APIs
if not included, the default value is "".
...if not included, the default value is 0.
...if not included, the default value is 0.
...And 3 more matches
SharedWorker() - Web APIs
note: there is disagreement among browser manufacturers about whether a data uri is of the same origin or not.
... although gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7) and later accept data uris, that's not the case in all other browsers.
...if not specified, the default used is classic.
...And 3 more matches
Using writable streams - Web APIs
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.
...And 3 more matches
SubtleCrypto.deriveKey() - Web APIs
it's worth noting that the three key derivation algorithms you can use have quite different characteristics and are appropriate in quite different situations.
...note that the key usages must be allowed by the algorithm set in derivedkeyalgorithm.
... 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.
...And 3 more matches
TrackDefault.TrackDefault() - Web APIs
language a domstring specifying a default language for the sourcebuffer to use when an initialization segment does not contain language information for a new track.
... label a domstring specifying a default label for the sourcebuffer to use when an initialization segment does not contain label information for a new track.
... kinds an array (sequence) of domstrings specifying default kinds for the sourcebuffer to use when an initialization segment does not contain kind information for a new track.
...And 3 more matches
TransitionEvent.initTransitionEvent() - Web APIs
note: this method has been dropped during the standard process.
...do not use it anymore, use the standard constructor, transitionevent(), to create a synthetic transitionevent syntax transitionevent.inittransitionevent(typearg, canbubblearg, cancelablearg, transitionnamearg, elapsedtimearg); parameters typearg is a domstring identifying the specific type of transition event that occurred.
... canbubblearg is a boolean flag indicating if the event can bubble (true) or not (false).
...And 3 more matches
URL() - Web APIs
WebAPIURLURL
if the given base url or the resulting url are not valid urls, the javascript typeerror exception is thrown.
... note: this feature is available in web workers.
...if not specified, it defaults to ''.
...And 3 more matches
URLUtilsReadOnly - Web APIs
me for androidfirefox for androidopera for androidsafari on iossamsung interneturlutilsreadonlychrome no support noedge no support nofirefox full support 57 full support 57 no support 3.5 — 57notes notes firefox has a bug whereby single quotes contained in urls are escaped when accessed via url apis (see bug 1386683).ie no support noopera no support nosafari no support nowebview android no support nochrome andro...
...id no support nofirefox android full support 57 full support 57 no support 4 — 57notes notes firefox has a bug whereby single quotes contained in urls are escaped when accessed via url apis (see bug 1386683).opera android no support nosafari ios no support nosamsung internet android no support nohash 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.
...And 3 more matches
Using the User Timing API - Web APIs
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("...
... 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("...
... 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("...
...And 3 more matches
Basic scissoring - Web APIs
scissoring establishes a clipping region outside which drawing will not occur.
...in other cases, the fragments may be discarded altogether (so the pixel value is not updated), or it may interact with the already existing pixel value (such as when doing color blending for non-opaque elements in the scene).
... here we see another example of the distinction between fragments and pixels.
...And 3 more matches
Compressed texture formats - Web APIs
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.
... note that webgl makes no functionality available to compress or decompress textures: they must already be in a compressed format and can then be directly uploaded to video memory.
...which formats support texture_2d_array and texture_3d targets (in combination with compressedteximage3d) are noted in the following table.
...And 3 more matches
WebXR permissions and security - Web APIs
while not onerous, they are worth being aware of.
... immersive presentation of vr first, any requests to activate the immersive-vr mode are rejected if the domain issuing the request does not have permission to enable an immersive session.
... specifically: if the requestsession() call isn't coming from within the handler executed in response to a user event, and is not being issued while launching a web application, the request is denied and false is delivered to the promise's fulfillment handler.
...And 3 more matches
WebXR Device API - Web APIs
a typical xr device can have either 3 or 6 degrees of freedom and might or might not have an external positional sensor.
...if this property is missing or null, webxr is not available.
...other input devices such as keyboards, mice, and gamepads are not presented as xrinputsource instances.
...And 3 more matches
Window.event - Web APIs
WebAPIWindowevent
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.
...And 3 more matches
Window.showModalDialog() - Web APIs
note: firefox does not implement the dialoghide, edge, status, or unadorned arguments.
... notes showmodaldialog() was briefly standardized as part of html5.
... the third argument for additional options was not present in the html5 version.
...And 3 more matches
WindowOrWorkerGlobalScope.fetch() - Web APIs
the promise does not reject on http errors — it only rejects on network errors.
...a fetch() promise does not reject on http errors (404, etc.).
... note: the fetch() method's parameters are identical to those of the request() constructor.
...And 3 more matches
Worker() - Web APIs
WebAPIWorkerWorker
note: that there is a disagreement among browser manufacturers about whether a data uri is of the same origin or not.
... though gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7) and later accept data uris, that's not the case in all other browsers.
...if not specified, the default used is classic.
...And 3 more matches
Sending and Receiving Binary Data - Web APIs
this is null if the request is not complete or was not successful.
...note that this will not decode the image and read the pixels.
... var oreq = new xmlhttprequest(); oreq.open("get", "/myfile.png", true); oreq.responsetype = "arraybuffer"; oreq.onload = function (oevent) { var arraybuffer = oreq.response; // note: not oreq.responsetext if (arraybuffer) { var bytearray = new uint8array(arraybuffer); for (var i = 0; i < bytearray.bytelength; i++) { // do something with each byte in the array } } }; oreq.send(null); you can also read a binary file as a blob by setting the string "blob" to the responsetype property.
...And 3 more matches
XPathEvaluator.evaluate() - Web APIs
if this is specified as null or the implementation does not reuse the specified result, a new result object will be returned.
... exceptions invalid_expression_err if the expression is not legal according to the rules of the xpathevaluator, an xpathexception of type invalid_expression_err is raised.
... type_err in case result cannot be converted to the specified type, an xpathexception of type type_err is raised.
...And 3 more matches
XPathExpression.evaluate() - Web APIs
if this is specified as null or the implementation does not reuse the specified result, a new result object will be returned.
... exceptions invalid_expression_err if the expression is not legal according to the rules of the xpathevaluator, an xpathexception of type invalid_expression_err is raised.
... type_err in case result cannot be converted to the specified type, an xpathexception of type type_err is raised.
...And 3 more matches
XPathResult.resultType - Web APIs
note: this feature is available in web workers.
...note that if the result is a node-set then unordered_node_iterator_type is always the resulting type.
...this is useful for example, in an xpath expression using the not() function.
...And 3 more matches
XRSession.visibilityState - Web APIs
syntax visibilitystate = xrsession.visibilitystate; value a domstring containing one of the values defined in the enumerated type xrvisibilitystate; this string indicates whether or not the xr content is visible to the user and if it is, whether or not it's currently the primary focus.
... the possible values of visibilitystate are: hidden the virtual scene generated by the xrsession is not currently visible to the user, so its requestanimationframe() callbacks are not being executed until thevisibilitystate changes.
... input controllers are not being handled for the session.
...And 3 more matches
XRSystem: requestSession() - Web APIs
important: the immersive-ar mode is defined by the webxr augmented reality module, which is not yet stable and should not be used other than for testing and experimentation.
... immersive-vr indicates that the rendered session will be displayed using an immersive xr device in vr mode; it is not intended to be overlaid or integrated into the surrounding environment.
...inline sessions can be presented in either mono or stereo mode, and may or may not have viewer tracking available.
...And 3 more matches
Using the alertdialog role - Accessibility
the alertdialog role is used to notify the user of urgent information that demands the user's immediate attention.
... note: this role should only be used for alert messages that have associated interactive controls.
... if an alert dialog only contains static content and has no interactive controls at all, alertdialog is likely not the right role to use here.
...And 3 more matches
Using the aria-label attribute - Accessibility
use it in cases where a text label is not visible on the screen.
... this attribute can be used with any typical html element; it is not limited to elements that have an aria role assigned.
... value string possible effects on user agents and assistive technology note: opinions may differ on how assistive technology should handle this technique.
...And 3 more matches
Using the aria-required attribute - Accessibility
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.
... note that this attribute will not automatically change the presentation of the field.
...And 3 more matches
Using the group role - Accessibility
the group role is used to identify a set of user interface objects which, in contrast with a region, are not intended to be included in a table of contents or a page summary (such as the structures that are dynamically created by a script or assistive technologies); a group should not be considered a major perceivable section on a page.
... when the role is added to an element, the browser will send out an accessible group event to assistive technology products which can then notify the user about 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.
...And 3 more matches
Using the link role - Accessibility
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.
... assistive technology products should listen for such an event and notify the user accordingly: screen readers should announce the text of the link or its label when it is focused, along with the fact that it is a link.
... note: opinons may differ on how assistive technology should handle this technique.
...And 3 more matches
Using the progressbar role - Accessibility
it is not possible for the user to alter the value of a progressbar because it is always readonly.
... note: assistive technologies generally will render the value of aria-valuenow as a percent of the range between the value of aria-valuemin and aria-valuemax, unless aria-valuetext is specified.
... note: elements with the role progressbar have an implicit aria-readonly value of true.
...And 3 more matches
ARIA: cell role - Accessibility
the 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.
...if the cell does not contain header information and is nested in a grid or treegrid, the role of gridcell may be more appropriate.
...if all the columns are in the dom, this attribute is not necessary.
...And 3 more matches
ARIA: form role - Accessibility
this label should be visible to all users, not just assistive technology users.
... use the role="form" to identify a region of the page; do not use it to identify every form field.
...anything that is not a <form> cannot be submitted, therefore you would have to use javascript to build an alternative data submission mechanism, for example with xmlhttprequest.
...And 3 more matches
ARIA: table role - Accessibility
the cells are not focusable or selectable, though widgets within individual cells of the table can be interactive.
... if the table contains sortable columns or rows, the aria-sort attribute should be added on the header cell element (not the table itself).
... note: using a native html table element whenever possible is strongly encouraged.
...And 3 more matches
WAI-ARIA Roles - Accessibility
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.
...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.
...a feed enables screen readers to use the browse mode reading cursor to both read and scroll through a stream of rich content that may continue scrolling infinitely by loading more content as the user reads.aria: figure rolethe aria figure role can be used to identify a figure inside page content where appropriate semantics do not already exist.
...And 3 more matches
Basic form hints - Accessibility
note that each <input> element has an id, and each <label> element has a for attribute, indicating the id of the associated <input>.
... <form> <ul> <li> <input id="wine-1" type="checkbox" value="riesling"/> <label for="wine-1">berg rottland riesling</label> </li> <li> <input id="wine-2" type="checkbox" value="pinot-blanc"/> <label for="wine-2">pinot blanc</label> </li> <li> <input id="wine-3" type="checkbox" value="pinot-grigio"/> <label for="wine-3">pinot grigio</label> </li> <li> <input id="wine-4" type="checkbox" value="gewurztraminer"/> <label for="wine-4">gewürztraminer</label> </li> </ul> </form> labeling with aria the html <label> element is appropriate for form-related elements, but many form controls are implemented as a dynamic javascript widget, using <div>s or <span>s.
...note that on line 3, the <ul> element sets the aria-labelledby attribute to rg1_label, the id of the <h3> element on line 1, which is the label for the radio group.
...And 3 more matches
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
if you’re using a screen reader, have you noticed that, when you go to this setting in firefox, it tells you “delete history after 21 days”?, followed by the announcement that you’re in a textbox, and that it contains the number 21.
...you do not need to navigate around to find out the unit.
...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.
...And 3 more matches
ARIA - Accessibility
it supplements html so that interactions and widgets commonly used in applications can be passed to assistive technologies when there is not otherwise a mechanism.
...function updateprogress(percentcomplete) { progressbar.setattribute("aria-valuenow", percentcomplete); } note that aria was invented after html4, so does not validate in html4 or its xhtml variants.
...older software versions may not support certain aria roles, have only partial support, or misreport its functionality.
...And 3 more matches
::before (:before) - CSS: Cascading Style Sheets
WebCSS::before
/* add a heart before links */ a::before { content: "♥"; } note: the pseudo-elements generated by ::before and ::after are contained by the element's formatting box, and thus don't apply to replaced elements such as <img>, or to <br> elements.
... syntax /* css3 syntax */ ::before /* css2 syntax */ :before note: css3 introduced the ::before notation (with two colons) to distinguish pseudo-classes from pseudo-elements.
... html <span class="ribbon">notice where the orange box is.</span> css .ribbon { background-color: #5bc8f7; } .ribbon::before { content: "look at this orange box."; background-color: #ffba10; border-color: black; border-style: dotted; } result to-do list in this example we will create a simple to-do list using pseudo-elements.
...And 3 more matches
:checked - CSS: Cascading Style Sheets
WebCSS:checked
note: because browsers often treat <option>s as replaced elements, the extent to which they can be styled with the :checked pseudo-class varies from browser to browser.
... note: for an analogous effect, but based on the :hover pseudo-class and without hidden radioboxes, see this demo, taken from the :hover reference page.
... recommendation defines the pseudo-class, but not the associated semantic browser compatibility the compatibility table on this page is generated from structured data.
...And 3 more matches
:fullscreen - CSS: Cascading Style Sheets
syntax :fullscreen usage notes the :fullscreen pseudo-class lets you configure your stylesheets to automatically adjust the size, style, or layout of content when elements switch back and forth between full-screen and traditional presentations.
... examples in this example, the color of a button is changed depending on whether or not the document is in full-screen mode.
...ike this: <h1>mdn web docs demo: :fullscreen pseudo-class</h1> <p>this demo uses the <code>:fullscreen</code> pseudo-class to automatically change the style of a button used to toggle full-screen mode on and off, entirely using css.</p> <button id="fs-toggle">toggle fullscreen</button> the <button> with the id "fs-toggle" will change between pale red and pale green depending on whether or not the document is in full-screen mode.
...And 3 more matches
:visited - CSS: Cascading Style Sheets
WebCSS:visited
note: for more information on these limitations and the reasons behind them, see privacy and the :visited selector.
... syntax :visited examples properties that would otherwise have no color or be transparent cannot be modified with :visited.
... full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0:visited no longer matches <link> elementschrome full support 1notes full support 1notes notes chromium has never matched <link> elements with link pseudo-classes.edge full support 12firefox full support 70ie no support noopera full support ...
...And 3 more matches
@font-face - CSS: Cascading Style Sheets
it's common to use both url() and local() together, so that the user's installed copy of the font is used if available, falling back to downloading a copy of the font if it's not found on the user's device.
... the @font-face at-rule may be used not only at the top level of a css, but also inside any css conditional-group at-rule.
... font mime types format mime type truetype font/ttf opentype font/otf web open font format font/woff web open font format 2 font/woff2 notes web fonts are subject to the same domain restriction (font files must be on the same domain as the page using them), unless http access controls are used to relax this restriction.
...And 3 more matches
forced-colors - CSS: Cascading Style Sheets
note: this feature is not supported by any user agent and its specifics are subject to change.
... 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.
...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.
...we assume that animation is not supported by setting animation to false.
... if the browser does not support non-prefixed animation and animation is still false, we iterate over all the possible prefixes, since all the major browsers are currently prefixing this property and changing its name to animationname instead.
...And 3 more matches
Border-image generator - CSS: Cascading Style Sheets
; node.appendchild(info); } node.appendchild(slider_left); node.appendchild(input); node.appendchild(slider_right); this.input = input; sliders[topic] = this; setvalue(topic, value); }; inputslider.prototype.setinputvalue = function setinputvalue() { this.input.value = this.value.tofixed(this.precision) + this.unit; }; var setvalue = function setvalue(topic, value, send_notify) { var slider = sliders[topic]; if (slider === undefined) return; value = parsefloat(value.tofixed(slider.precision)); if (value > slider.max) value = slider.max; if (value < slider.min) value = slider.min; slider.value = value; slider.node.setattribute('data-value', value); slider.setinputvalue(); if (send_notify === false) return; notify.call(slider); }; va...
...ion; }; var getstep = function getstep(topic) { return sliders[topic].step; }; var subscribe = function subscribe(topic, callback) { if (subscribers[topic] === undefined) subscribers[topic] = []; subscribers[topic].push(callback); }; var unsubscribe = function unsubscribe(topic, callback) { subscribers[topic].indexof(callback); subscribers[topic].splice(index, 1); }; var notify = function notify() { if (subscribers[this.topic] === undefined) return; for (var i = 0; i < subscribers[this.topic].length; i++) subscribers[this.topic][i](this.value); }; var createslider = function createslider(topic, label) { var slider = document.createelement('div'); slider.classname = 'ui-input-slider'; slider.setattribute('data-topic', topic); if (label !== undefi...
...ssname !== "ui-dropdown-list") { this.setnodevalue(e.target); this.toggle(false); } this.time = date.now(); }; dropdown.prototype.setnodevalue = function setnodevalue(node) { this.value['name'] = node.textcontent; this.value['value'] = node.getattribute('data-value'); this.select.textcontent = node.textcontent; this.select.setattribute('data-value', this.value['value']); notify.call(this); }; var createdropdown = function createdropdown(topic, options) { var dropdown = document.createelement('div'); dropdown.setattribute('data-topic', topic); dropdown.classname = 'ui-dropdown'; for (var i in options) { var x = document.createelement('div'); x.setattribute('data-value', i); x.textcontent = options[i]; dropdown.appendchild(x); } new dropdo...
...And 3 more matches
Using URL values for the cursor property - CSS: Cascading Style Sheets
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.
...ani is not supported.
... an animated png or gif will not create an animated cursor.
...And 3 more matches
Box alignment for block, absolutely positioned and table layout - CSS: Cascading Style Sheets
note: at the time of writing (may 2018), there is no real support for the box alignment properties in block layout.
... align-content and justify-content the justify-content property does not apply to block containers or table cells.
... this property does not apply to floated elements or table cells.
...And 3 more matches
Block and inline layout in normal flow - CSS: Cascading Style Sheets
they can be either block or inline, but not both at once.
...the rectangular area that contains the boxes that form a line is called a line box.” - 9.4.2 note that the css 2.1 specification describes documents as being in a horizontal, top to bottom writing mode.
... note: if you are not sure whether margins are collapsing, check the box model values in your browser devtools.
...And 3 more matches
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
while the specification currently specifies alignment details for all layout methods, browsers have not fully implemented all of the specification; however, the css grid layout method has been widely adopted.
...until that happens, you can ensure that items do not stretch, such as images, which are direct children of the grid, by setting align-self and justify-self to start.
... the justify-self and justify-items properties are not implemented in flexbox.
...And 3 more matches
Consistent list indentation - CSS: Cascading Style Sheets
this often leads to frustration, because what works in one browser often doesn't have the same effect in another.
...this list item has no marker (otherwise known as a "bullet") and is not yet part of a list itself.
... visually, the markers are outside the content area of the <ul>, but that's not the important part here.
...And 3 more matches
Logical properties for margins, borders and padding - CSS: Cascading Style Sheets
again, notice how the margins stay in the same place for the first box, but switch around to follow the text direction in the second.
... .box { margin-block: 5px 10px; } note: the shorthand properties margin-inline and margin-block shipped in firefox 66.
...again, notice how the padding stays in the same place for the first box, but switches around to follow the text direction in the second.
...And 3 more matches
Layout and the containing block - CSS: Cascading Style Sheets
most often, the containing block is the content area of an element's nearest block-level ancestor, but this is not always the case.
...contain: paint;) note: the containing block in which the root element (<html>) resides is a rectangle called the initial containing block.
... calculating percentage values from the containing block as noted above, when certain properties are given a percentage value, the computed value depends on the element's containing block.
...And 3 more matches
animation - CSS: Cascading Style Sheets
WebCSSanimation
/* @keyframes duration | timing-function | delay | iteration-count | direction | fill-mode | play-state | name */ animation: 3s ease-in 1s 2 reverse both paused slidein; /* @keyframes name | duration | timing-function | delay */ animation: 3s linear 1s slidein; /* @keyframes name | duration */ animation: slidein 3s; <div class="grid"> <div class="col"> <div class="note"> given the following animation: <pre>@keyframes slidein { from { transform: scalex(0); } to { transform: scalex(1); } }</pre> </div> <div class="row"> <div class="cell"> <button class="play" title="play"></button> </div> <div class="cell flx"> <div class="overlay">animation: 3s ease-in 1s 2 reverse both paused slidein;</div> <d...
...y: flex; background: #eee; font: 1em monospace; } .row { display: flex; flex: 1 auto; flex-direction: row; flex-wrap: wrap; justify-content: space-between; } .col { display: flex; flex: 1 auto; flex-direction: column; } .cell { box-sizing: border-box; margin: .5em; padding: 0; background-color: #fff; overflow: hidden; text-align: left; } .flx { flex: 1 0; } .note { background: #fff3d4; padding: 1em; margin: .5em; font: .8em sans-serif; text-align: left; flex: none; } .overlay { padding: .5em; } @keyframes slidein { from { transform: scalex(0); } to { transform: scalex(1); } } .a1 { animation: 3s ease-in 1s 2 reverse both paused slidein; } .a2 { animation: 3s linear 1s slidein; } .a3 { animation: 3s slidein; } .animation { background...
...addeventlistener('animationstart', function () { togglebutton(button[index], 'pause'); }); node.addeventlistener('animationend', function () { togglebutton(button[index], 'restart'); }); }); button.foreach(function (btn, index) { btn.addeventlistener('click', function () { playpause(index); }); }); }) a description of which properties are animatable is available; it's worth noting that this description is also valid for css transitions.
...And 3 more matches
box-flex - CSS: Cascading Style Sheets
WebCSSbox-flex
it does not match either the old css flexible box layout module drafts for 'box-flex' (which were based on this property) or the behavior of '-webkit-box-flex' (which is based on those drafts).
...if the value is 0, the box does not grow.
... notes the containing box allocates the available extra space in proportion to the flex value of each of the content elements.
...And 3 more matches
conic-gradient() - CSS: Cascading Style Sheets
note: rendering of color stops in css gradients follows the same rules as color stops in svg gradients.
...browsers supporting conic gradients also accept percent values, with 100% equaling 360 degrees, but this is not in the specification.
...to use conic gradients to create pie charts --- which is not the correct way to create pie charts as background images are not accessible -- use hard color stops, where the color stop angles for two adjacent color stops are the same.
...And 3 more matches
cross-fade() - CSS: Cascading Style Sheets
the 50%/50% example seen above did not need to have the percentages listed, as when a percentage value is omitted, the included percentages are added together and subtracted from 100%.
... in the last example, the sum of both percentages is not 100%, and therefore both images include their respective opacities.
...this was not always the case.
...And 3 more matches
element() - CSS: Cascading Style Sheets
WebCSSelement
<div style="width:400px; height:100px; background:-moz-element(#mybackground2);"> </div> <div style="overflow:hidden; height:0;"> <button id="mybackground2" type="button">evil button!</button> </div> specifications specification status comment css images module level 4the definition of 'using elements as images: the element() notation' in that specification.
...ment() experimentalchrome no support noedge no support nofirefox full support 57prefixed full support 57prefixed prefixed implemented with the vendor prefix: -moz- no support 29 — 57prefixed notes prefixed implemented with the vendor prefix: -moz-notes -moz-element() is limited to background-image, background, border-image and border-image-source.
... no support 4 — 29prefixed notes prefixed implemented with the vendor prefix: -moz-notes -moz-element() is limited to background-image and background.ie no support noopera no support nosafari no support nowebview android no support nochrome android no support nofirefox android full support 60prefixed full support 60prefixed prefixed implemented with the vendor prefix: -moz- no support 29 — 60prefixed notes prefixed implemented ...
...And 3 more matches
font-size-adjust - CSS: Cascading Style Sheets
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 will still produce reasonable results in browsers that do not support font-size-adjust, where a 14px font will be used.
...this means that the first-choice font, when available, will appear the same size in browsers, whether or not they support font-size-adjust.
...And 3 more matches
font-stretch - CSS: Cascading Style Sheets
negative values are not allowed for this property.
... however, note that the <percentage> syntax is not yet supported by all browsers: check the browser compatibility table for details.
...if the font you are using does not offer condensed or expanded faces, this property has no effect.
...And 3 more matches
<frequency> - CSS: Cascading Style Sheets
WebCSSfrequency
it is not currently used in any css properties.
... note: although the number 0 is always the same regardless of unit, the unit may not be omitted.
... in other words, 0 is invalid and does not represent 0hz or 0khz.
...And 3 more matches
grid-area - CSS: Cascading Style Sheets
WebCSSgrid-area
the grid-area css shorthand property specifies a grid item’s size and location within a grid by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the edges of its grid area.
... constituent properties this property is a shorthand for the following css properties: grid-column-end grid-column-start grid-row-end grid-row-start syntax /* keyword values */ grid-area: auto; grid-area: auto / auto; grid-area: auto / auto / auto; grid-area: auto / auto / auto / auto; /* <custom-ident> values */ grid-area: some-grid-area; grid-area: some-grid-area / another-grid-area; /* <integer> && <custom-ident>?
... values */ grid-area: 4 some-grid-area; grid-area: 4 some-grid-area / 2 another-grid-area; /* span && [ <integer> || <custom-ident> ] values */ grid-area: span 3; grid-area: span 3 / span some-grid-area; grid-area: 2 span / another-grid-area span; /* global values */ grid-area: inherit; grid-area: initial; grid-area: unset; values auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement or a default span of 1.
...And 3 more matches
grid-column-end - CSS: Cascading Style Sheets
the grid-column-end css property specifies a grid item’s end position within the grid column by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the block-end edge of its grid area.
...er> + <custom-ident> values */ grid-column-end: 2; grid-column-end: somegridarea 4; /* span + <integer> + <custom-ident> values */ grid-column-end: span 3; grid-column-end: span somegridarea; grid-column-end: 5 somegridarea span; /* global values */ grid-column-end: inherit; grid-column-end: initial; grid-column-end: unset; values auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1.
... note: named grid areas automatically generate implicit named lines of this form, so specifying grid-column-end: foo; will choose the end edge of that named grid area (unless another line named foo-end was explicitly specified before it).
...And 3 more matches
grid-column-start - CSS: Cascading Style Sheets
the grid-column-start css property specifies a grid item’s start position within the grid column by contributing a line, a span, or nothing (automatic) to its grid placement.
... values auto a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1.
... note: named grid areas automatically generate implicit named lines of this form, so specifying grid-column-start: foo; will choose the start edge of that named grid area (unless another line named foo-start was explicitly specified before it).
...And 3 more matches
grid-row-end - CSS: Cascading Style Sheets
the grid-row-end css property specifies a grid item’s end position within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-end edge of its grid area.
...somegridarea; /* <integer> + <custom-ident> values */ grid-row-end: 2; grid-row-end: somegridarea 4; /* span + <integer> + <custom-ident> values */ grid-row-end: span 3; grid-row-end: span somegridarea; grid-row-end: 5 somegridarea span; /* global values */ grid-row-end: inherit; grid-row-end: initial; grid-row-end: unset; values auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1.
... note: named grid areas automatically generate implicit named lines of this form, so specifying grid-row-end: foo; will choose the end edge of that named grid area (unless another line named foo-end was explicitly specified before it).
...And 3 more matches
grid-row-start - CSS: Cascading Style Sheets
the grid-row-start css property specifies a grid item’s start position within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start edge of its grid area.
... values auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1.
... note: named grid areas automatically generate implicit named lines of this form, so specifying grid-row-start: foo; will choose the start edge of that named grid area (unless another line named foo-start was explicitly specified before it).
...And 3 more matches
mask-size - CSS: Cascading Style Sheets
WebCSSmask-size
/* keywords syntax */ mask-size: cover; mask-size: contain; /* one-value syntax */ /* the width of the image (height set to 'auto') */ mask-size: 50%; mask-size: 3em; mask-size: 12px; mask-size: auto; /* two-value syntax */ /* first value: width of the image, second value: height */ mask-size: 50% auto; mask-size: 3em 25%; mask-size: auto 6px; mask-size: auto auto; /* multiple values */ /* do not confuse this with mask-size: auto auto */ mask-size: auto, auto; mask-size: 50%, 25%, 25%; mask-size: 6px, auto, contain; /* global values */ mask-size: inherit; mask-size: initial; mask-size: unset; note: if the value of this property is not set in a mask shorthand property that is applied to the element after the mask-size css property, the value of this property is then reset to its initial...
...negative lengths are not allowed.
...negative percentages are not allowed.
...And 3 more matches
object-fit - CSS: Cascading Style Sheets
the entire object is made to fill the box, while preserving its aspect ratio, so the object will be "letterboxed" if its aspect ratio does not match the aspect ratio of the box.
...if the object's aspect ratio does not match the aspect ratio of its box, then the object will be clipped to fit.
...if the object's aspect ratio does not match the aspect ratio of its box, then the object will be stretched to fit.
...And 3 more matches
quotes - CSS: Cascading Style Sheets
WebCSSquotes
formal definition initial valuedepends on user agentapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | auto | [ <string> <string> ]+ examples basic quote marks html <q>to be or not to be.
... 18firefox android full support 4opera android full support 14safari ios full support 9samsung internet android full support 1.0auto keywordchrome no support nonotes no support nonotes notes this value is not supported, but the default browser behavior is to choose appropriate quotes for the user's language settingedge no support nonotes no support nonotes notes this value is not supported, but the default browser behavior...
... is to choose appropriate quotes for the user's language settingfirefox full support 70ie no support nonotes no support nonotes notes this value is not supported, but the default browser behavior is to choose appropriate quotes for the user's language settingopera no support nonotes no support nonotes notes this value is not supported, but the default browser behavior is to choose appropriate quotes for the user's language settingsafari no support nonotes no support nonotes notes ...
...And 3 more matches
text-overflow - CSS: Cascading Style Sheets
for example: overflow: hidden; white-space: nowrap; the text-overflow property only affects content that is overflowing a block container element in its inline progression direction (not text overflowing at the bottom of a box, for example).
...if there is not enough space to display the ellipsis, it is clipped.
...if there is not enough space to display the string itself, it is clipped.
...And 3 more matches
unicode-bidi - CSS: Cascading Style Sheets
the unicode-bidi and direction properties are the only properties that are not affected by the all shorthand.
... note: this property is intended for document type definition (dtd) designers.
... web designers and similar authors should not override it.
...And 3 more matches
<url> - CSS: Cascading Style Sheets
WebCSSurl
the <url> css data type denotes a pointer to a resource, such as an image or a font.
... in css level 1, the url() functional notation described only true urls.
...this change was not only awkward but, debatably, unnecessary, since urns are almost never used in actual css.
...And 3 more matches
Media buffering, seeking, and time ranges - Developer guides
note: you can see the timerange code running live on js bin.
... seekable the seekable attribute returns a timeranges object and tells us which parts of the media can be played without delay; this is irrespective of whether that part has been downloaded or not.
... some parts of the media may be seekable but not buffered if byte-range requests are enabled on the server.
...And 3 more matches
Block formatting context - Developer guides
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.
...as explained in the guide to in-flow and out of flow elements, the float has been taken out of flow so the background and border of the <div> only contain the content and not the float.
...in addition, it is potentially not readable for a future developer, as it might not be obvious why you used overflow for this purpose.
...And 3 more matches
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.
... note: these gesture events are available to add-ons and other browser chrome code, but are never sent to regular web page content.
...And 3 more matches
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.
... figure 1 : generated html differences mozilla: <span style="font-weight: bold;">i love geckos.</span> <span style="font-weight: bold; font-style: italic; text-decoration: underline;">dinosaurs are big.</span> internet explorer: <strong>i love geckos.</strong> <strong><em><u>dinosaurs are big.</u></em></strong> another difference between mozilla and ie is how to access the document object of an iframe, which is usually used in conjunction with designmode.
... examples please note: the example files are still being migrated from another site.
...And 3 more matches
Index - Developer guides
WebGuideIndex
2 ajax ajax, dom, json, javascript, references, xmlhttprequest asynchronous javascript and xml, while not a technology in itself, is a term coined in 2005 by jesse james garrett, that describes a "new" approach to using a number of existing technologies together 3 community ajax if you know of useful mailing lists, newsgroups, forums, or other communities related to ajax, please link to them here.
... 19 dom onevent handlers beginner, dom, dom beginner, needsbeginnerupdate, needsupdate the web platform provides several ways to be notified of dom events.
... 22 mutation events advanced, dom, guide mutation events provide a mechanism for a web page or an extension to get notified about changes made to the dom.
...And 3 more matches
Writing forward-compatible websites - Developer guides
this page explains how to write websites that do not break when new browser versions are released.
...it's not always possible to follow all of these, but following as many of them as possible will help future-proof your website.
...if they don't, you can't rely on that library not breaking in the future.
...And 3 more matches
HTML attribute: min - HTML: Hypertext Markup Language
WebHTMLAttributesmin
syntax if any is not explicity set, valid values for the number, date/time input types, and range input types are equal to the basis for stepping - the min value and increments of the step value, up to the max value, if specified.
...if omitted, <input type="number">, any integer is valid, but floats, like 4.2, are not valid, as step defaults to 1.
... week yyyy-w## <input type="week" min="2019-w23" step=""> time hh:mm <input type="time" min="09:00" step="900"> datetime-local yyyy-mm-ddthh:mm <input type="datetime-local" min="2019-12-25t19:30"> number <number> <input type="number" min="0" step="5" max="100"> range <number> <input type="range" min="60" step="5" max="100"> note: when the data entered by the user doesn't adhere to the min value set, the value is considered invalid in contraint validation and will match the :invalid pseudoclass see client-side validation and rangeunderflow for more information.
...And 3 more matches
<acronym> - HTML: Hypertext Markup Language
WebHTMLElementacronym
usage note: this element has been removed in html5 and shouldn't be used anymore.
... implementation note: up to gecko 1.9.2 inclusive, firefox implements the htmlspanelement interface for this element.
... example <p>the <acronym title="world wide web">www</acronym> is only a component of the internet.</p> default styling though the purpose of this tag is purely for the convenience of the author, its default styling varies from one browser to another: some browsers, like internet explorer, do not style it differently than a <span> element.
...And 3 more matches
<b>: The Bring Attention To element - HTML: Hypertext Markup Language
WebHTMLElementb
the html bring attention to element (<b>) is used to draw the reader's attention to the element's contents, which are not otherwise granted special importance.
...however, you should not use <b> for styling text; instead, you should use the css font-weight property to create boldface text, or the <strong> element to indicate that text is of special importance.
... usage notes use the <b> for cases like keywords in a summary, product names in a review, or other spans of text whose typical presentation would be boldfaced (but not including any special importance).
...And 3 more matches
<dfn>: The Definition element - HTML: Hypertext Markup Language
WebHTMLElementdfn
in html5, the title attribute has special meaning, as noted below.
... usage notes there are some not-entirely-obvious aspects to using the <dfn> element.
...the element must still have text within it, but that text may be an abbreviation (perhaps using <abbr>) or another form of the term.
...And 3 more matches
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
WebHTMLElementfieldset
it takes few attributes, the most notable of which are form, which can contain the id of a <form> on the same page, allowing you to make the <fieldset> part of that <form> even if it is not nested inside it, and disabled, which allows you to disable the <fieldset> and all its contents in one go.
... disabled if this boolean attribute is set, all form controls that are descendants of the <fieldset>, are disabled, meaning they are not editable and won't be submitted along with the <form>.
...note that form elements inside the <legend> element won't be disabled.
...And 3 more matches
<input type="submit"> - HTML: Hypertext Markup Language
WebHTMLElementinputsubmit
buttons do not have a true value otherwise.
... formnovalidate a boolean which, if present, means the form's fields will not be subjected to constraint validation before submitting the data to the server formtarget the browsing context into which to load the response returned by the server after submitting the form formaction a string indicating the url to which to submit the data.
... 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.
...And 3 more matches
<mark>: The Mark Text element - HTML: Hypertext Markup Language
WebHTMLElementmark
the html mark text element (<mark>) represents text which is marked or highlighted for reference or notation purposes, due to the marked passage's relevance or importance in the enclosing context.
... usage notes typical use cases for <mark> include: when used in a quotation (<q>) or block quote (<blockquote>), it generally indicates text which is of special interest but is not marked in the original source material, or material which needs special scrutiny even though the original author didn't think it was of particular importance.
... don't confuse <mark> with the <strong> element; <mark> is used to denote content which has a degree of relevance, while <strong> indicates spans of text of importance.
...And 3 more matches
<menuitem> - HTML: Hypertext Markup Language
WebHTMLElementmenuitem
tag omission must have a start tag and must not have an end tag.
...may not be used within a menu item that also includes the attributes checked, disabled, icon, label, radiogroup or type.
... disabled boolean attribute which indicates that the command is not available in the current state.
...And 3 more matches
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
WebHTMLElementmeta
the html <meta> element represents metadata that cannot be represented by other html meta-related elements, like <base>, <link>, <script>, <style> or <title>.
... tag omission as it is a void element, the start tag must be present and the end tag must not be present.
...if the http-equiv is not an encoding declaration, it can also be inside a <noscript> element, itself inside a <head> element.
...And 3 more matches
<rp>: The Ruby Fallback Parenthesis element - HTML: Hypertext Markup Language
WebHTMLElementrp
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.
... one <rp> element should enclose each of the opening and closing parentheses that wrap the <rt> element that contains the annotation's text.
... permitted content text tag omission the end tag can be omitted if the element is immediately followed by an <rt> or another <rp> element, or if there is no more content in the parent element.
...And 3 more matches
<section>: The Generic Section element - HTML: Hypertext Markup Language
WebHTMLElementsection
typically, but not always, sections have a heading.
... note: if the contents of the element would make sense syndicated as a standalone piece, the <article> element may be a better choice.
...note that a <section> element must not be a descendant of an <address> element.
...And 3 more matches
accesskey - HTML: Hypertext Markup Language
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.
...what may work for one combination of operating system, assistive technology, and browser may not work with other combinations.
...And 3 more matches
spellcheck - HTML: Hypertext Markup Language
it may have the following values: true, which indicates that the element should be, if possible, checked for spelling errors; false, which indicates that the element should not be checked for spelling errors.
... note: the spellcheck attribute is an enumerated one and not a boolean one.
... this means that the explicit usage of one of the values true or false is mandatory, and that a shorthand like <textarea spellcheck></textarea> is not allowed.
...And 3 more matches
x-ms-acceleratorkey - HTML: Hypertext Markup Language
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.
... x-ms-acceleratorkey exposes a notification in the accessibility tree, for screen readers and other assistive technologies, that an accelerator key exists for that element.
...And 3 more matches
Inline elements - HTML: Hypertext Markup Language
an inline element does not start on a new line and only takes up as much width as necessary.
...because the <span> element is inline, the paragraph correctly renders as a single, unbroken text flow, like this: for looks, this css (not displayed in standard reading mode) is also used: body { margin: 0; padding: 4px; border: 1px solid #333; } .highlight { background-color:#ee3; } block-level now let's change that <span> into a block-level element, such as <p>: <div>the following paragraph is a <p class="highlight">block-level element;</p> its background has been colored to display both the beginning and end of the ...
...block-level element's influence.</div> the css (not displayed in standard reading mode) is also used: body { margin: 0; padding: 4px; border: 1px solid #333; } .highlight { background-color:#ee3; } rendered using the same css as before, we get: see the difference?
...And 3 more matches
Microdata - HTML: Hypertext Markup Language
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.
... note: more about itemtype attributes can be found at http://schema.org/thing microdata vocabularies provide the semantics or meaning of an item.
... commonly used vocabularies: creative works: creativework, book, movie, musicrecording, recipe, tvseries embedded non-text objects: audioobject, imageobject, videoobject event health and medical types: notes on the health and medical types under medicalentity organization person place, localbusiness, restaurant product, offer, aggregateoffer review, aggregaterating action thing intangible major search engine operators like google, microsoft, and yahoo!
...And 3 more matches
Identifying resources on the Web - HTTP
there are sometimes reasons identity and location are not given by the same uri: http uses a specific http header, alt-svc when the resource requested wants the client to access it at another location.
...alternatively, it is possible to directly use an ip address, but because it is less convenient, it is not often used on the web.
... fragment #somewhereinthedocument is an anchor to another part of the resource itself.
...And 3 more matches
CSP: connect-src - HTTP
note: connect-src 'self' does not resolve to websocket schemas in all browsers, more info: https://github.com/w3c/webappsec-csp/issues/7 csp version 1 directive type fetch directive default-src fallback yes.
...you can also specify data schemes (not recommended).
...use this sparingly and definitely not for scripts.
...And 3 more matches
HTTP Public Key Pinning (HPKP) - HTTP
note: public key pinning mechanism was deprecated in favor of certificate transparency and expect-ct header.
... note: the current specification requires including a second pin for a backup key which isn't yet used in production.
... this allows for changing the server's public key without breaking accessibility for clients that have already noted the pins.
...And 3 more matches
HTTP range requests - HTTP
(binary content) the content-length header now indicates the size of the requested range (and not the full size of the image).
...--3d6b6a416f9b5 content-type: text/html content-range: bytes 0-50/1270 <!doctype html> <html> <head> <title>example do --3d6b6a416f9b5 content-type: text/html content-range: bytes 100-150/1270 eta http-equiv="content-type" content="text/html; c --3d6b6a416f9b5-- conditional range requests when resuming to request more parts of a resource, you need to guarantee that the stored resource has not been modified since the last fragment has been received.
...if the condition is not fulfilled, the full resource is sent back, with a 200 ok status.
...And 3 more matches
Unicode property escapes - JavaScript
note: for unicode property escapes to work, a regular expression must use the u flag which indicates a string must be considered as a series of unicode code points.
... 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).
...do not forget to edit it as well, thanks!
...And 3 more matches
Deprecated and obsolete features - JavaScript
this does not affect their use in replacement strings: property description $1-$9 parenthesized substring matches, if any.
... the following are now properties of regexp instances, no longer of the regexp object: property description global whether or not to test the regular expression against all possible matches in a string, or only against the first.
... ignorecase whether or not to ignore case while attempting a match in a string.
...And 3 more matches
Default parameters - JavaScript
other falsy values in the second call in this example, even if the first argument is set explicitly to undefined (though not null or other falsy values), the value of the num argument is still the default.
... function append(value, array = []) { array.push(value) return array } append(1) // [1] append(2) // [2], not [1, 2] this even applies to functions and variables: function callsomething(thing = something()) { return thing } let numberoftimescalled = 0 function something() { numberoftimescalled += 1 return numberoftimescalled } callsomething() // 1 callsomething() // 2 earlier parameters are available to later default parameters parameters defined earlier (to the left) are available to lat...
... this means that functions and variables declared in the function body cannot be referred to from default value parameter initializers; attempting to do so throws a run-time referenceerror.
...And 3 more matches
Array.from() - JavaScript
more clearly, array.from(obj, mapfn, thisarg) has the same result as array.from(obj).map(mapfn, thisarg), except that it does not create an intermediate array.
...as a result, static methods such as array.from() are "inherited" by subclasses of array, and create new instances of the subclass, not array.
...as such, it may not be present in other implementations of the standard.
...And 3 more matches
Array.prototype.includes() - JavaScript
note: when comparing strings and characters, includes() is case-sensitive.
...(that is, -0 is considered to be equal to both 0 and +0), but false is not considered to be the same as 0.
... note: technically speaking, includes() uses the samevaluezero algorithm to determine whether the given element is found.
...And 3 more matches
Array.prototype.some() - JavaScript
it is not invoked for indexes which have been deleted or which have never been assigned values.
... some() does not mutate the array on which it is called.
...elements appended to the array after the call to some() begins will not be visited by callback.
...And 3 more matches
Function.prototype.call() - JavaScript
caution: in certain cases, thisarg may not be the actual value seen by the method.
...with call(), you can write a method once and then inherit it in another object, without having to rewrite the method for the new object.
... note: while the syntax of this function is almost identical to that of apply(), the fundamental difference is that call() accepts an argument list, while apply() accepts a single array of arguments.
...And 3 more matches
Math.sign() - JavaScript
note that if the number is positive, an explicit (+) will not be returned.
...if this argument is not a number, it is implicitly converted to one.
... description because sign() is a static method of math, you always use it as math.sign(), rather than as a method of a math object you created (math is not a constructor).
...And 3 more matches
Object.assign() - JavaScript
note: object.assign() does not throw on null or undefined sources.
...support symbol properties, since es5 doesn't have symbols anyway: if (typeof object.assign !== 'function') { // must be writable: true, enumerable: false, configurable: true object.defineproperty(object, "assign", { value: function assign(target, varargs) { // .length of function is 2 'use strict'; if (target === null || target === undefined) { throw new typeerror('cannot convert undefined or null to object'); } var to = object(target); for (var index = 1; index < arguments.length; index++) { var nextsource = arguments[index]; if (nextsource !== null && nextsource !== undefined) { for (var nextkey in nextsource) { // avoid bugs when hasownproperty is shadowed if (object.prototype.hasownproperty...
...bug 1207182 on firefox) object.getownpropertysymbols(obj); // [symbol(foo)] properties on the prototype chain and non-enumerable properties cannot be copied const obj = object.create({ foo: 1 }, { // foo is on obj's prototype chain.
...And 3 more matches
Object.getOwnPropertyNames() - JavaScript
the ordering of the non-enumerable properties in the array and the ordering among the enumerable properties is not defined.
... in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
... object.getownpropertynames('foo'); // typeerror: "foo" is not an object (es5 code) object.getownpropertynames('foo'); // ["0", "1", "2", "length"] (es2015 code) examples using object.getownpropertynames() var arr = ['a', 'b', 'c']; console.log(object.getownpropertynames(arr).sort()); // .sort() is an array method.
...And 3 more matches
Object.prototype.hasOwnProperty() - JavaScript
return value a boolean indicating whether or not the object has the specified property as own property.
...this method can be used to determine whether an object has the specified property as a direct property of that object; unlike the in operator, this method does not check for a property in the object's prototype chain.
... note hasownproperty returns true even if the value of the property is null or undefined.
...And 3 more matches
Proxy - JavaScript
the proxy object enables you to create a proxy for another object, which can intercept and redefine fundamental operations for that object.
... examples basic example in this simple example, the number 37 gets returned as the default value when the property name is not in the object.
... const target = {}; const p = new proxy(target, {}); p.a = 37; // operation forwarded to the target console.log(target.a); // 37 // (the operation has been properly forwarded!) note that while this "no-op" works for javascript objects, it does not work for native browser objects like dom elements.
...And 3 more matches
String.prototype.match() - JavaScript
if the g flag is used, all results matching the complete regular expression will be returned, but capturing groups will not.
... if the g flag is not used, only the first complete match and its related capturing groups are returned.
... description if the regular expression does not include the g flag, str.match() will return the same result as regexp.exec().
...And 3 more matches
TypedArray.prototype.findIndex() - JavaScript
callback is invoked only for indexes of the typed array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values.
...if it is not provided, then undefined is used.
... findindex does not mutate the typed array on which it is called.
...And 3 more matches
WeakSet - JavaScript
they cannot contain arbitrary values of any type, as sets can.
... note: this also means that there is no list of current objects stored in the collection.
... weaksets are not enumerable.
...And 3 more matches
WebAssembly.Instance - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsinstancechrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0instance() constructorchrome full support 57edge full support 16firefox full support ...
... 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios ...
...And 3 more matches
WebAssembly.Memory() constructor - JavaScript
shared optional a boolean value that defines whether the memory is a shared memory or not.
... note: a webassembly page has a constant size of 65,536 bytes, i.e., 64kib.
... exceptions if memorydescriptor is not of type object, a typeerror is thrown.
...And 3 more matches
WebAssembly.Table() constructor - JavaScript
exceptions if tabledescriptor is not of type object, a typeerror is thrown.
... the table2.wasm module contains two functions (one that returns 42 and another that returns 83) and stores both into elements 0 and 1 of the imported table (see text representation).
... webassembly.instantiatestreaming(fetch('table2.wasm'), importobject) .then(function(obj) { console.log(tbl.length); console.log(tbl.get(0)()); console.log(tbl.get(1)()); }); note how you've got to include a second function invocation operator at the end of the accessor to actually invoke the referenced function and log the value stored inside it (e.g.
...And 3 more matches
encodeURI() - JavaScript
description the encodeuri() function does not encode characters that have special meaning (reserved characters) for a uri.
...note how certain characters are used to signify special meaning: http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor hence encodeuri() does not encode characters that are necessary to formulate a complete uri.
... also, encodeuri() does not encode a few additional characters, known as "unreserved marks", which do not have a reserved purpose but are allowed in a uri "as is".
...And 3 more matches
encodeURIComponent() - JavaScript
description encodeuricomponent() escapes all characters except: not escaped: a-z a-z 0-9 - _ .
...t2)); // -_.!~*'() console.log(encodeuri(set3)); // # console.log(encodeuri(set4)); // abc%20abc%20123 (the space gets encoded as %20) console.log(encodeuricomponent(set1)); // %3b%2c%2f%3f%3a%40%26%3d%2b%24 console.log(encodeuricomponent(set2)); // -_.!~*'() console.log(encodeuricomponent(set3)); // %23 console.log(encodeuricomponent(set4)); // abc%20abc%20123 (the space gets encoded as %20) note that a urierror will be thrown if one attempts to encode a surrogate which is not part of a high-low pair, e.g., // high-low pair ok console.log(encodeuricomponent('\ud800\udfff')); // lone high surrogate throws "urierror: malformed uri sequence" console.log(encodeuricomponent('\ud800')); // lone low surrogate throws "urierror: malformed uri sequence" console.log(encodeuricomponent('\udfff'))...
... // note that although rfc3986 reserves "!", rfc5987 does not, // so we do not need to escape it replace(/['()]/g, escape).
...And 3 more matches
Iteration protocols - JavaScript
some built-in types are built-in iterables with a default iteration behavior, such as array or map, while other types (such as object) are not.
... note that when this zero-argument function is called, it is invoked as a method on the iterable object.
...(this is equivalent to not specifying the done property altogether.) has the value true if the iterator has completed its sequence.
...And 3 more matches
Logical OR (||) - JavaScript
even though the || operator can be used with operands that are not boolean values, it can still be considered a boolean operator since its return value can always be converted to a boolean primitive.
... to explicitly convert its return value (or any expression in general) to the corresponding boolean value, use a double not operator or the boolean constructor.
... short circuit means that the expr part above is not evaluated, hence any side effects of doing so do not take effect (e.g., if expr is a function call, the calling never takes place).
...And 3 more matches
instanceof - JavaScript
/ true, because: c.prototype instanceof object // true c.prototype = {} let o2 = new c() o2 instanceof c // true // false, because c.prototype is nowhere in // o's prototype chain anymore o instanceof c d.prototype = new c() // add c to [[prototype]] linkage of d let o3 = new d() o3 instanceof d // true o3 instanceof c // true since c.prototype is now in o3's prototype chain note that the value of an instanceof test can change based on changes to the prototype property of constructors.
... this may not make sense at first, but for scripts dealing with multiple frames or windows, and passing objects from one context to another via functions, this will be a valid and strong issue.
... note for mozilla developers: in code using xpcom, instanceof has special effect: obj instanceof xpcominterface (e.g.
...And 3 more matches
super - JavaScript
// 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'.
... class rectangle { constructor() {} static lognbsides() { return 'i have 4 sides'; } } class square extends rectangle { constructor() {} static logdescription() { return super.lognbsides() + ' which are all equal'; } } square.logdescription(); // 'i have 4 sides which are all equal' deleting super properties will throw an error you cannot use the delete operator and super.prop or super[expr] to delete a parent class' property, it will throw a referenceerror.
... super.prop cannot overwrite non-writable properties when defining non-writable properties with e.g.
...And 3 more matches
function* - JavaScript
generators in javascript -- especially when combined with promises -- are a very powerful tool for asynchronous programming as they mitigate -- if not entirely eliminate -- the problems with callbacks, such as callback hell and inversion of control.
... calling a generator function does not execute its body immediately; an iterator object for the function is returned instead.
... when the iterator's next() method is called, the generator function's body is executed until the first yield expression, which specifies the value to be returned from the iterator or, with yield*, delegates to another generator function.
...And 3 more matches
function declaration - JavaScript
conditionally created functions functions can be conditionally declared, that is, a function statement can be nested within an if statement, however the results are inconsistent across implementations and therefore this pattern should not be used in production code.
..."is" : "is not"} hoisted.
...typeof foo is undefined // // in edge: // 'foo' name is not hoisted.
...And 3 more matches
Transitioning to strict mode - JavaScript
if your code base contains such cases, testing will be necessary to be sure nothing is broken.
...in strict mode, the arguments object is created and initialized with the same values than the named arguments, but changes to either the arguments object or the named arguments aren't reflected in one another.
...thorough testing will need to be performed to make sure nothing breaks.
...And 3 more matches
<math> - MathML
WebMathMLElementmath
in addition you must not nest a second <math> element in another, but you can have an arbitrary number of other child elements in it.
...it can have one of the following values: block, which means that this element will be displayed outside the current span of text, as a block that can be positioned anywhere without changing the meaning of the text; inline, which means that this element will be displayed inside the current span of text, and cannot be moved out of it without changing the meaning of that text.
... if not present, its default value is inline.
...And 3 more matches
Media - Progressive web apps (PWAs)
in css, you can use @import at the start of a stylesheet to import another stylesheet from a url, optionally specifying the media type.
... there are five special selectors: selector selects e:hover any e element that has the pointer over it e:focus any e element that has keyboard focus e:active the e element that is involved in the current user action e:link any e element that is a hyperlink to a url that the user has not visited recently e:visited any e element that is a hyperlink to a url that the user has visited recently note: the information that can be obtained from the :visited selector is restricted in gecko 2.0.
...place your mouse over the items in this list to see the actual pointer shapes in your browser: selector selects pointer indicating a link wait indicating that the program cannot accept input progress indicating that the program is working, but can still accept input default the default (usually an arrow) an outline property creates an outline that is often used to indicate keyboard focus.
...And 3 more matches
display - SVG: Scalable Vector Graphics
WebSVGAttributedisplay
a value of display="none" indicates that the given element and its children will not be rendered.
... when the display attribute is set to none, then the given element does not become part of the rendering tree.
... the geometry of a graphics element with display set to none is not included in bounding box and clipping paths calculations.
...And 3 more matches
height - SVG: Scalable Vector Graphics
WebSVGAttributeheight
, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, <feturbulence>, <filter>, <foreignobject>, <image>, <mask>, <pattern>, <rect>, <svg>, and <use> html,body,svg { height:100% } <svg viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg"> <!-- with a height of 0 or less, nothing will be rendered --> <rect y="0" x="0" width="90" height="0"/> <rect y="0" x="100" width="90" height="60"/> <rect y="0" x="200" width="90" height="100%"/> </svg> feblend for <feblend>, height defines the vertical length for the rendering area of the primitive.
... value auto | <length> | <percentage> default value auto (treated as 0) animatable yes note: starting with svg2, height is a geometry property meaning this attribute can also be used as a css property for <foreignobject>.
... value auto | <length> | <percentage> default value auto (treated as the intrinsic height of the image) animatable yes note: starting with svg2, height is a geometry property meaning this attribute can also be used as a css property for images.
...And 3 more matches
kernelUnitLength - SVG: Scalable Vector Graphics
if the attribute is not specified, the default value is one pixel in the offscreen bitmap, which is a pixel-based coordinate system, and thus potentially not scalable.
...if the x value is not specified, it defaults to the same value as x.
...if the y value is not specified, it defaults to the same value as x.
...And 3 more matches
requiredExtensions - SVG: Scalable Vector Graphics
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.
...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.
...And 3 more matches
requiredFeatures - SVG: Scalable Vector Graphics
it determines whether or not all of the named features are supported by the browser; if all of them are supported, the attribute evaluates to true end the element is rendered; otherwise, the attribute evaluates to false and the current element and its children are skipped and thus will not be rendered.
... if the attribute is not present, then its implicit evaluated value is true.
...if requiredfeatures is used in other situations, it represents a simple switch on the given element whether to render the element or not.
...And 3 more matches
stroke-linejoin - SVG: Scalable Vector Graphics
note: as a presentation attribute stroke-linejoin can be used as a css property.
...nd" value --> <path d="m7,5 a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3.5" stroke="black" fill="none" stroke-linejoin="round" /> <!-- upper right path: effect of the "bevel" value --> <path d="m13,5 a2,2 0,0,0 2,-3 a3,3 0 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.
...And 3 more matches
systemLanguage - SVG: Scalable Vector Graphics
ements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <audio>, <canvas>, <circle>, <clippath>, <cursor>, <defs>, <discard>, <ellipse>, <foreignobject>, <g>, <iframe>, <image>, <line>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <set>, <svg>, <switch>, <text>, <textpath>, <tref>, <tspan>, <unknown>, <use>, and <video> usage notes value <language-tags> default value none animatable no <language-tags> the value is a set of comma-separated tokens, each of which must be a language-tag value, as defined in bcp 47.
...if the attribute is used in other situations, then it represents a simple switch on the given element whether to render the element or not.
... note: if several alternative language objects are enclosed in a <switch> and none of them matches, this may lead to situations where no content is displayed.
...And 3 more matches
width - SVG: Scalable Vector Graphics
WebSVGAttributewidth
>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, <feturbulence>, <filter>, <foreignobject>, <image>, <mask>, <pattern>, <rect>, <svg>, and <use> html,body,svg { height:100% } <svg viewbox="0 0 100 300" xmlns="http://www.w3.org/2000/svg"> <!-- with a width of 0 or less, nothing will be rendered --> <rect x="0" y="0" width="0" height="90"/> <rect x="0" y="100" width="60" height="90"/> <rect x="0" y="200" width="100%" height="90"/> </svg> feblend for <feblend>, width defines the horizontal length for the rendering area of the primitive.
... value auto | <length> | <percentage> default value auto (treated as 0) animatable yes note: starting with svg2, width is a geometry property meaning this attribute can also be used as a css property for <foreignobject>.
... value auto | <length> | <percentage> default value auto (treated as the intrinsic width of the image) animatable yes note: starting with svg2, width is a geometry property meaning this attribute can also be used as a css property for images.
...And 3 more matches
<clipPath> - SVG: Scalable Vector Graphics
WebSVGElementclipPath
conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
...thus, it affects the rendering of an element, but not the element's inherent geometry.
... the bounding box of a clipped element (meaning, an element which references a <clippath> element via a clip-path property, or a child of the referencing element) must remain the same as if it were not clipped.
...And 3 more matches
<svg> - SVG: Scalable Vector Graphics
WebSVGElementsvg
note: the xmlns attribute is only required on the outermost svg element of svg documents.
...(not the height of its coordinate system.) value type: <length>|<percentage> ; default value: auto; animatable: yes preserveaspectratio how the svg fragment must be deformed if it is displayed with a different aspect ratio.
...(not the width of its coordinate system.) value type: <length>|<percentage> ; default value: auto; animatable: yes x the displayed x coordinate of the svg container.
...And 3 more matches
Fills and Strokes - SVG: Scalable Vector Graphics
note: in firefox 3+, rgba values are also allowed, and will give the same effect.
... note: unlike <path>s, these numbers must be comma-separated (whitespace is ignored).
...not all attributes can be set via css.
...And 3 more matches
Subresource Integrity - Web security
note: for subresource-integrity verification of a resource served from an origin other than the document in which it’s embedded, browsers additionally check the resource using cross-origin resource sharing (cors), to ensure the origin serving the resource allows it to be shared with the requesting origin.
... note: an integrity value may contain multiple hashes separated by whitespace.
... note: an integrity value's "hash" part is, strictly speaking, a cryptographic digest formed by applying a particular hash function to some input (for example, a script or stylesheet file).
...And 3 more matches
Index - XSLT: Extensible Stylesheet Language Transformations
WebXSLTIndex
a third type of element, not discussed here, is the literal result element (lre).
...it does not copy any children or attributes of the current node.
... 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.
...And 3 more matches
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
note: the import is live, meaning that if you alter the stylesheet dom after importing it, this will be reflected in the processing.
...this is handy because appending a fragment to another node transparently appends all the children of that fragment, and the fragment itself is not merged.
...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.
...And 3 more matches
Interacting with page scripts - Archive of obsolete content
ndow.assignedcontentscriptobject = contentscriptobject; the "page.html" file adds two buttons and assigns an event listener to each: one listener displays a property of the cloned object, and the other listener displays a property of the assigned object: <html> <head> </head> <body> <input id="works" type="button" value="i will work"/> <input id="fails" type="button" value="i will not work"/> <script> var works = document.getelementbyid("works"); works.addeventlistener("click", function() { alert(clonedcontentscriptobject.greeting); }, false); var fails = document.getelementbyid("fails"); fails.addeventlistener("click", function() { alert(assignedcontentscriptobject.greeting); }, false); </script> </body> </html>...
...clicking "i will not work" fails, and the following message is logged: permission denied to access property 'greeting' expose functions to page scripts the structured clone algorithm is a bit more powerful than simple json serialization, but not much: in particular, functions aren't cloned.
... this means that you can't expose a function to a page script using cloneinto(), and if you clone an object into the page script scope, its methods will not be available to the page script.
...And 2 more matches
ui/sidebar - Archive of obsolete content
the sidebar script may not be initialized yet, so you can't reliably send messages to the sidebar script right away: however, you can start listening to messages from the script.
...at this point the sidebar script is initialized, so you can send messages to the sidebar script and be confident that they will not be lost.
... events attach this event is emitted when a worker is attached to a sidebar, as a result of any of the following: calling the sidebar's show() method, when the sidebar is not shown in the currently active window changing the sidebar's url property the user switching the sidebar on using the "sidebar" submenu in firefox, when the sidebar is not shown in the currently active window the user opening a new window from a window that has the sidebar showing it is passed a worker as an argument, which defines port.emit() and port.on() methods that you can use to send me...
...And 2 more matches
console - Archive of obsolete content
try { dothing(); } catch (e) { console.exception(e); } function userexception(message) { this.message = message; this.name = "userexception"; } function dothing() { throw new userexception("thing could not be done!"); } error: my-addon: an exception occurred.
... userexception: thing could not be done!
...especially when debug logging shows up in a production environment, the noise can make it harder, not easier, to debug issues.
...And 2 more matches
Getting Started (jpm) - Archive of obsolete content
open it and add the following code: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("http://www.mozilla.org/"); } note that "entry point" defaults to "index.js" in jpm, meaning that your main file is "index.js", and it is found directly in your add-on's root.
... if firefox can not be located, or you have installed firefox developer as an alternate browser, you may need to provide the path to it.
... note that firefox by default requires add-ons, even locally developed ones, to be signed.
...And 2 more matches
Bookmarks - Archive of obsolete content
you can easily change this code to insert the new folder into the bookmarks toolbar by changing bookmarksmenufolder to another folder attribute.
... note: all annotations, tags, and so forth are kept when the bookmark's uri is changed.
...os = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("http://mozilla.com/", null, null); if (!bmsvc.isbookmarked(uri)) { bmsvc.insertbookmark(bmsvc.toolbarfolder, uri, bmsvc.default_index, "mozilla"); } this example looks to see if the user already has a bookmark for the mozilla web site, and, if not, creates one, adding it to the user's bookmarks toolbar.
...And 2 more matches
Forms related code snippets - Archive of obsolete content
date picker (before implementing it in a working environment, please read the note about the const statement compatibility) <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>datepicker example - mdn</title> <script type="text/javascript"> /*\ |*| |*| datepicker example mdndeveloper network |*| |*| https://developer.mozilla.org/docs/code_snippets/forms |*| https://developer.mozilla.org/user:fusionchess |*| |*| this snippet is released under the gnu public license, version 3 or later.
...se-month, span.zdp-decrease-year { float: left; margin-right: 2px; } span.zdp-increase-month, span.zdp-increase-year { float: right; margin-left: 2px; } td.zdp-active-cell { padding: 1px 3px; cursor: pointer; color: #000000; text-align: center; vertical-align: middle; } td.zdp-active-cell:hover { background-color: #999999; cursor: 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 not supported in internet explorer 6-9, or in the preview of internet explorer 10.
...And 2 more matches
Toolbar - Archive of obsolete content
ate step by step tutorial for beginners: custom toolbar button a tutorial describing the steps needed to add a toolbar button assuming you already have a working extension and know the basics of extension development: creating toolbar buttons adding button by default when you create and deploy your extension and include a toolbar button for it by overlaying the customize toolbarpalette, it is not available by default.
... notes insert your button by default only once, at first run, or when an extension update adds a new button.
... you must not insert your toolbar button between any of the following elements: the combined back/forward button, the location bar, the stop botton, or the reload button.
...And 2 more matches
Default Preferences - Archive of obsolete content
one with user supplied prefs, another with default prefs.
...the actual file, despite having .js extension, is not a javascript file.
... you may not set variables inside of it, nor may do any kind of program flow control (ifs, loops etc.) nor even calculated values (i.e.
...And 2 more matches
Extension Etiquette - Archive of obsolete content
sub-menus should be used for single extensions needing multiple menu items, and a tools menu item should not be created for options and preferences (for options and preferences, see the add-on manager).
...it's not your extension's job to take focus from the web content.
...strategies to avoid such conflicts include: avoid shared namespaces where possible many naming conflicts are best avoided by simply not sharing namespaces.
...And 2 more matches
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
draft this page is not complete.
... note: elements that take no content can be expressed in compact form as <elementname/>.
... as the "extensible" part of xml implies, elements from various xml-based languages such as xhtml and svg can be interspersed in one another as a means to extend the language.
...And 2 more matches
Performance best practices in extensions - Archive of obsolete content
this article offers some best practices and suggestions that can not only improve the performance and speed of your extension, but also of firefox itself.
... load only what you need, when you need it don't load things during startup that are only needed if the user clicks a button, or if a given preference is enabled when it's not.
... use asynchronous i/o this cannot be stressed enough: never do synchronous i/o on the main thread.
...And 2 more matches
Extensions support in SeaMonkey 2 - Archive of obsolete content
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.
...abel="menuitem"/> <menuitem label="menuitem"/> </menupopup> </window> instead of <hbox id="urlbar-icons"> <button type="menu"> <menupopup> <menuitem label="menuitem"/> <menuitem label="menuitem"/> <menuitem label="menuitem"/> </menupopup> </button> </hbox> technical note: the code that opens the url history popup just looks for any menupopup, so it goes wrong if you add your own.
...these are so commonly available that developers often forget that they are not built-ins.
...And 2 more matches
Firefox addons developer guide - Archive of obsolete content
rules: file and directory names: italic method and variable names: class name if you want to add a fixme, add: fixme: a message notes: the original document is in japanese and distributed via the xuldev.org website.
... 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).
... instead of using footnotes, we should inline these notes into the body of the article.
...And 2 more matches
Using the Stylesheet Service - Archive of obsolete content
note that ua stylesheets are allowed to do certain unsafe things that user stylesheets are not allowed to do.
...s = components.classes["@mozilla.org/content/style-sheet-service;1"] .getservice(components.interfaces.nsistylesheetservice); var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("chrome://myext/content/myext.css", null, null); sss.loadandregistersheet(uri, sss.user_sheet); note: loadandregistersheet will load the stylesheet synchronously, so you should only call this method using local uris.
... usage notes stylesheets added using this service get applied to both chrome and content documents.
...And 2 more matches
Creating a dynamic status bar extension - Archive of obsolete content
er-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://stockwatcher/content/stockwatcher.js"/> <!-- firefox --> <statusbar id="status-bar"> <statusbarpanel id="stockwatcher" label="loading..." tooltiptext="current value" onclick="stockwatcher.refreshinformation()" /> </statusbar> </overlay> also, notice that the definition of the status bar panel now includes a new property, onclick, which references the javascript function that will be executed whenever the user clicks on the status bar panel.
...the refreshinformation() function contains another function, called inforeceived().
...refreshinformation() embeds another function, inforeceived(), which we'll look at separately shortly.
...And 2 more matches
MozOrientation - Archive of obsolete content
note: this below describes how these values worked for the now obsolete mozorientation.
...the value is -1 when the device is undergoing standard earth gravity (9.8m/sec2) but not moving.
... in weightlessness, all values would be zero when the device is not moving, regardless of orientation, and would only change when being accelerated.
...And 2 more matches
Getting Started - Archive of obsolete content
classic.jar locations linux: folder_with_seamonkey/chrome/classic.jar windows: folder_with_seamonkey\chrome\classic.jar for mac os x: folder_with_seamonkey/chrome/classic.jar copy classic.jar to another easily accessible folder -- classic is recommended -- extract the contents of that folder, being sure to maintain the directory structure.
... skin skin simply contains another directory, classic which holds all the good stuff.
...if we also had skins for chatzilla, we would need to add another line resembling the other ones and change it to point to chatzilla.
...And 2 more matches
In-Depth - Archive of obsolete content
this is a small problem with the display in mozilla 1.2 what it means is \navigator\navigator.css (most of the time it displays the file correctly, but sometimes, like in this case, it does not).
...you'll notice that the .toolbar-1 class is located here.
...if you look through the rest of this file, you'll also notice that there are regions for the different states of #back-button.
...And 2 more matches
Creating regular expressions for a microsummary generator - Archive of obsolete content
matching from the start of the url while this expression matches the url, it also matches other urls that contain this url in their query parameters, for example: http://www.example.com/redirect.php?url=http://cgi.ebay.com/ws/ebayisapi.dll?viewitem&item=280018439106 that's probably not what we want, since urls that contain our example url probably aren't auction item pages themselves.
...but urls can contain multiple named parameters separated by ampersands (&), and the parameters can appear in any order, so even though the "item" parameter seems to be necessary, it might not appear right next to "viewitem".
... matching another ebay url we now have a regular expression that matches auction item urls, including those with multiple query parameters in any order.
...And 2 more matches
Drag and Drop JavaScript Wrapper - Archive of obsolete content
the library also depends on another script library, which you should also include, usually at the top of your xul file.
...note that you can only use these libraries from within xul loaded via a chrome url.
...the object contains a series of functions, one for each event handler (except for dragenter where it has nothing special to do).
...And 2 more matches
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
as you will see in this article, working with xpcom objects in java is not that much different than doing so in c++.
...illa = mozilla.getinstance(); greversionrange[] range = new greversionrange[1]; range[0] = new greversionrange("1.8.0", true, "1.9", false); // work with trunk nightly version 1.9a1 ^^ try { file grepath = mozilla.getgrepathwithproperties(range, null); locationprovider locprovider = new locationprovider(grepath); mozilla.initembedding(grepath, grepath, locprovider); } catch (filenotfoundexception e) { // this exception is thrown if gregrepathwithproperties cannot find a gre } catch (xpcomexception e) { // this exception is thrown if initembedding failed } locationprovider is a class provided by the java application.
... if your code cannot find the gre and keeps throwing filenotfoundexceptions during the getgrepathwithproperties(...) call, check whether you already registered the gre on your system: gre registration the initembedding method kicks off the embedding process, allowing the java application to work with xpcom and mozilla.
...And 2 more matches
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.
... warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser.
...And 2 more matches
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.
... warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser.
...And 2 more matches
Mozilla Application Framework in Detail - Archive of obsolete content
editor's note: this article should be rewritten to describe why use xulrunner to create your own application.
...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!
...And 2 more matches
PyDOM - Archive of obsolete content
note that we don't actually 'import' anything here - the scripts and event handlers do not exist in a python module.
...note that you can stick arbitrary values on any dom object - this is what js calls 'expandos'.
... for example, let's say you have xul similar to pyxultest: top-level script code says something like: button = document.getelementbyid("some-button") button.foo = 0 and the button itself might look like: <button id="some-button" label="click here" onclick="event.target.foo += 1; print 'foo is now', event.target.foo"/> note that (a) we have stuck an arbitrary attribute on a dom element and (b) in all cases (e.g., event handler and top-level script), the dom node needs to be explicitly specified - the globals are the window itself.
...And 2 more matches
Table Cellmap - Archive of obsolete content
79 // this union relies on the assumption that an object (not primitive type) does 80 // not start on an odd bit boundary.
... if mspan is 0 then morigcell is in effect 81 // and the data does not represent a span.
... take the same table and adder a header <table> <thead> <tr><td>head cell 1</td><td>head cell 2</td></tr> </thead> <tbody> <tr><td>cell 1</td><td>cell 2</td></tr> <tr><td>cell 3</td><td>cell 4</td></tr> </tbody> </table> now we have two different rowgroups and and the rowspans can not cross the borders between the different rowgroups.
...And 2 more matches
Tamarin Build System Documentation - Archive of obsolete content
the performance and deep phases do not run synchronously.
... the phases run when slaves are available and the other phases do not wait for completion to start the next build.
... if buildbot is busy the queue is displayed http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm the submitter of a sandbox build may remove a build request by clicking on the cancel button tamarin-redux builds are higher priority than sandbox builds, they cannot be removed but the most checkin including all new checkins are built how can i run buildbot scripts locally?
...And 2 more matches
The Download Manager schema - Archive of obsolete content
defaults to 0, may not be null.
...defaults to -1, may not be null.
...default 0 (save to disk); may not be null.
...And 2 more matches
The life of an HTML HTTP request - Archive of obsolete content
[note: passes nswebshell.mobserver as nsistreamobserver and the webshell as nsicontentviewercontainer to the docloader.] (2) the document loader calls ns_openuri with the url to begin transfering the requested file.
...nsicontent::appendchild() is used to build the content tree but appendchild takes a "anotify" argument that marks if it should notify the document about the content model changes or not.
...the content sink tells the document about content model changes (notifybody()) in places like nshtmlcontentsink::willinterrupt() and nshtmlcontentsink::didbuildmodel().
...And 2 more matches
Binding Attachment and Detachment - Archive of obsolete content
-moz-binding value: none | [,]* <uri> | inherit initial value: none applies to: all elements (not generated content or pseudo-elements) inherited: no percentages: n/a the value of the -moz-binding property is a set of urls that identify specific bindings.
... note: some older papers mentioned dom methods document.addbinding and document.removebinding; these were subsequently discarded as redundant and not implemented.
... var checkbox = document.getelementbyid("mycheckbox"); checkbox.style.mozbinding = "url(http://www.mozilla.org/xbl/htmlbindings.xml#checkbox)"; this attachment is not necessarily synchronous.
...And 2 more matches
confirm - Archive of obsolete content
see the notes at the end of this document for a safe way to implement a fallback.
...note that this only applies to buttons 0 and 2, not button 1 (the "cancel" button).
... warning: do not make any assumptions on the button placement - the underlying implementation can freely decide where each of the three buttons is placed.
...And 2 more matches
patch - Archive of obsolete content
typically, absolute pathnames are only used for shared components, or components that come from another vendor, such as /microsoft/shared/msvcrt40.dll.
... note that the registry pathname is not the location of the software on the computer; it is the location of information about the software inside the client version registry.
...if the existing version of the file does not match the checksum stored in the gdiff file, patch returns an error without applying the patch.
...And 2 more matches
disabled - Archive of obsolete content
« xul reference home disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
... in the case of form elements, it will not be submitted.
...And 2 more matches
sizemode - Archive of obsolete content
note: when a window is minimized, the sizemode attribute is not updated.
... setting this attribute does not change the window state.
...listen to the sizemodechange event dispatched to the dom window to get notified when the window state changes.
...And 2 more matches
Deprecated and defunct markup - Archive of obsolete content
{many elements on this page are wrongly marked as deprecated, this page needs review} the following xul tags and attribute should be considered deprecated, if not defunct.
... elements <actions> (listed here by mistake or was it a container tag?) typo for <action> --neil 03 march 2011 <autorepeatbutton> (action occurs repeatedly on mouse hover--used to construct other elements; used in <arrowscrollbox> and large drop-down menus) so, not deprecated?
... --neil 03 march 2011 <bulletinboard> (made to support left/top styles, but <stack> can now do as well) <gripper> (inside of <scrollbar><thumb>; not to be used by itself) <listboxbody> (internal use only; part of xbl for <listbox>) <menubutton> (experiment in combining buttons and menus; use <button type> instead) <nativescrollbar> (displayed a native scrollbar; had been for mac only with native themes on) <outliner> (former name for <tree>; <listbox> had been "<tree>") <popup> (use menupopup) <package> (no longer present but in older documentation) <scrollbarbutton> (button at end of scrollbar; had been only within larger <scrollbar>) so, not deprecated, but internal use only?
...And 2 more matches
How to implement a custom XUL query processor component - Archive of obsolete content
lumns> <rows datasources="dummy" ref="." querytype="simpledata"> <template> <row uri="?"> <label value="?name"/> <label value="?age"/> <label value="?hair"/> <label value="?eye"/> </row> </template> </rows> </grid> </window> a few things to note.
... we are not really using the datasources in our sample component, so we set it to a dummy value.
...a few explanatory notes: we are using a the getbindingfor rather than getbindingobjectfor to simplify the code.
...And 2 more matches
MenuModification - Archive of obsolete content
note how in this example, the menu does not have a child menupopup.
... comment: appenditem not working in tb 52.7.0.
... the appendchild method is available for all elements, and is used to add new nodes within another node.
...And 2 more matches
Filtering - Archive of obsolete content
even though the same datasource is used, it will only be loaded once and both templates will be notified when the data has loaded.
...d to add the type to the two countries in the datasource, as well as ensure that the namespace is declared on the root rdf tag: <nso:country about="http://www.daml.org/2001/09/countries/iso#it" dc:title="italy"/> <nso:country about="http://www.daml.org/2001/09/countries/iso#nl" dc:title="netherlands"/> the type of these two resources, when expanded with the namespace (not shown here), will be 'http://www.daml.org/2001/09/countries/country-ont#country'.
...the elements above are not.
...And 2 more matches
Introduction - Archive of obsolete content
naturally, since there is no data yet, no results will be available, so the builder ends up building nothing.
...if not, nothing gets generated again.
... an interesting thing to note is that due to the nature of the rdf parsing process, the builder generates results and builds content incrementally while the data arrives.
...And 2 more matches
Static Content - Archive of obsolete content
one interesting thing about this example is that only one menupopup will be created, even though there are two in the code, one outside the template and another one inside the action body.
...instead of creating another menupopup, the builder uses the existing one.
...note that the workaround of loading the datasource beforehand as mentioned for the last example isn't necessary, as the existence of the static content is another effective workaround.
...And 2 more matches
The Joy of XUL - Archive of obsolete content
this guide is designed to introduce application developers and their managers to xul so they can not only understand why mozilla's platform is based on it, but how they might adopt it for their own use.
... easy customization, localization, or branding another highly practical benefit of the separation that xul provides among application logic, presentation, and language text is the ease of customizing for different customers or groups of users.
...while such changes are extensive and affect most (if not all) of the application, they are also isolated from one another, enabling the core xul definition and application logic to be shared among all of the custom versions.
...And 2 more matches
Accesskey display rules - Archive of obsolete content
and also note that there are no spaces between the original labels and accesskey text in the above japanese example.
... when you cannot use dtd, e.g., when you need to generate some uis dynamically, you can use .properties file or something.
...note that using '&' in label text is bad way.
...And 2 more matches
Adding more elements - Archive of obsolete content
<hbox> <menulist id="searchtype"> <menupopup> <menuitem label="name"/> <menuitem label="size"/> <menuitem label="date modified"/> </menupopup> </menulist> <spacer style="width: 10px;"/> <menulist id="searchmode"> <menupopup> <menuitem label="is"/> <menuitem label="is not"/> </menupopup> </menulist> <spacer style="width: 10px;"/> <textbox id="find-text" flex="1" style="min-width: 15em;"/> </hbox> two drop down boxes have been added to the dialog.
...you will notice that if the window is resized, the textbox grows but the other components do not.
... you will also notice that the label was removed.
...And 2 more matches
Custom Tree Views - Archive of obsolete content
note: the tree-related interfaces changed in gecko 1.8.
...naturally, since a custom tree view is being used, the content tree view will not be used, so the treeitem, treerow, and treecell elements will have no purpose since the custom view will get its data from elsewhere.
...function(row){ return false; }, isseparator: function(row){ return false; }, issorted: function(){ return false; }, getlevel: function(row){ return 0; }, getimagesrc: function(row,col){ return null; }, getrowproperties: function(row,props){}, getcellproperties: function(row,col,props){}, getcolumnproperties: function(colid,col,props){} }; the functions in the example not described above do not need to perform any action, but they must be implemented as the tree calls them to gather additional information.
...And 2 more matches
List Controls - Archive of obsolete content
you cannot have a single cell selected.
...the header row is not a normal row however, so using a script to get the first row in the list box will skip the header row.
...you cannot enter your own text by typing it in.
...And 2 more matches
The Chrome URL - Archive of obsolete content
another advantage over other url types is that they automatically handle multiple themes and locales.
...note how none of the urls specify which theme or locale is used and none specify a specific directory.
...some dialog boxes may not work right, however, as they may be expecting arguments to be supplied from the window that opened them.
...And 2 more matches
Using nsIXULAppInfo - Archive of obsolete content
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.
... 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.
...id = "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}"; var appinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); if(appinfo.id == firefox_id) { // running under firefox } else if(appinfo.id == thunderbird_id) { // running under thunderbird } else if(appinfo.id == seamonkey_id) { // running under seamonkey } else { // another app } note: you could also use nsixulappinfo.name, which is a human-readable name for the application, such as "firefox", "thunderbird" or "seamonkey", but who knows, maybe they'll rename it again!
...And 2 more matches
XUL Accesskey FAQ and Policies - Archive of obsolete content
on macintosh, accesskeys are available only in html not in xul, and they are activated using ctrl+letter instead of alt.
... notice that the difference between the button examples above is the case of the accesskey specified.
... if not, try the first letter of the first word in the prompt.
...And 2 more matches
colorpicker - Archive of obsolete content
attributes disabled, color, onchange, preference, tabindex, type properties accessibletype, color, disabled, open, tabindex, value examples <colorpicker/> attributes disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
... in the case of form elements, it will not be submitted.
...And 2 more matches
dialog - Archive of obsolete content
lcancel, buttonlabeldisclosure, buttonlabelextra1, buttonlabelextra2, buttonlabelhelp, buttonorient, buttonpack, buttons, defaultbutton, title properties buttons, defaultbutton methods acceptdialog, canceldialog, centerwindowonscreen, getbutton, movetoalertposition examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing" title="dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" buttons="accept,cancel" buttonlabelcancel="cancel" buttonlabelaccept="save"> <dialogheader title="options" description="my preferences"/> <groupbox> <caption label="colour"/> <radiogroup> <radio label="red"/> <radio label="green" selected="true"/> <radio label="...
... note: if you don't want to display any buttons in the dialog box, set the value of this attribute to "," (a single comma).
...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 soon, see bug 738797 and bug 1037225).
...And 2 more matches
editor - Archive of obsolete content
the editor does not provide any editing user interface; you would supply that yourself.
...if you do not set the editortype attribute on an editor, you must enable editing using the makeeditable method.
...however, an issue is that if you specify the src attribute initially on the editor tag in the xul file, the document does not become editable by default.
...And 2 more matches
keyset - Archive of obsolete content
the keyset and its descendants are not displayed.
...r, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
...And 2 more matches
prefpane - Archive of obsolete content
if this is not specified, the contents of the prefpane element is used.
... selected type: boolean this property's value is true if this element is selected, or false if it is not.
... void userchangedvalue(in domelement element); the user changed the value in a widget that the preferences system does not automatically track state changes for (1) and the preference element associated with the widget should be updated based on the state held by the widget.
...And 2 more matches
splitter - Archive of obsolete content
if this attribute is not specified, the splitter will not cause a collapse.
... grow the elements to the right or below the splitter do not change size (unless they are flexible) when the splitter is dragged, but instead the entire container changes size.
... state type: one of the values below indicates whether the splitter has collapsed content or not.
...And 2 more matches
wizard - Archive of obsolete content
use the cancancel property to indicate to the user (by disabling the cancel button) that they cannot can pagestep type: integer the index of the current page.
...if this property is false, the user cannot navigate to the next page.
...if this property is false, the user cannot navigate to the previous page.
...And 2 more matches
Creating XULRunner Apps with the Mozilla Build System - Archive of obsolete content
hey, it's not all bad.
...macbuild/ - when steve jobs said "think different", we took that to heart, and not just by rejecting useless adverbial endings.
... note that the locale manifest uses a variable to specify the name of the locale which has to be defined in the makefile (and you need to say #filter substitution in the manifest for the variable to be expanded).
...And 2 more matches
Deploying XULRunner - Archive of obsolete content
note: to actually install a xulrunner application, a compatible version of xulrunner must be registered on the system and the app must be deployed per the instructions at xul application packaging.
... if your installer is capable of determining whether or not xulrunner has been registered on the system you could perform the check and register the appropriate version if necessary.
... windows on windows, xulrunner does not yet have a complete built-in installation solution; app developers should use pre-existing solutions for a native windows installer.
...And 2 more matches
MacFAQ - Archive of obsolete content
(note this document has not been reviewed for accuracy or completeness.) special build notes enable libxul.
...note that in order to copy the framework while keeping the relative soft-links in the framework, do something like: % ( cd dist ; gnutar cf - xul.framework | ( cd /library/frameworks ; gnutar xf - )) installing your application your application must be installed as a xulrunner app before you can open it.
... to do this, type: xulrunner-bin --install-app /path/to/appdir note the path to your application must end with the directory containing application.ini; you should not reference application.ini in this command.
...And 2 more matches
NPN_GetValue - Archive of obsolete content
unix only: returns the application's xtappcontext npnvnetscapewindow: ms windows and unix/x11 only: ms windows: gets the native window on which plug-in drawing occurs; returns hwnd unix/x11: gets the browser toplevel window in which the plug-in is displayed; returns window npnvjavascriptenabledbool: tells whether javascript is enabled; true=javascript enabled, false=not enabled npnvasdenabledbool: tells whether smartupdate (former name: asd) is enabled; true=smartupdate enabled, false=not enabled npnvisofflinebool: tells whether offline mode is enabled; true=offline mode enabled, false=not enabled npnvtoolkit: npnvsupportsxembedbool: npnvwindownpobject: returns the npobject * pointer for the dom window object; see getting the page url in npapi plu...
... npnvprivatemodebool: indicates whether or not the browser is currently in private browsing mode.
... gecko 1.9.2 note starting with gecko 1.9.2 (firefox 3.6), the variables npnvservicemanager, npnvdomelement, and npnvdomwindow are no longer supported.
...And 2 more matches
NPP_SetWindow - Archive of obsolete content
the window structure contains a window handle and values for top left corner, width, height, and clipping rectangle (see note on unix below).
... if unsuccessful, the plug-in is not loaded and the function returns an error code.
...in this case, the plug-in must not perform any additional graphics operations on the window and should free any associated resources.
...And 2 more matches
Supporting private browsing in plugins - Archive of obsolete content
firefox 3.5 introduced private browsing, a mode in which potentially private information is not recorded in any way.
... it also introduced a mechanism by which plugins can determine whether or not private browsing mode is in effect.
...potentially private information may include (but is not necessarily limited to) history information for downloaded data.
...And 2 more matches
Plugins - Archive of obsolete content
note: plugins are now a legacy technology.
... they are not available on most mobile devices.
...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.
...And 2 more matches
0.90 - Archive of obsolete content
ArchiveRSSVersion0.90
(and not only a syndication format, as it is today.) rss 0.90 is an rdf-based format.
... when rss 0.90 was created, the rss initialization stood for rich site summary and not really simple syndication.
... (see rss - what is in a name for more info on rss's naming history.) note: rss 0.90 has been deprecated.
...And 2 more matches
Introduction - Archive of obsolete content
variable declarations are not limited to one element, and as with all javascript, can span multiple lines.
...this is done with brace ({}) notation.
...you can also use brace notation on attributes of elements (their names or values).
...And 2 more matches
Function.prototype.isGenerator() - Archive of obsolete content
the non-standard isgenerator() method used to determine whether or not a function is a generator.
... syntax fun.isgenerator() return value a boolean indicating whether or not the given function is a generator.
... description the isgenerator() method determines whether or not the function fun is a generator.
...And 2 more matches
Enumerator - Archive of obsolete content
do not use!
...it is supported in internet explorer only, not in windows 8.x store apps.
... remarks collections differ from arrays in that the members of a collection are not directly accessible.
...And 2 more matches
@cc_on - Archive of obsolete content
warning: conditional compilation is not supported in internet explorer 11 standards mode and windows 8.x store apps.
... 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.
...this enables hosts that do not support conditional compilation to ignore it.
...And 2 more matches
@if - Archive of obsolete content
warning: conditional compilation is not supported in internet explorer 11 standards mode and windows 8.x store apps.
... remarks when you write an @if statement, you do not have to place each clause on a separate line.
... it is not common to use conditional compilation variables in scripts written for asp or asp.net pages or command-line programs.
...And 2 more matches
Object.prototype.__noSuchMethod__ - Archive of obsolete content
the second argument is an actual array (that is, it inherits through the array.prototype chain) and not the array-like arguments object.
... if this method cannot be called, either as if undefined by default, if deleted, or if manually set to a non-function, the javascript engine will revert to throwing typeerrors.
...'in' : 'not in') + ' bob'); // getage is not in bob console.log("bob's age is: " + bob.getage()); // bob's age is: 25 console.log('getname is ' + (('getname' in bob) ?
...And 2 more matches
Window.importDialog() - 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.
... example var dialog = importdialog(null, "chrome://myextension/content/dialog.xul", myobject); notes the xul passed to importdialog() is very similar to xul passed to window.opendialog(), with some limitations and caveats: only <dialog> top level elements are permitted.
...And 2 more matches
Mozilla XForms User Interface - Archive of obsolete content
the form author can also use the 'appearance' attribute on the form control to give us another clue.
...this article uses several notations.
...the first is that the changes required for such controls could not be safely made to firefox 1.5 or firefox 2.0.
...And 2 more matches
Player paddle and controls - Game development
as you'll notice if you reload your index.html at this point, the paddle is currently not exactly in the middle.
...this works, but not quite as we expected it to — when the ball hits the paddle, the paddle falls off the screen!
...add the following new line to the update() function, as shown: function update() { game.physics.arcade.collide(ball, paddle); paddle.x = game.input.x; } now on every new frame the paddle's x position will adjust accordingly to the input's x position, however when we start the game, the position of the paddle is not in the middle.
...And 2 more matches
Hoisting - MDN Web Docs Glossary: Definitions of Web-related terms
hoisting is a term you will not find used in any normative specification prose prior to ecmascript® 2015 language specification.
... conceptually, for example, a strict definition of hoisting suggests that variable and function declarations are physically moved to the top of your code, but this is not in fact what happens.
... only declarations are hoisted javascript only hoists declarations, not initializations.
...And 2 more matches
Idempotent - MDN Web Docs Glossary: Definitions of Web-related terms
in other words, an idempotent method should not have any side-effects (except for keeping statistics).
... implemented correctly, the get, head, put, and delete method are idempotent, but not the post method.
...another implication of delete being idempotent is that developers should not implement restful apis with a delete last entry functionality using the delete method.
...And 2 more matches
What do common web layouts contain? - Learn web development
in fact, everything not absolutely required by the page's main content.
...like the header, contains less prominent global information like legal notices or contact info.
...you may notice that, while the content can move around on the screen, we always keep the header (1) on top and the footer (2) at the bottom.
...And 2 more matches
How do you upload your files to a web server? - Learn web development
note: of course there are lots of other options.
... let's first look at http://demozilla.examplehostingprovider.net/ — as you can see, so far there is nothing there: note: depending on your hosting provider, most of the time you'll see a page saying something like “this website is hosted by [hosting service].” when you first go to your web address.
... note: make sure your hosting provider offers sftp (secure ftp) connection to your hosting space.
...And 2 more matches
What are browser developer tools? - Learn web development
note: before you run through the examples below, open the beginner's example site that we built during the getting started with the web article series.
... in safari, the controls are not so clearly presented, but you should see the html if you haven't selected something else to appear in the window.
...you can make any changes you'd like, but you cannot save your changes.
...And 2 more matches
Test your skills: Advanced styling - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... you'll find that some browsers will not behave in terms of the form element's height.
... another thing that commonly denotes a search box is a magnifying glass icon.
...And 2 more matches
Installing basic software - Learn web development
visual studio code, notepad++, sublime text, atom, gnu emacs, or vim), or a hybrid editor (e.g.
...office document editors are not suitable for this use, as they rely on hidden elements that interfere with the rendering engines used by web browsers.
...by default windows includes notepad and macos comes with textedit.
...And 2 more matches
Test your skills: Loops - Learn web development
note: you can try out solutions for the tasks below by downloading the code, putting it in an online tool such as codepen, jsfiddle, or glitch, then working on the tasks.
... you should use a type of loop that you've not used in the previous task.
... isprime() — a function that, when passed a number, returns true if the number is a prime number, and false if not.
...And 2 more matches
Test your skills: Arrays - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... note: in the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
... next, modify the first two items in the array using simple bracket notation and assignment.
...And 2 more matches
Web performance resources - Learn web development
it might not be absolute timing, but user perception.
...these styles will improve perceived performance as the css does not require a file request.
... web fonts eot and ttf formats are not compressed by default.
...And 2 more matches
Ember resources and troubleshooting - Learn web development
note that sourcemaps are enabled by default.
... not at all.
... mut was not covered in this tutorial and is really baggage from a transitional time when ember was moving from two-way bound data to the more common and easier-to-reason-about one-way bound data flow.
...And 2 more matches
Routing in Ember - Learn web development
at the moment, we already have the "all" page, as we are currently not doing any filtering in the page that we've been working with, but we will need to reorganize it a bit to handle a different view for the "active" and "completed" todos.
...to do this you’ll need to enter the following commands into your terminal, inside the root directory of your app: ember generate route index ember generate route completed ember generate route active the second and third commands should have not only generated new files, but also updated an existing file, app/router.js.
... creating the "index" route did not add a route definition line to router.js, because like with url navigation and javascript module loading, "index" is a special word that indicates the default route to render, load, etc.
...And 2 more matches
Ember app structure and componentization - Learn web development
to start with, delete the contents of application.hbs and replace them with the following: <section class="todoapp"> <h1>todos</h1> <input class="new-todo" aria-label="what needs to be done?" placeholder="what needs to be done?" autofocus > </section> note: aria-label provides a label for assistive technology to make use of — for example, for a screenreader to read out.
... component groupings are as follows: the main input / "new-todo" (red in the image) the containing body of the todo list + the mark-all-complete button (purple in the image) the mark-all-complete button, explicitly highlighted for reasons given below (yellow in the image) each todo is an individual component (green in the image) the footer (blue in the image) something odd to note is that the mark-all-complete checkbox (marked in yellow), while in the "main" section, is rendered next to the "new-todo" input.
... note: the header.js file (shown as skipped) is for connection to a backing glimmer component class, which we don't need for now, as they are for adding interactivity and state manipulation.
...And 2 more matches
Styling Vue components with CSS - Learn web development
while this tutorial will not be using such tools, it's good to know that when including such code in the assets folder it will be processed automatically.
... before: after: noticeable changes include the removal of the list bullets, background color changes, and changes to the base button and input styles.
...line-color: #c82333; } .btn__primary { color: #fff; background-color: #000; } .btn-group { display: flex; justify-content: space-between; } .btn-group > * { flex: 1 1 auto; } .btn-group > * + * { margin-left: 0.8rem; } .label-wrapper { margin: 0; flex: 0 0 100%; text-align: center; } [class*="__lg"] { display: inline-block; width: 100%; font-size: 1.9rem; } [class*="__lg"]:not(:last-child) { margin-bottom: 1rem; } @media screen and (min-width: 620px) { [class*="__lg"] { font-size: 2.4rem; } } .visually-hidden { position: absolute; height: 1px; width: 1px; overflow: hidden; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px); clip-path: rect(1px, 1px, 1px, 1px); white-space: nowrap; } [class*="stack"] > * { margin-top: 0; margin-bot...
...And 2 more matches
Git and GitHub - Learn web development
when working on a project on your own or with others, you'll want to be able to back up the code in a central place, so it is not lost if your computer breaks.
... note: git is actually a distributed version control system, meaning that a complete copy of the repository containing the codebase is made on your computer (and everyone else's).
... note: github is not the only site/toolset you can use with git.
...And 2 more matches
Embedding API for Accessibility
l of the current keyboard focus frame */ no browse with caret setboolpref("accessibility.browsewithcaret", usecaret); /* if this pref is set, the caret will be visible in the text of the browser, allowing the user to cursor around the html content as if in a read-only editor */ moz 0.9 special content notifications the w3c uaag specifies types of content that must be optional.
... the intention is for a user to be notified of its existence, and at some point they can choose to load the content.
...how we expose this through the user interface is another matter.
...And 2 more matches
A bird's-eye view of the Mozilla framework
the article focuses on the architecture of the overall framework supporting the mozilla application suite, not the architecture of the individual applications themselves.
...the client object does not need to know anything about the internal structure or implementation of the provider object in order to take advantage of its services.
... scripting languages such as javascript cannot directly access xpcom components, but access them indirectly using xpconnect.
...And 2 more matches
Choosing the right memory allocator
ns_alloc() == nsimemory::alloc() ns_realloc() == nsimemory::realloc() ns_free() == nsimemory::free() nsmemory::clone() (note: not part of nsimemory) see infallible memory allocation for information about how to allocate memory infallibly; that is, how to use memory allocators that will only return valid memory buffers, and never return null.
... do not use nscrt::strdup for returning values from an xpcom object, as that uses a different allocator.
... pr_alloc() (do not use, no users and only exists in /security/; use pr_malloc() instead) pr_malloc() == pr_malloc pr_calloc() == pr_calloc pr_realloc() == pr_realloc pr_free() pr_new (pass in a struct to allocate its size) pr_newzap (same as pr_new, but zeros memory) pr_delete (pr_free() and also clears the pointer) pr_freeif special cases pr_smprintf(), pr_sprintf_append(), pr_vsmprintf() and pr_vsprintf_append() must be freed with pr_smprintf_free() pl_strdup(), pl_strndup() must be freed with pl_strfree() nscrt::strdup/nscrt::strndup must be freed with nscrt::free allocati...
...And 2 more matches
Makefile - variables
note: non-functional links can be fixed by inserting en/.
... static_dirs subdirectories containing static makefiles that are not autogenerated.
... no_ variable description no_profile_guided_optimize inhibit pgo builds no_dist_install note: values will be appended to the export variable when present.
...And 2 more matches
Simple SeaMonkey build
high speed internet installing build tools if your system is not listed below, see the build prerequisites page.
... debian linux: # this one-liner should install all necessary build deps sudo aptitude install zip mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev libidl-dev mesa-common-dev autoconf2.13 yasm libgtk2.0-dev libdbus-1-dev libdbus-glib-1-dev python-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libpulse-dev ubuntu linux # for ubuntu 12.04 lts (precise pangolin), replace the following line with: sudo apt-get build-dep thunderbird sudo apt-get build-dep seamonkey sudo apt-get install zip unzip mercurial g++ make autoconf2.13 yasm libgtk2.0-dev libglib2.0-dev libdbus-1-dev libdbus-glib-1-dev libasound2-dev libcurl4-openssl-dev libnotify-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libiw-dev libxt-dev me...
...(if you get a message saying this application did not install properly then you should see a windows dialog giving you the option to re-install with the 'correct settings'.
...And 2 more matches
pymake
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.
... note: on windows, you must take special care to be able to switch back and forth between gmake and pymake on the same object dir.
...And 2 more matches
ESLint
understanding rules and errors not all files are linted currently eslint runs on: .js .jsx .jsm .xml .html .xhtml additionally, some directories and files are ignored, see the .eslintignore file handling errors if your code fails an eslint rule, you'll get an error similar to this: /gecko/toolkit/mozapps/installer/js-compare-ast.js 18:39 error 'snarf' is not defined.
... node.js is not recognized add it to your path environment variable by running path="$path:/path/to/node.js/".
... foo.jsm exports a symbol, but that is not recognised by eslint check it is listed correctly in tools/lint/eslint/modules.json using services.scriptloader.loadsubscript?
...And 2 more matches
Interface Compatibility
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.
...jetpack the jetpack sdk and apis are not yet complete.
...this includes not only xpcom interfaces, but javascript functions, xbl bindings, and any other visible behavior.
...And 2 more matches
Frame script environment
in particular, note that a frame script accesses the dom window using content, not window: // frame script var links = content.document.getelementsbytagname("a"); all of the frame scripts running in a tab share this global.
... however, any top-level variables defined by a script are not stored on the global: instead, top-level variables are stored in a special per-script object that delegates to the per-tab global.
... this means you don't have to worry about global variables you define conflicting with global variables defined by another frame script.
...And 2 more matches
HTMLIFrameElement.executeScript()
note: use of the browser api requires a privileged app, and browser and/or embed-apps permissions, depending on what you want to do.
... syntax var mydomrequest = instanceofhtmliframeelement.executescript(script, options); return value a domrequest object that returns an onsuccess handler if the script is successfully executed against the loaded content, or an onerror handler if not.
...http://example.com/index.html note: the options parameter does not currently seem to have much effect.
...And 2 more matches
mozbrowsercontextmenu
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.
... bubbles read only boolean whether the event normally bubbles or not.
...And 2 more matches
mozbrowsererror
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.
... bubbles read only boolean whether the event normally bubbles or not.
...And 2 more matches
mozbrowserfindchange
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.
... bubbles read only boolean whether the event normally bubbles or not.
...And 2 more matches
mozbrowsermetachange
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.
... bubbles read only boolean whether the event normally bubbles or not.
...And 2 more matches
mozbrowsershowmodalprompt
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.
... bubbles read only boolean whether the event normally bubbles or not.
...And 2 more matches
mozbrowserusernameandpasswordrequired
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.
... bubbles read only boolean whether the event normally bubbles or not.
...And 2 more matches
mozbrowservisibilitychange
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.
... bubbles read only boolean whether the event normally bubbles or not.
...And 2 more matches
HTMLIFrameElement.purgeHistory()
it only deletes history, not cookies or other stored information.
... note: to delete cookies for a firefox os app, you could call clearbrowserdata() on the actual app itself.
...}); returns either a domrequest object that returns an onsuccess handler if the history is deleted, or an onerror handler if not.
...And 2 more matches
overflow-clip-box-block
/* keyword values */ overflow-clip-box-block: padding-box; overflow-clip-box-block: content-box; /* global values */ overflow-clip-box-block: inherited; overflow-clip-box-block: initial; overflow-clip-box-block: unset; note: on gecko, by default, padding-box is used everywhere, but <input type="text"> and similar use the value content-box.
... note that this property is activated by default only in the ua stylesheet and chrome contexts.
... value not found in db!
...And 2 more matches
overflow-clip-box-inline
/* keyword values */ overflow-clip-box-inline: padding-box; overflow-clip-box-inline: content-box; /* global values */ overflow-clip-box-inline: inherited; overflow-clip-box-inline: initial; overflow-clip-box-inline: unset; note: on gecko, by default, padding-box is used everywhere, but <input type="text"> and similar use the value content-box.
... note that this property is activated by default only in the ua stylesheet and chrome contexts.
... value not found in db!
...And 2 more matches
overflow-clip-box
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.
... /* keyword values */ overflow-clip-box: padding-box; overflow-clip-box: content-box; /* two values */ overflow-clip-box: padding-box content-box; overflow-clip-box: content-box content-box; /* global values */ overflow-clip-box: inherit; overflow-clip-box: initial; overflow-clip-box: unset; note: on gecko, by default, padding-box is used everywhere, but <input type="text"> and similar use the value content-box.
...And 2 more matches
Embedding the editor
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.
...currently, composer does not deal gracefully with such documents.
...And 2 more matches
Implementing QueryInterface
a reference implementation of queryinterface ns_imethodimp nsmyimplementation::queryinterface( refnsiid aiid, void** ainstanceptr ) { ns_assertion(ainstanceptr, "queryinterface requires a non-null destination!"); // it's a logic error, not a runtime error, to call me without any place to put my answer!
... it addrefs the resulting interface, not this, thus following the com-correct way (particularly important in aggregation) it uses nscomtypeinfo<t>::getiid() instead of ktiid thus saving a global declaration and global space it uses c 's static_cast, via ns_static_cast, which detects errors when you can't really get to the desired interface.
...ns_assertion(ainstanceptr, "queryinterface requires a non-null destination!"); 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); // note: don't check for |nsisupports|; |nsbaseimplementation| will do that for me.
...And 2 more matches
JavaScript Tips
var uniquename = { _privatemember: 3, publicmember: "a string", init: function() { this.dosomething(this.anothermember); }, dosomething: function(aparam) { alert(aparam); } }; xpconnect don't use object methods and properties more than you have to.
...you do not have to query interfaces to compare objects, nor to pass objects as parameters (this is different from c++, where you do have to query interfaces in both cases).
...however, this is not always necessary or desirable.
...And 2 more matches
Localization and Plurals
pluralrule=0 seconds=秒 minutes=分 hours=時 days=日 polish there's a singular form for 1, a plural form for 2-4, and another for 5-21 at which point 22 is the same as 2.
... plural rule #7 has a "ends in 2-4, not 12-14" but the singular form includes everything ending in 1 except 11.
...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.
...And 2 more matches
SVN for Localizers
note: if you do not already have access to svn, visit this wiki page on how to get set up with an svn account before proceeding.
... note: we use the terms stage and prod (abbreviations of the terms staging and production) to refer to testing and publicly visible websites, respectively.
... note: the directory you create will be located inside the directory that you're currently in with your console (or cygwin console).
...And 2 more matches
MathML In Action
you already have a mathml-enabled build but what you see on the screenshot is not what you get?
...mathml in mozilla aims at complying with the mathml specification so that what you see is what you markup, or to put it another way what you see is what you made, or in short "wysiwym".
...as you try out mathml in mozilla, what to do with those few things that appear to you not to work as per the mathml spec?
...And 2 more matches
Mozilla Web Services Security Model
overview (this document is being compiled from scattered documentation and source code and most of the information in it has not been verified.
... please do not depend on anything in it being correct for security.) to prevent the browser from being used as a tool for web sites to obtain priveleges that belong to the browser's user (such as being behind a firewall or getting the benefits of the user's cookies), web browsers restrict what web pages can do when accessing things in other domains.
...this is the same as not having a type attribute.
...And 2 more matches
Activity Monitor, Battery Status Menu and top
note: the power profiling overview is worth reading at this point if you haven't already.
...(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.
...if a laptop is closed for several hours and then reopened, those hours are not included in the calculation.) battery status menu when you click on the battery icon in the os x menu bar you get a drop-down menu that includes a list of “apps using significant energy”.
...And 2 more matches
Profiling with Xperf
(note that it's not the first version number in the about window; that's the windows version.) if you have an older version, you will experience bugs, especially around symbol loading for local builds.
... you'll have to agree to a eula for the microsoft symbols -- if you're not prompted for this, then something isn't configured right in your symbol path.
...i'm not going to repeat it here, because i'd be using essentially the same screenshots, so go look there.
...And 2 more matches
tools/power/rapl
note: the power profiling overview is worth reading at this point if you haven't already.
...note that if you do change this file, its contents may reset when the machine is next rebooted.
... windows unfortunately, rapl does not work on windows, and porting it would be difficult because windows does not have apis that allow easy access to the relevant model-specific registers.
...And 2 more matches
Profile Manager
firefox provides a built-in applet to manage these profiles, but it will eventually be going away (see bug 214675), so a new standalone profile manager application has been created, which works with any xulrunner application, and has many features not found in firefox's built-in version.
... downloading binaries you can download profile manager builds from https://ftp.mozilla.org/pub/mozilla.org/utilities/profilemanager/1.0/ note: there is no installer; just extract the files from the archive.
... launch option command line argument run firefox in offline mode -offline run firefox in safe mode -safe-mode start firefox with a console -console start new instance -no-remote note: it isn't possible to start a second instance of firefox without passing it the -no-remote command line argument.
...And 2 more matches
A guide to searching crash reports
note that because the proto signature includes the entire signature, things aren't grouped all that well.
...they apply to the "crash reports" tab of any search results, and are not related to grouping.) the "facet on" field is the one that controls grouping.
...for that reason, the percentages do not add up to 100.
...And 2 more matches
PR_AttachThread
if unsuccessful, for example if system resources are not available, null.
... description you use pr_attachthread when you want to use nss functions on the native thread that was not created with nspr.
... note: as of nspr release v3.0, pr_attachthread and pr_detachthread are obsolete.
...And 2 more matches
PR_WaitCondVar
timeout the value pr_interval_no_timeout requires that a condition be notified (or the thread interrupted) before it will resume from the wait.
... if unsuccessful (for example, if the caller has not locked the lock associated with the condition variable or the thread was interrupted with pr_interrupt), pr_failure.
...after a call to pr_waitcondvar, the lock is released and the thread is blocked in a "waiting on condition" state until another thread notifies the condition or a caller-specified amount of time expires.
...And 2 more matches
NSS Code Coverage
if file was tested, link points to annotated source file (in tcov directory), otherwise to original source file (cvs directory).
... red: file not tested.
... file is not part of any binary or library used by test suite.
...And 2 more matches
NSS FAQ
MozillaProjectsNSSFAQ
it does not support pkcs #11.
...it contains bugs that were never fixed, doesn't support tls or or the new 56-bit export cipher suites, and does not contain the fix to the bleichenbacher attack on pkcs#1.
...it was built as an example of an ssl implementation, not for creating production applications.
...And 2 more matches
JSS
MozillaProjectsNSSJSS
jss source should now be checked out from the github: git clone git@github.com:dogtagpki/jss.git -- or -- git clone https://github.com/dogtagpki/jss.git all future upstream enquiries to jss should now use the pagure issue tracker system: https://pagure.io/jss/issues documentation regarding the jss project should now be viewed at: http://www.dogtagpki.org/wiki/jss note: as much of the jss documentation is sorely out-of-date, updated information will be a work in progress, and many portions of any legacy documentation will be re-written over the course of time.
...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 library but not found in jsse.
... jss offers a jce provider, "mozilla-jss" jca provider notes.
...And 2 more matches
NSS Sample Code sample2
* note: iv is only needed if cipher blocking chaining (cbc) mode of encryption * is used * * the recommended approach is to store and transport wrapped (encrypted) * des keys (ivs can be in the clear).
... * this code uses the simplest of the init functions, which does not * require a nss database to exist */ rv = nss_nodb_init("."); if (rv != secsuccess) { fprintf(stderr, "nss initialization failed (err %d)\n", pr_geterror()); goto out; } /* choose mechanism: ckm_des_cbc_pad, ckm_des3_ecb, ckm_des3_cbc.....
... * note that some mechanisms (*_pad) imply the padding is handled for you * by nss.
...And 2 more matches
Build instructions
(for posix shells), variable=value; export variable gmake target1 target2 here are some (not all) of the make variables that affect nss builds: build_opt: if set to 1, means do optimized non-debug build.
... 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 32-bit abi, except on platforms that do not support a 32-bit abi.
...And 2 more matches
NSS_Initialize
nss_init_forceopen - continue to force initializations even if the databases cannot be opened.
...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.
...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, java sunpkcs11 provider.
...And 2 more matches
gtstd.html
although it is possible to use nss command line tools to operate a proper ca, these instructions do not provide nearly enough understanding of the many considerations required to competently operate a ca.
... the nss teams strongly recommends that users should not attempt to operate a ca for use in mission critical production business uses using nss's command line tools, nor with the simple command line test tools that come with any package of cryptographic libraries.
...note that this step generates the server's private key, so it must be done in the server's database directory.
...And 2 more matches
NSS tools : crlutil
MozillaProjectsNSStoolscrlutil
changing the names of the certificate and key databases is not recommended.
...if options -m|-g is used and -c crl-script-file is not specified, crlutil will read script data from standard input.
...if this argument is not used the output destination defaults to standard output.
...And 2 more matches
Proxies in Necko
this means that callers can just create an nsichannel, not needing to worry about whether the channel will use a proxy or not the basic interfaces for proxies are: nsiproxyinfo, nsiprotocolproxyservice, and nsiproxiedprotocolhandler nsiproxyinfo is a simple helper which stores information about the type of the proxy, its host and its port.
...if this protocol handler does not support proxies, resolve returns null.
...note that the proxy method is only used when the protocol handler supports http proxies, as indicated by its protocol flags.
...And 2 more matches
Installing Pork
svn co https://mcpp.svn.sourceforge.net/svnroot/mcpp/trunk mcpp cd mcpp ./configure --enable-replace-cpp make sudo make install note: if you followed the dehydra installation instructions for linux and compiled your own gcc, then you should not need to "sudo" make install.
... hg clone http://hg.mozilla.org/rewriting-and-analysis/pork/ cd pork hg clone http://hg.mozilla.org/rewriting-and-analysis/elsa ./configure make building mozilla with mcpp to build mozilla with mcpp to generate annotated .ii files, use the following configure command: ac_cv_visibility_hidden=no cc="gcc34 -save-temps -wp,-w0,-k" cxx="g++ -save-temps -wp,-w0,-k" cppflags=-dns_disable_literal_template $srcdir/configure --enable-debug --disable-optimize --disable-accessibility --enable-application=browser --disable-crashreporter building will probably require disabling warnings_as_errors: make warnings_as_err...
...in particular, -k tells mcpp to add the macro annotations we use to get exact source positions.
...And 2 more matches
Self-hosted builtins in SpiderMonkey
self-hosted code has access to some functionality that's not available to normal js code.
... self-hosted functions by default are not constructors and do not have a prototype property, so that they meet the requirements for standard built-in functions as described in the ecmascript language specification 5.1, clause 15.
...not changeable by client js code.
...And 2 more matches
JS::CallArgs
bool hasdefined(unsigned i) const returns true if the i-th zero-indexed argument is present and is not undefined.
...must not be called after rval() has been used!
...must not be called after rval() has been used!
...And 2 more matches
JSClass.flags
if the global object does not have this flag, then scripts may cause nonstandard behavior by replacing standard constructors or prototypes (such as function.prototype.) objects that can end up with the wrong prototype object, if this flag is not present, include: arguments objects (ecma 262-3 §10.1.8 specifies "the original object prototype"), function objects (ecma 262-3 §13.2 specifies "the original function prototyp...
... it results in finalization work being offloaded to another thread which improves performance.
... jsclass_new_enumerate obsolete since jsapi 37 this class's enumerate hook is actually a jsnewenumerateop, not a jsenumerateop.
...And 2 more matches
JSDeletePropertyOp
the callback does not need to call js_beginrequest()).
... if a jsdeletepropertyop does nothing and returns true, then property delete is unaffected.
... if no error occurred and the deletion wasn't disallowed (this is *not* the same as saying that a deletion actually occurred -- deleting a non-existent property, or an inherited property, is allowed -- it's just pointless), set *succeeded to true and return true.
...And 2 more matches
JSFastNative
the callback does not need to call js_beginrequest()).
... native methods must not call js_callee after calling js_set_rval.
... native methods must not call js_this after calling js_set_rval.
...And 2 more matches
JSNewResolveOp
on success, the resolve hook must set *objp to the object in which the property has been defined, or null if it was not defined.
...on success, the callback must set the *objp out parameter to null if id was not resolved; or non-null, referring to obj or one of its prototypes, if id was resolved; and return js_true.
...when using jsclass_new_resolve_gets_start, the resolve hook must therefore null *objp to signify "not resolved".
...And 2 more matches
JSObjectOps.lookupProperty
jsobjectops is not a supported api.
...this documentation should be considered spidermonkey internals documentation, not api documentation.
... the jsobjectops.lookupproperty callback is called for every property access (except when a higher-level callback, such as jsobjectops.getproperty, is overloaded in a way that does not call lookupproperty).
...And 2 more matches
JSResolveOp
description jsresolveop callback is a hook which is called when a property is not found on an object.
... note: jsnewresolveop provides a cheaper way to resolve lazy properties.
... jsclass hooks jsclass offers the following hook: jsclass.resolve callback is called when a property is not found on an object.
...And 2 more matches
JS_Add*Root
of the jsval variable to root spp jsstring ** (in js_addstringroot and js_addnamedstringroot) the address of the jsstring* variable to root opp jsobject ** (in js_addobjectroot and js_addnamedobjectroot) the address of the jsobject* variable to root rp void ** (in js_addgcthingroot and js_addnamedgcthingroot) the address of the jsstring* or jsobject* (not jsval) variable to root name const char * (in js_addnamedroot and js_addnamedrootrt) the name of the new root, or null.
...(for example, it must not be an uninitialized local variable.
...note that this means that if the root is meant to live past the end of a function, the address of a local (stack-based) variable may not be used for rp.
...And 2 more matches
JS_AliasElement
an alias does not replace an element's current index number; it supplements it, providing a second way to reference the element.
...adding an alias element does not change the element array length.
... if the property name you specify does not exist, js_aliaselement reports an error, and returns js_false.
...And 2 more matches
JS_DefineObject
create an object that is a property of another object.
... js_defineobject does not call clasp->constructor.
...on error or exception (if the object cannot be created, the property already exists, or the property cannot be created), js_defineobject returns null.
...And 2 more matches
JS_DeleteProperty
these functions are identical to js_deleteproperty2 and js_deletepropertybyid2 except that they do not have an out parameter.
...no property is deleted, but this is not an error.
... if obj has the specified property but it is permanent, nothing happens.
...And 2 more matches
JS_LookupProperty
there is no way to tell the difference between not finding any property and finding a property whose value is undefined.
...objects may pretend that the property does not exist when this flag is set.
...do not automatically infer and enable other flags by looking at the currently executing bytecode.
...And 2 more matches
JS_SetOperationCallback
the callback does not need to call js_beginrequest()).
... applications must not use both the operation callback api and the older branch callback api.
...the embedding should thus not rely on callbacks being triggered through the external api only.
...And 2 more matches
JS_SetOptions
the caller may not modify objects on the scope chain between compilation and execution.
... 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_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.
...And 2 more matches
JS_SetParent
this must be an object that has not yet been exposed to script.
... each object may have at most one parent, which is another object.
...scripts can determine an object's parent by using the __parent__ property, but scripts cannot assign to the __parent__ property.
...And 2 more matches
JS_SetPropertyAttributes
flag indicating whether or not the specified property was located.
... jsprop_permanent property cannot be deleted.
... if js_setpropertyattributes cannot locate an object with the specified property, it returns js_false, and the value left in *foundp is undefined.
...And 2 more matches
JS_ShutDown
free all resources used by the js engine, not associated with specific runtimes.
... syntax void js_shutdown(void); description destroys all free-standing resources allocated by spidermonkey, not associated with any jsruntime, jscontext, or other structure.
...this may not always be the case; it's recommended that all embedders call this method when all other jsapi operations have completed, to be future-proof.
...And 2 more matches
Setting up CDT to work on SpiderMonkey
there is a guide for setting up cdt to work with the mozilla codebase, but it does not cover setting things up for just spidermonkey instead of the whole mozilla codebase.
... the initial build was in clang, so the modified build commands look like this: mkdir _dbg.obj cd _dbg.obj cc='clang -qunused-arguments -fcolor-diagnostics' cxx='clang++ -qunused-arguments -fcolor-diagnostics' \ ../configure --enable-debug --disable-optimize --enable-debug-symbols note: if you want to use ccache, you can enable it by adding --with-ccache to the arguments list.
...still, there are a quite a few things that cdt does not pick up yet: for everything to be indexed, cdt has to be aware of the project's build details.
...And 2 more matches
TPS Bookmark Lists
all bookmark 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.
...if the second item in a given folder is not directly after the first item in that folder, it's an error.
...And 2 more matches
Exploitable crashes
a crash report from your debugger, your os, or mozilla crash-stats can tell you a lot about whether or not a crash is potentially exploitable.
...these bugs cause the browser to crash, but they do so in a predictable way, so they are not exploitable.
...like null dereferences, these crashes are not exploitable.
...And 2 more matches
Manipulating bookmarks using Places
you can easily change this code to insert the new folder into the bookmarks toolbar by changing bookmarksmenufolder to another folder attribute.
... note: all annotations, tags, and so forth are kept when the bookmark's uri is changed.
...os = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("http://mozilla.com/", null, null); if (!bmsvc.isbookmarked(uri)) { bmsvc.insertbookmark(bmsvc.toolbarfolder, uri, bmsvc.default_index, "mozilla"); } this example looks to see if the user already has a bookmark for the mozilla web site, and, if not, creates one, adding it to the user's bookmarks toolbar.
...And 2 more matches
Using the Places keywords API
a keyword can only be associated to a given url, it's not possible to associate the same keyword with multiple urls (doing so will just update the url it's pointing to).
... note this is the same feature previously known as bookmark keywords, the key difference is that keywords are not bound to a specific bookmark, but to a specific url.
... placesutils.keywords.insert({ keyword: "my_keyword", url: "http://www.example.com/" postdata: "post+data=1&test=2" }).then(() => { /* success */ }, e => { /* failure */ }); note that setting an already existing keyword to a different url, will silently update the existing keyword to the new url.
...And 2 more matches
XML Extras
not as just another document format.
...some properties are not implemented.
...normally your files should reside on a webserver so this shouldn't pose a problem (there you do not need that line either).
...And 2 more matches
Creating a Python XPCOM component
(note that some details may be missing.) preparation if a binary of pyxpcom is not available, you will need to build it - see building pyxpcom.
...this is not necessary when your components are loaded by mozilla as the python loader modifies sys.path.
...note: there are exceptions; see this discussion for information on the use of string and wstring for unicode transfer.
...And 2 more matches
Packaging WebLock
note: the emphasis of this tutorial is on the component development itself, so this section on packaging and installing extensions to gecko is necessarily brief.
... the chrome registry lives in a series of rdf/xml files in the application directory of mozilla and other gecko-based browsers, where new installs, user configurable data, skins, and other information are related to one another and the application itself.
...the archive, its subdirectory structure, and its contents should look like this: weblock.xpi archive viewed in winzip note that the top level of the archive holds the install.js installation file, an rdf manifest for the package as a whole, and the component files (weblock.xpt and weblock4.dll).
...And 2 more matches
Making cross-thread calls using runnables
however, it may be useful for c++ code in the mozilla platform to run tasks on another thread.
...each runnable represents a task which can then be dispatched to another thread for execution.
... note: javascript code cannot use the techniques described in this article.
...And 2 more matches
XPCOM guide
MozillaTechXPCOMGuide
that's not inherently multiple inheritance, though, because you only mix in interfaces (i.e.
... the problem would not exist with java's interfaces).making cross-thread calls using runnablesin the mozilla platform, most activities such as layout, dom operations, content javascript, and chrome javascript run on the main thread.
... however, it may be useful for c++ code in the mozilla platform to run tasks on another thread.mozilla internal string guidemost of the mozilla code uses a c++ class hierarchy to pass string data, rather than using raw pointers.
...And 2 more matches
Components.utils.importGlobalProperties
this function is not intended for sandboxes but for system-privileged scopes.
...file nsidomfile indexeddb nodefilter firefox 60 nsidomnodefilter obsolete since gecko 60 rtcidentityprovider textdecoder textencoder url urlsearchparams xmlhttprequest nsixmlhttprequest obsolete since gecko 60 for string/object in table without a minimum firefox version, it is not exactly known since when it was available, however it is guranteed available from firefox 28 and up.
... 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.
...And 2 more matches
XPConnect wrappers
note: wrappers can appear in the console log; for example "[object xraywrapper [object blah]]".
... they are implicitly created by xpconnect and you should not have to worry about how that happens.
... these wrappers are created by xpconnect, so you should not have to worry about how to construct them or whether to construct them.
...And 2 more matches
IAccessibleApplication
other-licenses/ia2/accessibleapplication.idlnot scriptable this interface gives access to the application's name and version information.
... return value s_false if there is nothing to return, [out] value is null.
... return value s_false if there is nothing to return, [out] value is null.
...And 2 more matches
mozIThirdPartyUtil
obtain the bottommost nsidomwindow, and its same-type parent if it exists, from the channel's notification callbacks.
...this represents the case where a toplevel load is occurring and the window's uri has not yet been updated.
... (we have already checked that auri is not foreign with respect to the channel uri.) otherwise, return the result of isthirdpartywindow() with arguments of the channel's bottommost window and the channel uri, respectively.
...And 2 more matches
nsIAccessNode
ildnum); obsolete since gecko 2.0 nsidomcssprimitivevalue getcomputedstylecssvalue(in domstring pseudoelt, in domstring propertyname); domstring getcomputedstylevalue(in domstring pseudoelt, in domstring propertyname); void scrollto(in unsigned long ascrolltype); void scrolltopoint(in unsigned long acoordinatetype, in long ax, in long ay); attributes note: attempting to access the attributes of a node that is unattached from the accessible tree will result in an exception - ns_error_failure.
...note: renamed from accessibledocument in gecko 2.0 domnode node the dom node this nsiaccessnode is associated with.
...obsolete since gecko 2.0 innerhtml domstring the innerhtml for the dom node this is a text string of all the markup inside the dom node, not including the start and end tag for the node.
...And 2 more matches
nsIAccessibleRelation
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.
... note: the label and description (see relation_described_by) relations may be used to prevent redundant information from being presented by the screen reader, since the label and description can occur both on their own, and in the name or description fields of an nsiaccessible.
... relation_flows_to 0x07 content flows from this object to a target object, that is has content that flows logically to another object in a sequential way, for example text flow.
...And 2 more matches
nsIAccessibleRetrieval
does not create a new one -- only returns cached accessibles.
... return value the nsiaccessible for the given dom node or null if an accessible does not already exist for this dom node.
...does not create a new one -- only returns cached access nodes.
...And 2 more matches
nsIAppShell
widget/public/nsiappshell.idlnot scriptable interface for the native event system layer.
...favorperformancehint() give hint to native event queue notification mechanism.
...do not leave until exit() is called.
...And 2 more matches
nsIAsyncStreamCopier
netwerk/base/public/nsiasyncstreamcopier.idlscriptable this interface is used to copy the contents of one stream to another.
...the specified observer is notified when the copy completes.
... void asynccopy( in nsirequestobserver aobserver, in nsisupports aobservercontext ); parameters aobserver receives notifications.
...And 2 more matches
nsIAuthModule
the other methods cannot be called unless this method succeeds.
... void init( in string aservicename, in unsigned long aserviceflags, in wstring adomain, in wstring ausername, in wstring apassword ); parameters aservicename the service name, which may be null if not applicable (for example, for ntlm, this parameter should be null).
...adomain the authentication domain, which may be null if not applicable.
...And 2 more matches
nsIControllers
xul elements can also have controllers, although they do not have any default controllers.
...you should not normally need to create an instance, as you normally need to alter the window or element's existing list of controllers.
...exceptions thrown ns_error_failure the controller is not in the list of controllers.
...And 2 more matches
nsIDBChangeListener
the nsidbchangelistener interface is used by components wanting to receive notification when the current database changes somehow.
... example here is an example implementation of the listener (that does nothing): var mylistener = { onhdrflagschanged: function(ahdrchanged, aoldflags, anewflags, ainstigator) {}, onhdrdeleted: function(ahdrchanged, aparentkey, aflags, ainstigator) {}, onhdradded: function(ahdrchanged, aparentkey, aflags, ainstigator) {}, onparentchanged: function(akeychanged, oldparent, newparent, ainstigator) {}, onannouncergoingaway: function(ainstigator) {}, onreadchanged: function(ainstigator) {}, onjunkscorechanged: function(ainstigator) {}, onhdrpropertychanged: function(ahdrtochange, aprechange, astatus, ainstigator) {}, onevent: function(adb, aevent) {}, queryinterface: function(aiid) { if (!aiid.equals(components.interfaces.nsidbchangelistener) && !aiid.equals(comp...
...on this second call, the stored value of astatus is provided, so that any changes may be noted.
...And 2 more matches
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.
... alistener the listener to be notified when the result is available.
...if not null, this parameter specifies the nsieventtarget of the thread on which the listener's onlookupcomplete should be called.
...And 2 more matches
nsIDOMHTMLAudioElement
nged in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsidomhtmlmediaelement method overview unsigned long long mozcurrentsampleoffset(); void mozsetup(in pruint32 channels, in pruint32 rate); [implicit_jscontext] unsigned long mozwriteaudio(in jsval data); methods mozcurrentsampleoffset() non-standard this feature is non-standard and is not on a standards track.
... do not use it on production sites facing the web: it will not work for every user.
...mozsetup() non-standard this feature is non-standard and is not on a standards track.
...And 2 more matches
nsIDOMMozNetworkStatsManager
note: gecko is a fast evolving project.
...you can test for the presence of the service as follows, for example: if ("moznetworkstats" in navigator) { /* networkstats is available */ } else { alert("i'm sorry, but networkstats services are not supported."); } method overview nsidomdomrequest getsamples(in nsisupports network, in jsval start, in jsval end, [optional] in jsval options /* networkstatsgetoptions */); nsidomdomrequest addalarm(in nsisupports network, in long threshold, ...
...if network stats are not available for some dates, then rxbytes and txbytes are undefined for those dates.
...And 2 more matches
nsIDragService
inherits from: nsisupports last changed in gecko 43 (firefox 43 / thunderbird 43 / seamonkey 2.40) note: using this interface directly from add-on code is deprecated.
... dragdrop_action_uninitialized 64 the action is not initialized.
...it's not used on gtk, which handles the drag popup itself.
...And 2 more matches
nsIDynamicContainer
this is not guaranteed to get called.
... in particular, if the query just goes away, you will not get this call.
...the service need not worry about removing any created nodes, they will be automatically removed when this call completes.
...And 2 more matches
nsIExternalProtocolService
note: aprotocolscheme should not include a trailing colon, which is part of the uri syntax, not part of the scheme itself.
... that is, pass "mailto" not "mailto:".
...note: aprotocolscheme should not include a trailing colon, which is part of the uri syntax, not part of the scheme itself (that is pass "mailto" not "mailto:").
...And 2 more matches
nsIFaviconDataCallback
the caller will receive the most information we can gather on the icon, but it's not guaranteed that all of them will be set.
... for some method we could not know the favicon's data (it could just be too expensive to get it, or the method does not require we actually have any data).
...void oncomplete( in nsiuri auri, in unsigned long adatalen, [const,array,size_is(adatalen)] in octet adata, in autf8string amimetype ); parameters auri receives the "favicon uri" (not the "favicon link uri") associated to the requested page.
...And 2 more matches
nsIFrameLoader
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) 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.
...this can be used to decide what operations may or may not be allowed on the loader's docshell.
... capture whether or not to capture these events.
...And 2 more matches
nsIJumpListBuilder
modifying an applied jump list is not permitted.
...applications do not have control over the number of items allowed in jump lists; excess items added are dropped by the system.
...nsijumplistbuilder does not filter entries added that have been removed since the last commit.
...And 2 more matches
nsIMacDockSupport
the application should call this to activate itself when one of its dock menu items are selected, since doing so does not automatically activate the application.
...if false, the application is only activated if other applications are not currently active.
...notice the activateapplication(true), if this is not done then firefox will not be activated.
...And 2 more matches
nsIMemoryReporterManager
note: it covers all heap allocations, but will miss any operating system level ones not covered by memory reporters.
...registermultireporter() requests that memory multi-reporter notifications be sent to the specified objects.
... registerreporter() requests that memory reporter notifications be sent to the specified objects.
...And 2 more matches
nsIMicrosummaryService
return value returns the current microsummary for the bookmark, or null if the bookmark does not have a current microsummary.
... hasmicrosummary() whether or not the given bookmark has a current microsummary.
... return value returns a boolean representing whether or not the given bookmark has a current microsummary.
...And 2 more matches
nsIMsgIdentity
signaturedate long escapedvcard astring dofcc boolean fccfolder astring fccfolderpickermode astring fccreplyfollowsparent boolean draftsfolderpickermode astring tmplfolderpickermode astring bccself boolean note: don't call bccself, bccothers, and bcclist directly, they are only used for migration and backward compatability.
... valid boolean determines if the ui should use this identity and the wizard uses this to determine whether or not to ask the user to complete all the fields.
... methods clearallvalues() note: this is really dangerous!
...And 2 more matches
nsIMsgIncomingServer
for instance, local mail is not removable, but an imported folder is.
... performingbiff boolean port long prettyname astring pretty name - should be "userid on hostname" if the pref is not set.
...this destroys all pref values do not call this unless you know what you're doing!
...And 2 more matches
nsINavHistoryResult
the viewer provides notifications to the controller when view events occur; this is done using the nsinavhistoryresultviewobserver interface.
... note: keep in mind that you need to open containers for their results to be valid.
... sortingannotation autf8string the annotation to use in sort_by_annotation_* sorting modes; you must set this value before setting the sortingmode attribute.
...And 2 more matches
nsIPluginHost
(corresponds to npn_geturl and npn_geturlnotify.) posts to a url with post data and/or post headers.
... (corresponds to npn_posturl and npn_posturlnotify.) returns the proxy info for a given url.
...if the java plugin supports npruntime and instantiation was successful, aowners instance will be non-null, if not, it will be null.
...And 2 more matches
nsIPrivateBrowsingService
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.
...method overview void removedatafromdomain(in autf8string adomain); attributes attribute type description autostarted boolean indicates whether or not private browsing was started automatically at application launch time.
... lastchangedbycommandline boolean indicates whether or not the last private browsing mode transition was performed on the command line (using either the -private or -private-toggle switches) rather than the user interface.
...And 2 more matches
nsIProxyInfo
if a nsiproxyinfo is reported as failed via nsiprotocolproxyservice.getfailoverforproxy(), then the failed proxy will not be used again for this many seconds.
... note: prior to gecko 1.8 host was available by the host method.
... note: prior to gecko 1.8 port was available by the port method.
...And 2 more matches
nsISelection
as a service: var selection = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsiselection); method overview void addrange(in nsidomrange range); void collapse(in nsidomnode parentnode, in long offset); [noscript,notxpcom,nostdcall] boolean collapsed(); void collapsenative(in nsidomnode parentnode, in long offset); native code only!
... iscollapsed boolean indicates if the selection is collapsed() or not.
... collapsed() [noscript,notxpcom,nostdcall] boolean collapsed(); native code only!collapsenative void collapsenative( in nsinode parentnode, in long offset ); parameters parentnode offset collapsetoend() collapses the whole selection to a single point at the end of the current selection (regardless of direction).
...And 2 more matches
nsIServerSocket
the listener will be notified once for each client connection that is accepted.
... void asynclisten( in nsiserversocketlistener alistener ); parameters alistener the listener to be notified when client connections are accepted.
...this does not affect already connected client sockets (i.e., the nsisockettransport instances created from this server socket).
...And 2 more matches
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.
... note: the interface pointer, aresult, returned by queryinterface must be released by a call to release() when it is no longer needed.
... exceptions thrown ns_error_no_interface the requested interface is not available.
...And 2 more matches
nsITaskbarPreviewController
note: although these attributes are read only, that indicates that the previews controlled by an nsitaskbarpreviewcontroller cannot alter these values.
...note that this context is not actually attached to a canvas element.
...note that this context is not actually attached to a canvas element.
...And 2 more matches
nsITaskbarWindowPreview
this interface's primary purpose is to let gecko applications take control over parts of the preview; however, certain parts of the preview are not controlled using this interface.
...this is not reflected by the visible attribute.
... note that even while the preview is hidden, its thumbnails and/or previews may still be requested by other parts of the operating system through the nsitaskbarwindowpreview's controller.
...And 2 more matches
nsIThread
warning: this method may not be called from the thread itself.
... instead, you must only call it from another thread (usually the thread that created it, or the main application thread).
... exceptions thrown ns_error_unexpected shutdown() was erroneously called from within the thread itself, the thread was not created with the thread manager's nsithreadmanager.newthread() method, or the thread is already in the process of being shut down.
...And 2 more matches
nsITransactionManager
methods addlistener() adds a listener to the transaction manager's notification list.
... listeners are notified whenever a transaction is done, undone, or redone.
...note that the transaction at the top of the redo stack will actually be at the index n-1 in the list, where n is the number of items in the list.
...And 2 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.
...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.
... isprivatedata boolean although this is not a read-only attribute, you should generally avoid changing it, since doing so may cause it not to actually reflect the status of the context in which the transferable was created.
...And 2 more matches
nsITreeSelection
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.
...And 2 more matches
nsIWebNavigation
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.
... load_flags_bypass_history 64 this flag specifies that history should not be updated.
...set with care, since setting incorrectly can cause us to assume that nothing was actually loaded in this object if the load ends up being handled by an external application.
...And 2 more matches
nsIWebProgressListener2
bprogresslistener method overview void onprogresschange64(in nsiwebprogress awebprogress, in nsirequest arequest, in long long acurselfprogress, in long long amaxselfprogress, in long long acurtotalprogress, in long long amaxtotalprogress); boolean onrefreshattempted(in nsiwebprogress awebprogress, in nsiuri arefreshuri, in long amillis, in boolean asameuri); methods onprogresschange64() notification that the progress has changed for one of the requests associated with awebprogress.
...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.
...And 2 more matches
XPCOM Interface Reference
ypertextnsiaccessibleimagensiaccessibleprovidernsiaccessiblerelationnsiaccessibleretrievalnsiaccessiblerolensiaccessiblescrolltypensiaccessibleselectablensiaccessiblestatechangeeventnsiaccessiblestatesnsiaccessibletablensiaccessibletablecellnsiaccessibletablechangeeventnsiaccessibletextnsiaccessibletextchangeeventnsiaccessibletreecachensiaccessiblevaluensiaccessiblewin32objectnsialertsservicensiannotationobservernsiannotationservicensiappshellnsiappshellservicensiappstartupnsiappstartup_mozilla_2_0nsiapplicationcachensiapplicationcachechannelnsiapplicationcachecontainernsiapplicationcachenamespacensiapplicationcacheservicensiapplicationupdateservicensiarraynsiasyncinputstreamnsiasyncoutputstreamnsiasyncstreamcopiernsiasyncverifyredirectcallbacknsiauthinformationnsiauthmodulensiauthpromptnsiau...
...e2nsicookieacceptdialognsicookieconsentnsicookiemanagernsicookiemanager2nsicookiepermissionnsicookiepromptservicensicookieservicensicookiestoragensicrashreporternsicryptohmacnsicryptohashnsicurrentcharsetlistenernsicyclecollectorlistenernsidbchangelistenernsidbfolderinfonsidnslistenernsidnsrecordnsidnsrequestnsidnsservicensidomcanvasrenderingcontext2dnsidomchromewindownsidomclientrectnsidomdesktopnotificationnsidomdesktopnotificationcenternsidomelementnsidomeventnsidomeventgroupnsidomeventlistenernsidomeventtargetnsidomfilensidomfileerrornsidomfileexceptionnsidomfilelistnsidomfilereadernsidomfontfacensidomfontfacelistnsidomgeogeolocationnsidomgeopositionnsidomgeopositionaddressnsidomgeopositioncallbacknsidomgeopositioncoordsnsidomgeopositionerrornsidomgeopositionerrorcallbacknsidomgeoposition...
...optionsnsidomglobalpropertyinitializernsidomhtmlaudioelementnsidomhtmlformelementnsidomhtmlmediaelementnsidomhtmlsourceelementnsidomhtmltimerangesnsidomjswindownsidommousescrolleventnsidommoznetworkstatsnsidommoznetworkstatsdatansidommoznetworkstatsmanagernsidommoztoucheventnsidomnshtmldocumentnsidomnavigatordesktopnotificationnsidomnodensidomofflineresourcelistnsidomorientationeventnsidomparsernsidomprogresseventnsidomserializernsidomsimplegestureeventnsidomstoragensidomstorage2nsidomstorageeventobsoletensidomstorageitemnsidomstoragelistnsidomstoragemanagernsidomstoragewindownsidomuserdatahandlernsidomwindownsidomwindow2nsidomwindowinternalnsidomwindowutilsnsidomxpathevaluatornsidomxpathexceptionnsidomxpathexpressionnsidomxpathresultnsidomxulcontrolelementnsidomxulelementnsidomxullabeledcont...
...And 2 more matches
NS_CStringContainerInit2
flag values the aflags parameter is a bit-wise combination of the following values: ns_cstring_container_init_depend data passed into ns_cstringcontainerinit2 is not copied.
...this flag should not be combined with ns_cstring_container_init_adopt.
... ns_cstring_container_init_adopt data passed into ns_cstringcontainerinit2 is not copied.
...And 2 more matches
XPCOM ownership guidelines
this may not be appropriate; and it may be hard to remedy without knowing if the object in question was truly created in response to your query.
...or put another way: the ownership graph for any system should be acyclic.
... parents own their children (and not the reverse).
...And 2 more matches
Cached compose window FAQ
but we noticed that the common usage pattern is to compose, send, compose, send, compose send.
... if the user opens (but never sends or closes compose windows), this trick will not apply to them.
... but this is not a common usage model.
...And 2 more matches
Mailnews and Mail code review requirements
mailnews and mail review rules patches affecting thunderbird user experience or interfaces note: it is recommended that when working on bugs that affect user experience or interfaces, that ui-review is obtained at an early stage in the patch development process.
... if an automated test framework is needed but is not yet available, the developer is encouraged to write appropriate test code and commit it.
... certain build-config or tooling bugs which don't affect the actual product cannot be usefully tested.
...And 2 more matches
Using COM from js-ctypes
com is c++ and it cannot be written directly with js-ctypes.
... #include <sapi.h> struct myispvoicevtbl; struct myispvoice { struct myispvoicevtbl* lpvtbl; }; struct myispvoicevtbl { /* start inherit from iunknown */ void* queryinterface; void* addref; ulong (__stdcall *release)(struct myispvoice*); /* end inherit from iunknown */ /* start inherit from ispnotifysource */ void* setnotifysink; void* setnotifywindowmessage; void* setnotifycallbackfunction; void* setnotifycallbackinterface; void* setnotifywin32event; void* waitfornotifyevent; void* getnotifyeventhandle; /* end inherit from ispnotifysource */ /* start inherit from ispeventsource */ void* setinterest; void* getevents; void* getinfo; /* end...
...ttype('ispvoice', [{ 'lpvtbl': ispvoicevtbl.ptr }]); ispvoicevtbl.define([ // start inherit from iunknown { 'queryinterface': ctypes.voidptr_t }, { 'addref': ctypes.voidptr_t }, { 'release': ctypes.functiontype(callback_abi, ulong, // return [ ispvoice.ptr ]).ptr }, // end inherit from iunknown // start inherit from ispnotifysource // can set to ctypes.voidptr_t if arent going to use it { 'setnotifysink': ctypes.voidptr_t }, { 'setnotifywindowmessage': ctypes.voidptr_t }, { 'setnotifycallbackfunction': ctypes.voidptr_t }, { 'setnotifycallbackinterface': ctypes.voidptr_t }, { 'setnotifywin32event': ctypes.voidptr_t }, { 'waitfornotifyevent': ctypes.voidptr_t }, { 'getnotifyeventhandle...
...And 2 more matches
CData
note: this is never ctypes.void_t or an array type with an unspecified length.
... here is a method to read "malformed", it attempts to do readstring on it, if it errors then it tries to read it in another way, so this is an alternative to readstringreplacemalformed, it is an attempt at readingmalformed function readaschar8thenaschar16(stringptr, known_len, jschar) { // when reading as jschar it assumes max length of 500 // stringptr is either char or jschar, if you know its jschar for sure, pass 2nd arg as true // if known_len is passed, then assumption is not made, at the known_l...
...en position in array we will see a null char // i tried getting known_len from stringptr but its not possible, it has be known, i tried this: //"stringptr.contents.tostring()" "95" //"stringptr.tostring()" "ctypes.unsigned_char.ptr(ctypes.uint64("0x7f73d5c87650"))" // so as we see neither of these is 77, this is for the example of "_scratchpad/entehandle.js at master · noitidart/_scratchpad mdnfirefox" // tries to do read string on stringptr, if it fails then it falls to read as jschar var readjscharstring = function() { var assumption_max_len = known_len ?
...And 2 more matches
Memory - Plugins
npn_memflush requests the browser to free up a specified amount of memory if not enough is currently available for the plug-in's requirements.
...this function returns a pointer to the allocated memory or null if not enough memory is available.
...npn_memfree does not free memory allocated by other means.
...And 2 more matches
Scripting plugins - Plugins
the new nppvariable enumeration is defined in npapi.h as: nppvpluginscriptablenpobject = 15 threading model this api is not designed to be thread safe.
...future revisions to this api might provide a mechanism for proxying calls from one thread to another to aid in using this api from other threads.
...that means that a script from an origin other than the origin of the page that loaded the plugin is not able to access methods and properties on the plugin.
...And 2 more matches
All keyboard shortcuts - Firefox Developer Tools
because access keys are locale-dependent, they're not documented in this page.
... command windows macos linux open toolbox (with the most recent tool activated) ctrl + shift + i cmd + opt + i ctrl + shift + i bring toolbox to foreground (if the toolbox is in a separate window and not in foreground) ctrl + shift + i or f12 cmd + opt + i or f12 ctrl + shift + i or f12 close toolbox (if the toolbox is in a separate window and in foreground) ctrl + shift + i or f12 cmd + opt + i or f12 ctrl + shift + i or f12 open web console 1 ctrl + shift + k cmd + opt + k ctrl + shift + k toggle "pick an element from the page" (opens the to...
...unlike the other toolbox-hosted tools, this shortcut does not also close the web console.
...And 2 more matches
Network request list - Firefox Developer Tools
transferred: the number of bytes that were actually transferred to load the resource, or a message about why the resource was not transferred.
... note: (starting in firefox 80) you can also block and unblock urls from the web console, using the :block and :unblock helper commands.
...you can filter by plain text (in which case the text is used to find partial matches; entering "for" will match any message that contains the word "for") or—as of firefox 75—using regular expressions (by writing the regexp bracketed within slashes; "/.+corp.*/" will look for any occurrence of "corp" which has at least one character before it and may or may not have any characters after it, for example).
...And 2 more matches
Work with animations - Firefox Developer Tools
le(1)', filter: 'grayscale(100%)' }, { filter: 'grayscale(100%)', offset: 0.333 }, { transform: 'scale(1.5)', offset: 0.666 }, { transform: 'scale(1.5)', filter: 'grayscale(0%)' } ]; application to the example applying all this to our example, we can see that: the animation involved two elements, span#note and img#icon.
... the span#note animation: animated the width and opacity properties, to make the name gradually appear lasted 500ms, and had a delay of 150ms was given an easing value of ease-out: you can see this by the convex shape of the green bar.
...it doesn't make much sense to try to animate a geometric property and a translation at the same time — the two effects won't be synchronized — so the transform property is deliberately not handed over to the compositor to handle.
...And 2 more matches
Call Tree - Firefox Developer Tools
note that we use the same program - the same profile, in fact - in the documentation page for the flame chart.
...for example, we can expand the entry for bubblesort(): so we can see the call graph is like this: sortall() -> sort() -> bubblesort() note also that self cost for sort() here is 1.45%, and note that this is the same as for the separate entry for sort() later in the list.
...it can shoulder the blame for another 252 samples, or almost another 10% of the total cost.
...And 2 more matches
View Source - Firefox Developer Tools
error reporter ≠ validator view source only reports parsing errors, not html validity errors.
... for example, putting a <div> element as a child of a <ul> element isn't a parse error, but it is not valid html.
... therefore, this error will not be flagged in view source.
...And 2 more matches
Firefox Developer Tools
note: if you are just getting started with web development and using developer tools, our learning docs will help you — see getting started with the web and what are browser developer tools?
...(note: this feature is not turned on by default and must be enabled in settings before the icon will appear.) toggles responsive design mode.
... note: the collective term for the ui inside which the devtools all live is the toolbox.
...And 2 more matches
AesGcmParams - Web APIs
put another way: never reuse an iv with the same key.
...note that the iv does not have to be secret, just unique: so it is ok, for example, to transmit it in the clear alongside the encrypted message.
...this contains additional data that will not be encrypted but will be authenticated along with the encrypted data.
...And 2 more matches
AudioBuffer() - Web APIs
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).
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetaudiobuffer() constructorchrome full support 55notes full support 55notes notes the context parameter was supported up until version 57, but has now been removed.edge full support ≤79firefox full support 53ie no support noopera full support ...
... 42notes full support 42notes notes the context parameter was supported up until version 44, but has now been removed.safari ?
...And 2 more matches
AudioContext() - Web APIs
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.
...if not specified, the preferred sample rate for the context's output device is used by default.
... exceptions notsupportederror the specified samplerate isn't supported by the context.
...And 2 more matches
AudioWorkletGlobalScope.registerProcessor - Web APIs
note: a key-value pair { name: constructor } is saved internally in the audioworkletglobalscope once the processor is registered.
... 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.
...And 2 more matches
AudioWorkletProcessor - Web APIs
constructor the audioworkletprocessor and classes that derive from it cannot be instantiated directly from a user-supplied code.
... methods the audioworkletprocessor interface does not define any methods of its own.
... usage notes deriving classes to define custom audio processing code you have to derive a class from the audioworkletprocessor interface.
...And 2 more matches
AuthenticatorAttestationResponse.getTransports() - Web APIs
such transports may be usb, nfc, ble or internal (applicable when the authenticator is not removable from the device).
... note: an authenticatorattestationresponse 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.
...And 2 more matches
BaseAudioContext.createScriptProcessor() - Web APIs
note: as of the august 29 2014 web audio api spec publication, this feature has been marked as deprecated, and was replaced by audioworklet (see audioworkletnode).
...if it's not passed in, or if the value is 0, then the implementation will choose the best buffer size for the given environment, which will be a constant power of 2 throughout the lifetime of the node.
...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.
...And 2 more matches
Bluetooth.requestDevice() - Web APIs
exceptions typeerror the provided options do not makes sense.
... for example, options.filters is present and options.acceptalldevices is true, or if options.filters is not present and options.acceptalldevices is false.
... notfounderror there is no bluetooth device that matches the specified options.
...And 2 more matches
CSSStyleSheet.insertRule() - Web APIs
note: although insertrule() is exclusively a method of cssstylesheet, it actually inserts the rule into cssstylesheet.cssrules — its internal cssrulelist.
... restrictions css has some intuitive and not-so-intuitive restrictions affecting where rules can be inserted.
... if rule cannot be inserted at index 0 due to some css constraint, the method aborts with a hierarchyrequesterror.
...And 2 more matches
Using the CSS Painting API - Web APIs
the inputproperties() method can return all properties affecting the element, not just custom properties.
... adding complexity the above examples might not seem very exciting, as you could recreate them in a few different ways with existing css properties, e.g.
... passing parameters with the css paint api, we not only have access to custom properties and regular properties, but we can pass custom arguments to the paint() function as well.
...And 2 more matches
CacheStorage - Web APIs
the interface: provides a master directory of all the named caches that can be accessed by a serviceworker or other type of worker or window scope (you’re not limited to only using it with service workers, even though the service workers spec defines it).
... note: chrome and safari only expose `cachestorage` to the windowed context over https.
... note: cachestorage always rejects with a securityerror on untrusted origins (i.e.
...And 2 more matches
A basic ray-caster - Web APIs
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.
... so every update, the raycaster looks to see if you've pressed any keys lately, to conserve calculations by not casting if you're idle.
...not exactly a new member of the id software family, but pretty decent considering it's a fully interpreted environment, and i didn't have to worry about memory allocation or video modes or coding inner routines in assembler or anything.
...And 2 more matches
Using channel messaging - Web APIs
the channel messaging api allows two separate scripts running in different browsing contexts attached to the same document (e.g., two iframes, or the main document and an iframe, or two documents via a sharedworker) to communicate directly, passing messages between one another through two-way channels (or pipes) with a port at each end.
... note: this feature is available in web workers.
...such things are not so easy using conventional web technology, because of the security models the web uses.
...And 2 more matches
Clipboard - Web APIs
WebAPIClipboard
calls to the methods of the clipboard object will not succeed if the user hasn't granted the needed permissions using the permissions api and the "clipboard-read" or "clipboard-write" permission as appropriate.
... note: in reality, at this time browser requirements for access to the clipboard vary significantly.
... clipboard availability the asynchronous clipboard api is a relatively recent addition, and the process of implementing it in browsers is not yet complete.
...And 2 more matches
console.assert() - Web APIs
WebAPIConsoleassert
if the assertion is true, nothing happens.
... note: this feature is available in web workers.
... examples the following code example demonstrates the use of a javascript object following the assertion: const errormsg = 'the # is not even'; for (let number = 2; number <= 5; number += 1) { console.log('the # is ' + number); console.assert(number % 2 === 0, {number: number, errormsg: errormsg}); // or, using es2015 object property shorthand: // console.assert(number % 2 === 0, {number, errormsg}); } // output: // the # is 2 // the # is 3 // assertion failed: {number: 3, errormsg: "the # is not even"} // the # is...
...And 2 more matches
console.log() - Web APIs
WebAPIConsolelog
note: this feature is available in web workers.
...please be warned that if you log objects in the latest versions of chrome and firefox what you get logged on the console is a reference to the object, which is not necessarily the 'value' of the object at the moment in time you call console.log(), but it is the value of the object at the moment you open the console.
... another useful difference in chrome exists when sending dom elements to the console.
...And 2 more matches
Document.getElementsByName() - Web APIs
example <!doctype html> <html lang="en"> <title>example: using document.getelementsbyname</title> <input 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.
...be careful not to use the same string as both a name and an id.
...And 2 more matches
Introduction to the DOM - Web APIs
the dom is not a programming language, but without it, the javascript language wouldn't have any model or notion of web pages, html documents, xml documents, and their component parts (e.g.
... this following javascript will display an alert when the document is loaded (and when the whole dom is available for use): <body onload="window.alert('welcome to my home page!');"> another example.
... note: because the vast majority of code that uses the dom revolves around manipulating html documents, it's common to refer to the nodes in the dom as elements, although strictly speaking not every node is an element.
...And 2 more matches
ElementCSSInlineStyle.style - Web APIs
setting styles styles should not be set by assigning a string directly to the style property (as in elt.style = "color: blue;"), since it is considered read-only, as the style attribute returns a cssstyledeclaration object which is also read-only.
...note that the property names are in camel-case and not kebab-case while setting the style using elt.style.<property> (i.e., elt.style.fontsize, not elt.style.font-size).
...internet explorer requires setting it to an empty string, and does not do anything when setting it to null.
...And 2 more matches
EventTarget.dispatchEvent() - Web APIs
the dispatchevent() method throws unspecified_event_type_err if the event's type was not specified by initializing the event before the method was called, or if the event's type is null or an empty string.
...the event handlers run on a nested callstack; they block the caller until they complete, but exceptions do not propagate to the caller.
... notes unlike "native" events, which are fired by the dom and invoke event handlers asynchronously via the event loop, dispatchevent() invokes event handlers synchronously.
...And 2 more matches
FetchEvent.respondWith() - Web APIs
you cannot return response objects of type "cors" if the fetchevent.request object's mode is "same-origin".
... note that navigation requests for windows and iframes do not use the final url.
... exceptions exception notes networkerror a network error is triggered on certain combinations of fetchevent.request.mode and response.type values, as hinted at in the "global rules" listed above.
...And 2 more matches
FileSystemFlags.create - Web APIs
the create property on the filesystemflags dictionary is used to indicate whether or not the file should be created if it's missing.
... syntax filesystemflags.create = booleanvalue values the table below describes the result of each possible combination of these flags depending on whether or not the target file or directory path already exists.
... 13prefixed full support 13prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤79prefixed full support ≤79prefixed prefixed implemented with the vendor prefix: webkitfirefox partial support 50notes partial support 50notes notes for security reasons, firefox does not support creating files.
...And 2 more matches
FileSystemFlags.exclusive - Web APIs
the exclusive property on the filesystemflags dictionary is used in tandem with the create property to determine whether or not it's acceptable to require that the file not already exist when the reference to it is created by calling filesystemdirectoryentry.getfile() or filesystemdirectoryentry.getdirectory().
... syntax filesystemflags.exclusive = booleanvalue values the table below describes the result of each possible combination of these flags depending on whether or not the target file or directory path already exists.
... 13prefixed full support 13prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤79prefixed full support ≤79prefixed prefixed implemented with the vendor prefix: webkitfirefox partial support 50notes partial support 50notes notes for security reasons, firefox does not support creating files.
...And 2 more matches
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.
... this has caused a number of popular web sites not to work properly on browsers other than chrome.
...And 2 more matches
File and Directory Entries API - Web APIs
because this is a non-standard api, whose specification is not currently on a standards track, it's important to keep in mind that not all browsers implement it, and those that do may implement only small portions of it.
...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.
...firefox also does not implement the synchronous api.
...And 2 more matches
Using FormData Objects - Web APIs
var blob = new blob([content], { type: "text/xml"}); formdata.append("webmasterfile", blob); var request = new xmlhttprequest(); request.open("post", "http://foo.com/submitform.php"); request.send(formdata); note: the fields "userfile" and "webmasterfile" both contain a file.
... 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.
...retrieving it from a form and sending it, like this: var formelement = document.queryselector("form"); var formdata = new formdata(formelement); var request = new xmlhttprequest(); request.open("post", "submitform.php"); formdata.append("serialnumber", serialnumber++); request.send(formdata); this lets you augment the form's data before sending it along, to include additional information that's not necessarily user-editable.
...And 2 more matches
Using the Frame Timing API - Web APIs
when one of those event types is added to the browser's performance timeline, the application is notified of the event via the observer's callback function that was specified when the observer was created.
... registering for notifications after an observer is created, the next step is to use the performanceobserver.observe() method to specify the set of performance events to observe.
... in the following example, the observer only registers for "frame" performance entry notifications.
...And 2 more matches
HTMLCanvasElement - Web APIs
when the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used.
...when the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used.
...it lets the canvas know whether or not translucency will be a factor.
...And 2 more matches
HTMLFieldSetElement - Web APIs
if the field set is not a descendant of a form element, then the attribute can be the id of any form element in the same document it is related to, or the null value if none matches.
...it is not part of the data which is sent to the server.
... htmlfieldsetelement.validationmessage a domstring representing a localized message that describes the validation constraints that the element does not satisfy (if any).
...And 2 more matches
HTMLFormElement.submit() - Web APIs
this method is similar, but not identical to, activating a form's submit <button>.
...in particular, the form's onsubmit event handler is not run.
... constraint validation is not triggered.
...And 2 more matches
HTMLImageElement - Web APIs
><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlimageelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor image() the image() constructor creates and returns a new htmlimageelement object representing an html <img> element which is not attached to any dom tree.
... htmlimageelement.alt a domstring that reflects the alt html attribute, thus indicating the alternate fallback content to be displayed if the image has not been loaded.
... htmlimageelement.complete read only returns a boolean that is true if the browser has finished fetching the image, whether successful or not.
...And 2 more matches
HTMLScriptElement - Web APIs
the defer and async attributes must not be specified if the src attribute is absent.
... 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.
...And 2 more matches
HTMLSelectElement - Web APIs
if it is disabled, it does not accept clicks.
...if the element is not associated with of a <form> element, then it returns null.
... htmlselectelement.validationmessageread only a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any).
...And 2 more matches
HTMLTableRowElement - Web APIs
this property was optional and was not very well supported.
...this property was optional and was not very well supported.
...if the row is not part of a table, returns -1.
...And 2 more matches
IDBDatabase.onversionchange - Web APIs
the onversionchange event handler of the idbdatabase interface handles the versionchange event, fired when a database structure change (idbopendbrequest.onupgradeneeded event or idbfactory.deletedatabase) was requested elsewhere (most probably in another window/tab on the same computer).
... note: this feature is available in web workers.
...} example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases, and an onversionchange function to notify when a database structure change has occurred.
...And 2 more matches
IDBIndex.openKeyCursor() - Web APIs
if the key range is not specified or is null, then the range includes all the keys.
... note: cursors returned by openkeycursor() do not make the referenced value available as idbindex.opencursor does.
... note: this feature is available in web workers.
...And 2 more matches
IDBIndex - Web APIs
WebAPIIDBIndex
an index is a kind of object store for looking up records in another object store, called the referenced object store.
... note: this feature is available in web workers.
...if null, this index is not auto-populated.
...And 2 more matches
IDBObjectStore.delete() - Web APIs
note: this feature is available in web workers.
... dataerror the key is not a valid key or a key range.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...And 2 more matches
IDBOpenDBRequest.onupgradeneeded - Web APIs
note: this feature is available in web workers.
...for a full working example, see our to-do notifications app (view example live.) var db; // request version 3 of the database.
...either one has not been created // before, or a new version number has been submitted via the // window.indexeddb.open line above.
...And 2 more matches
IDBOpenDBRequest - Web APIs
note: this feature is available in web workers.
...for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these event handlers act on the database being opened.
... dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db // variable.
...And 2 more matches
IDBTransaction.abort() - Web APIs
note: this feature is available in web workers.
...note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...And 2 more matches
IDBTransaction.db - Web APIs
WebAPIIDBTransactiondb
note: this feature is available in web workers.
...note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...And 2 more matches
MSManipulationEvent.initMSManipulationEvent() - 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.
...when false the event does not propagate upward.
...And 2 more matches
MediaSession.setActionHandler() - Web APIs
these actions let a web app receive notifications when the user engages a device's built-in physical or onscreen media controls, such as play, stop, or seek buttons.
...the callback receives no input parameters, and should not return a value.
...this action may or may not be available, depending on the platform and user agent, or may be disabled due to subscription level or other circumstances.
...And 2 more matches
MediaStreamAudioSourceNode - Web APIs
exceptions invalidstateerror the stream specified by the mediastream parameter does not contain any audio tracks.
... usage notes typically, you should probably not use this type of node.
... however, it's important to note that the rule establishing this ordering was added long after this interface was first introduced into the web audio api.
...And 2 more matches
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().
... syntax var constraintsobject = { cursor: constraint }; constraintsobject.cursor = constraint; value a constraindomstring which specifies whether or not the mouse cursor should be rendered into the video track in the mediastream returned by the call to getdisplaymedia().
...And 2 more matches
MediaTrackConstraints - Web APIs
properties some combination—but not necessarily all—of the following properties will exist on the object.
...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.
... echocancellation a constrainboolean object specifying whether or not echo cancellation is preferred and/or required.
...And 2 more matches
MediaTrackSettings - Web APIs
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.
...this value is specific to the source of the track's data and is not usable for setting constraints; it can, however, be used for initially selecting media when calling mediadevices.getusermedia().
...And 2 more matches
MessageEvent.MessageEvent() - Web APIs
this can be of any data type, and will default to null if not specified.
...this defaults to an empty string ("") if not specified.
...this defaults to an empty string ("") if not specified.
...And 2 more matches
MutationObserverInit.attributeOldValue - Web APIs
the mutationobserverinit dictionary's optional attributeoldvalue property is used to specify whether or not to record the prior value of the altered attribute in mutationrecord objects denoting attribute value changes.
... syntax var options = { attributeoldvalue: true | false } value a boolean value indicating whether or not the prior value of a changed attribute should be included in the mutationobserver.oldvalue property when reporting attribute value changes.
...if false, it is not.
...And 2 more matches
MutationObserverInit.attributes - Web APIs
the mutationobserverinit dictionary's optional attributes property is used to specify whether or not to watch for attribute value changes on the node or nodes being observed.
... syntax var options = { attributes: true | false } value a boolean value indicating whether or not to report through the callback any changes to the values of attributes on the node or nodes being monitored.
... attributeoldvalue lets you specify whether or not you want the previous value of changed attributes to be included in the mutationrecord's oldvalue property.
...And 2 more matches
NDEFWriter.write() - Web APIs
WebAPINDEFWriterwrite
options optional ignoreread -- boolean specifying whether or not to skip reading for the activated reader objects.
... overwrite -- boolean specifying whether or not existing record should be overwritten, if such exists.
... notallowederror the permission for this operation was rejected or overwrite is false and there are already records on the tag.
...And 2 more matches
Navigator.cookieEnabled - Web APIs
navigator.cookieenabled returns a boolean value that indicates whether cookies are enabled or not.
... note: when the browser is configured to block third-party cookies, and navigator.cookieenabled is invoked inside a third-party iframe, it returns true in safari, edge spartan and ie (while trying to set a cookie in such scenario would fail).
... note: web browsers may prevent writing certain cookies in certain scenarios.
...And 2 more matches
Navigator.getBattery() - Web APIs
note: in some browsers access to this feature is controlled by feature-policy directive battery.
... exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, passing into it a domexception whose name is one of the following: securityerror the user agent does not expose battery information to insecure contexts and this method was called from insecure context.
... note: old versions of some user agents might allow use of this feature in insecure contexts.
...And 2 more matches
Web-based protocol handlers - Web APIs
registering setting up a web application as a protocol handler is not a difficult process.
...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.
...And 2 more matches
Node.removeChild() - Web APIs
WebAPINoderemoveChild
in the second syntax form, however, there is no oldchild reference kept, so assuming your code has not kept any other reference to the node elsewhere, it will immediately become unusable and irretrievable, and will usually be automatically deleted from memory after a short time.
... if child is actually not a child of the element node, the method throws an exception.
...l also happen if child was in fact a child of element at the time of the call, but was removed by an event handler invoked in the course of trying to remove the element (e.g., blur.) errors thrown the method throws an exception in 2 different ways: if the child was in fact a child of element and so existing on the dom, but was removed the method throws the following exception: uncaught notfounderror: failed to execute 'removechild' on 'node': the node to be removed is not a child of this node.
...And 2 more matches
NodeIterator.whatToShow - Web APIs
since attributes are never children of other nodes, they do not appear when traversing over the document tree.
...since entities are not part of the document tree, they do not appear when traversing over the document tree.
... nodefilter.show_notation 2048 shows notation nodes.
...And 2 more matches
NodeIterator - Web APIs
since attributes are never children of other nodes, they do not appear when traversing over the document tree.
...since entities are not part of the document tree, they do not appear when traversing over the document tree.
... nodefilter.show_notation 2048 shows notation nodes.
...And 2 more matches
PannerNode.maxDistance - Web APIs
the maxdistance property of the pannernode interface is a double value representing the maximum distance between the audio source and the listener, after which the volume is not reduced any further.
...the default is 10000, and non-positive values are not allowed.
... note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc.
...And 2 more matches
ParentNode.querySelector() - Web APIs
note: this method is implemented as document.queryselector(), documentfragment.queryselector() and element.queryselector().
...this string must be a valid compound selector list supported by the browser; if it's not, a syntaxerror exception is thrown.
... note: characters which are not part of standard css syntax must be escaped using a backslash character.
...And 2 more matches
Permissions.query() - Web APIs
WebAPIPermissionsquery
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.
... note: as of firefox 44, the permissions for notifications and push have been merged.
...And 2 more matches
Permissions.revoke() - Web APIs
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.
... note: as of firefox 44, the permissions for notifications and push have been merged.
...And 2 more matches
PushEvent.data - Web APIs
WebAPIPushEventdata
self.addeventlistener('push', function(event) { if (!(self.notification && self.notification.permission === 'granted')) { return; } var data = {}; if (event.data) { data = event.data.json(); } var title = data.title || "something has happened"; var message = data.message || "here's something you might want to check out."; var icon = "images/new-notification.png"; var notification = new notification(title, { body: message, ta...
...g: 'simple-push-demo-notification', icon: icon }); notification.addeventlistener('click', function() { if (clients.openwindow) { clients.openwindow('https://example.blog.com/2015/03/04/something-new.html'); } }); }); specifications specification status comment push apithe definition of 'data' in that specification.
... full support 17firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support service workers and the push api.ie no support noopera full support 44safari no support nowebview android ...
...And 2 more matches
PushManager.subscribe() - Web APIs
a new push subscription is created if the current service worker does not have an existing subscription.
...this key is not the same ecdh key that you use to encrypt the data.
... note: this parameter is required in some browsers like chrome and edge.
...And 2 more matches
RTCIceCandidate.usernameFragment - Web APIs
note that 24 bits of the username fragment are required to be randomized by the browser.
...another example: it might take a user-defined string and append three 8-bit random bytes to the end.
... usage notes ice uses the usernamefragment and password to ensure message integrity.
...And 2 more matches
RTCRtpSender.replaceTrack() - Web APIs
the new track must be of the same media kind (audio, video, etc) and switching the track should not require negotiation.
...the promise is rejected if the track cannot be replaced for any reason; this is commonly because the change would require renegotiation of the codec, which is not allowed (see things that require negotiation).
... usage notes things that trigger negotiation not all track replacements require renegotiation.
...And 2 more matches
RTCRtpSender.setParameters() - Web APIs
invalidmodificationerror one of the following problems was detected: the number of encodings specified in the parameters object's encodings property does not match the number of encodings currently listed for the rtcrtpsender.
... you cannot change the number of encoding options once the sender has been created.
... an attempt has been made to alter a property that cannot be changed after the sender is first created.
...And 2 more matches
RTCRtpStreamStats.ssrc - Web APIs
the manner in which these values are generated is not mandated by the specification, although it does make recommendations.
... you should not make any assumptions based on the value of ssrc other than that any two objects with the same ssrc value refer to the same source.
... note: the specification includes an example that generates values for ssrc using md5.
...And 2 more matches
RTCRtpTransceiver.direction - Web APIs
does not offer to receive rtp data and will not do so.
... "recvonly" does not offer to send rtp data, and will not do so.
... "inactive" does not offer to send rtp data, and will not do so.
...And 2 more matches
Screen.lockOrientation() - Web APIs
note: this method only works for installed web apps or for web pages in full-screen mode.
... note: it's possible to set several locks at the same time.
...otherwise, the screen orientation will change from an orientation to another as long as the orientations are amongst the orientations the device has been locked to.
...And 2 more matches
Selection API - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetselection experimentalchrome full support 1edge full support 12firefox full support 1notes full support 1notes notes the globaleventhandlers.onselectionchange and globaleventhandlers.onselectstart event handlers are supported as of firefox 52.ie full support 9opera full support 9safari full support 1webvie...
...w android full support 1chrome android full support 18firefox android full support 4notes full support 4notes notes the globaleventhandlers.onselectionchange and globaleventhandlers.onselectstart event handlers are supported as of firefox 52.opera android full support 10.1safari ios full support 1samsung internet android full support 1.0addrange experimentalchrome full support 1edge full support ...
... yessafari ios full support yessamsung internet android full support yescontainsnode experimentalchrome full support yesedge full support 12firefox full support 4notes full support 4notes notes before firefox 35, the method didn't throw if node was null.ie no support noopera full support yessafari full support yeswebview android full support ...
...And 2 more matches
SpeechRecognition - Web APIs
note: on some browsers, like chrome, using speech recognition on a web page involves a server-based recognition engine.
...if not specified, this defaults to the html lang attribute value, or the user agent's language setting if that isn't set either.
...defaults to single (false.) speechrecognition.interimresults controls whether interim results should be returned (true) or not (false.) interim results are results that are not yet final (e.g.
...And 2 more matches
SubtleCrypto.decrypt() - Web APIs
exceptions the promise is rejected when the following exceptions are encountered: invalidaccesserror raised when the requested operation is not valid for the provided key (e.g.
... examples note: you can try the working examples on github.
...note that counter must match the value that was used for encryption.
...And 2 more matches
SubtleCrypto.encrypt() - Web APIs
exceptions the promise is rejected when the following exceptions are encountered: invalidaccesserror raised when the requested operation is not valid for the provided key (e.g.
...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.
...while it's possible to add authentication to ctr and cbc modes, they do not provide it by default and when implementing it manually one can easily make minor, but serious mistakes.
...And 2 more matches
TextEncoder.prototype.encodeInto() - Web APIs
this may be less than string.length if uint8array did not have enough space.
...note that the s.length * 3 is rare because the string would have to be packed with some of the few characters that expant into 3 bytes.
...if not, reallocate the target buffer to written + (s.length - read) * 3 and then convert the rest by taking a substring of s starting from index read and a subbuffer of the target buffer starting from index written.
...And 2 more matches
TextRange - Web APIs
WebAPITextRange
note that this interface is not supported in non ie browsers.
... 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 valid only under ie9.
... var sel = document.selection; var range = sel.createrange(); alert(range.text); // output plaintext of the selection note that the createrange method does not create a reference.
...And 2 more matches
TreeWalker.whatToShow - Web APIs
since attributes are never children of other nodes, they do not appear when traversing over the document tree.
...since entities are not part of the document tree, they do not appear when traversing over the document tree.
... nodefilter.show_notation 2048 shows notation nodes.
...And 2 more matches
ValidityState - Web APIs
together, they help explain why an element's value fails to validate, if it's not valid.
... patternmismatch read only a boolean that is true if the value does not match the specified pattern, and false if it does match.
... stepmismatch read only a boolean that is true if the value does not fit the rules determined by the step attribute (that is, it's not evenly divisible by the step value), or false if it does fit the step rule.
...And 2 more matches
Vibration API - Web APIs
the vibration api offers web apps the ability to access this hardware, if it exists, and does nothing if the device doesn't support it.
... vibration patterns an array of values describes alternating periods in which the device is vibrating and not vibrating.
... each value in the array is converted to an integer, then interpreted alternately as the number of milliseconds the device should vibrate and the number of milliseconds it should not be vibrating.
...And 2 more matches
WebGLRenderingContext.isContextLost() - Web APIs
the webglrenderingcontext.iscontextlost() method returns a boolean indicating whether or not the webgl context has been lost and must be re-established before rendering can resume.
... syntax let islost = gl.iscontextlost(); return value a boolean which is true if the context is lost, or false if not.
... usage notes there are several reasons why a webgl context may be lost, making it necessary to re-establish the context before resuming rendering.
...And 2 more matches
WebGLRenderingContext.readPixels() - Web APIs
exceptions a gl.invalid_enum error is thrown if format or type is not an accepted value.
... a gl.invalid_operation error is thrown if type is gl.unsigned_short_5_6_5 and format is not gl.rgb.
... type is gl.unsigned_short_4_4_4_4 and format is not gl.rgba.
...And 2 more matches
Color masking - Web APIs
note that the calls to colormask() only occur when the user clicks on one of the toggle buttons.
...the color mask state of webgl is preserved, so we do not need to call colormask() every frame to set up the color mask.
... finally, color masking teaches us that webgl is not only a state machine, it is also a graphics pipeline.
...And 2 more matches
Hello GLSL - Web APIs
note: this example will most likely work in all modern desktop browsers.
... but it may not work in some mobile or older browsers.
...hello glsl!</p> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } <script type="x-shader/x-vertex" id="vertex-shader"> #version 100 void main() { gl_position = vec4(0.0, 0.0, 0.0, 1.0); gl_pointsize = 64.0; } </script> <sc...
...And 2 more matches
Adding 2D content to a WebGL context - Web APIs
// vertex shader program const vssource = ` attribute vec4 avertexposition; uniform mat4 umodelviewmatrix; uniform mat4 uprojectionmatrix; void main() { gl_position = uprojectionmatrix * umodelviewmatrix * avertexposition; } `; it's worth noting that we're using a vec4 attribute for the vertex position, which doesn't actually use a 4-component vector; that is, it could be handled as a vec2 or vec3 depending on the situation.
... in this example, we're not computing any lighting at all, since we haven't yet applied any to the scene.
...note also the lack of any work with textures here; that will be added in using textures in webgl.
...And 2 more matches
Introduction to WebRTC protocols - Web APIs
the client will send a request to a stun server on the internet who will reply with the client’s public address and whether or not the client is accessible behind the router’s nat.
...this can mean that even though we have the public ip address found by the stun server, not anyone can create a connection.
...this is, in essence, the metadata describing the content and not the media content itself.
...And 2 more matches
Taking still photos with WebRTC - Web APIs
<div class="camera"> <video id="video">video stream not available.</video> <button id="startbutton">take photo</button> </div> this is straightforward, and we'll see how it ties together when we get into the javascript code.
...this canvas is kept hidden by styling the canvas with display:none, to avoid cluttering up the screen — the user does not need to see this intermediate stage.
... streaming indicates whether or not there is currently an active stream of video running.
...And 2 more matches
Controlling multiple parameters with ConstantSourceNode - Web APIs
for example, perhaps you have a set of oscillators, and two of them need to share the same, configurable volume, or you have a filter that's been applied to certain inputs but not to all of them.
... <div class="controls"> <div class="left"> <div id="playbutton" class="button"> ▶️ </div> </div> <div class="right"> <span>volume: </span> <input type="range" min="0.0" max="1.0" step="0.01" value="0.8" name="volume" id="volumecontrol"> </div> </div> <p>use the button above to start and stop the tones, and the volume control to change the volume of the notes e and g in the chord.</p> css .controls { width: 400px; position: relative; vertical-align: middle; height: 44px; } .button { font-size: 32px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -o-user-select: none; } .right { width: 50%; font: 14px "open sans", "lucida grande", "arial", sans-serif; posi...
... playing a boolean that we'll use to keep track of whether or not we're currently playing the tones.
...And 2 more matches
Web Locks API - Web APIs
ifavailable: if specified, the lock request will fail if the lock cannot be granted immediately without waiting.
...this can be useful when debugging, for example, identifying why a lock could not be acquired.
...}); deadlocks a deadlock occurs when a process can no longer make progress because each part is waiting on a request that cannot be satisfied.
...And 2 more matches
Using the Web Speech API - Web APIs
note: on some browsers, like chrome, using speech recognition on a web page involves a server-based recognition engine.
...note how each is separated by a pipe character.
...this can sometimes be useful, say if a result is not completely clear and you want to display a list if alternatives for the user to choose the correct one from.
...And 2 more matches
Functions and classes available to Web Workers - Web APIs
workers run in another global context, dedicatedworkerglobalscope, different from the current window.
... by default, methods and properties of window are not available to them, but dedicatedworkerglobalscope, like window, implements windowtimers and windowbase64.
... 53.0 (53) only on mobile (yes) only on mobile no support no support notifications allows web pages to control the display of system notifications to the end user 41 (41) ?
...And 2 more matches
Window.fullScreen - Web APIs
WebAPIWindowfullScreen
the fullscreen property of the window interface indicates whether the window is displayed in full screen mode or not.
...bear in mind that if you try to set this property without chrome privileges, it will not throw an exception and instead just silently fail.
... false: the window is not in full screen mode.
...And 2 more matches
Window.getSelection() - Web APIs
when called on an <iframe> that is not displayed (eg.
... examples function foo() { var selobj = window.getselection(); alert(selobj); var selrange = selobj.getrangeat(0); // do stuff with the range } notes string representation of the selection object in javascript, when an object is passed to a function expecting a string (like window.alert() or document.write()), the object's tostring() method is called and the returned value is passed to the function.
...however, attempting to use a javascript string property or method such as length or substr directly on a selection object will result in an error if it does not have that property or method and may return unexpected results if it does.
...And 2 more matches
Window.ondragdrop - Web APIs
WebAPIWindowondragdrop
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.
... the window.ondragdrop property and the ondragdrop attribute are not implemented in gecko (bug 112288), you have to use addeventlistener.
...And 2 more matches
Window.setImmediate() - Web APIs
this method is not expected to become standard, and is only implemented by recent builds of internet explorer and node.js 0.10+.
... notes the clearimmediate method can be used to clear the immediate actions, just like cleartimeout for settimeout.
...do note that internet explorer 8 includes a synchronous version of postmessage, which means it cannot be used as a fallback.
...And 2 more matches
Worker - Web APIs
WebAPIWorker
(note: nested workers are not yet implemented in webkit).
... not all interfaces and functions are available to scripts inside a worker.
...this does not let worker finish its operations; it is halted at once.
...And 2 more matches
HTML in XMLHttpRequest - Web APIs
limitations to discourage the synchronous use of xmlhttprequest, html support is not available in the synchronous mode.
... function htmlinxhr() { if (!window.xmlhttprequest) return false; var req = new window.xmlhttprequest(); req.open('get', window.location.href, false); try { req.responsetype = 'document'; } catch(e) { return true; } return false; } view on jsfiddle this method is synchronous, does not rely on external assets though it may not be as reliable as method 2 described below since it does not check the actual feature but an indication of that feature.
...this test file is small and is not well-formed xml: <title>&amp;&<</title> if the file is named detect.html, the following function can be used for detecting html parsing support: function detecthtmlinxhr(callback) { if (!window.xmlhttprequest) { window.settimeout(function() { callback(false); }, 0); return; } var done = false; var xhr = new window.xmlhttprequest(); xhr.onreadystatechange = function() { if...
...And 2 more matches
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
notes: this code requires elevated privileges to run; you can only call it from a browser extension or from a xulrunner application.
... xhr.channel.queryinterface(ci.nsirequest).status; let errtype; if ((status & 0xff0000) === 0x5a0000) { // security module const nsinsserrorsservice = ci.nsinsserrorsservice; let nsserrorsservice = cc['@mozilla.org/nss_errors_service;1'].getservice(nsinsserrorsservice); let errorclass; // geterrorclass will throw a generic ns_error_failure if the error code is // somehow not in the set of covered errors.
...t failed case 0x804b000c: // ns_error_connection_refused, network(13) errname = 'connectionrefusederror'; break; // network timeout error case 0x804b000e: // ns_error_net_timeout, network(14) errname = 'networktimeouterror'; break; // hostname lookup failed case 0x804b001e: // ns_error_unknown_host, network(30) errname = 'domainnotfounderror'; break; case 0x804b0047: // ns_error_net_interrupt, network(71) errname = 'networkinterrupterror'; break; default: errname = 'networkerror'; break; } } // xxx we have no tcperror implementation right now because it's really hard to // do on b2g18.
...And 2 more matches
XMLHttpRequest.open() - Web APIs
note: calling this method for an already active request (one for which open() has already been called) is the equivalent of calling abort().
... async optional an optional boolean parameter, defaulting to true, indicating whether or not to perform the operation asynchronously.
... if this value is false, the send() method does not return until the response is received.
...And 2 more matches
XMLHttpRequest.withCredentials - Web APIs
the xmlhttprequest.withcredentials property is a boolean that indicates whether or not cross-site access-control requests should be made using credentials such as cookies, authorization headers or tls client certificates.
...xmlhttprequest from a different domain cannot set cookie values for their own domain unless withcredentials is set to true before making the request.
... the third-party cookies obtained by setting withcredentials to true will still honor same-origin policy and hence can not be accessed by the requesting script through document.cookie or from response headers.
...And 2 more matches
XMLSerializer.serializeToString() - Web APIs
exceptions typeerror the specified rootnode is not a compatible node type.
... invalidstateerror the tree could not be successfully serialized, probably due to issues with the content's compatibility with xml serialization.
... syntaxerror a serialization of html was requested but could not succeed due to the content not being well-formed.
...And 2 more matches
XRBoundedReferenceSpace.boundsGeometry - Web APIs
theoretically, a more advanced system might use sensors or other detection methods to determine the bounds of a dedicated xr room (notice how we carefully don't call it a holodeck?).
... usage notes bounded reference spaces always have their origin located at ground level, where y is 0.
... boundary size xrboundedreferencespace is not intended to be used for very large bounded areas.
...And 2 more matches
XRPermissionDescriptor.mode - Web APIs
important: the immersive-ar mode is defined by the webxr augmented reality module, which is not yet stable and should not be used other than for testing and experimentation.
... immersive-vr indicates that the rendered session will be displayed using an immersive xr device in vr mode; it is not intended to be overlaid or integrated into the surrounding environment.
...inline sessions can be presented in either mono or stereo mode, and may or may not have viewer tracking available.
...And 2 more matches
XRVisibilityState - Web APIs
the xrvisibilitystate enumerated type defines the string values which are valid for the xrsession interface's visibilitystate property, which indicates whether or not an xr session is currently visible to the user, and if it is, whether or not it's currently the primary focus.
... values hidden the virtual scene generated by the xrsession is not currently visible to the user, so its requestanimationframe() callbacks are not being executed until thevisibilitystate changes.
... input controllers are not being handled for the session.
...And 2 more matches
XRWebGLLayer() - Web APIs
otherwise, the color buffer will not have an alpha channel.
... ignoredepthvalues optional a boolean value which indicates whether or not to ignore the contents of the depth buffer while compositing the scene.
... exceptions invalidstateerror the new xrwebgllayer could not be created due to one of a number of possible state errors: the xrsession specified by session has already been stopped.
...And 2 more matches
XRWebGLLayerInit.depth - Web APIs
syntax let layerinit = { depth: false }; let gllayer = new xrwebgllayer(xrsession, gl, layerinit); let gllayer = new xrwebgllayer(xrsession, gl, { depth: false }); value a boolean which can be set to false to specify that the new webgl layer should not have a depth buffer.
... usage notes this property differs from ignoredepthvalues in that a layer created with ignoredepthvalues set to true may still have a depth buffer, but will not make use of it.
... you can determine whether or not the depth buffer is being used by a given webgl rendering layer during your xr session by checking the value returned by xrwebgllayer.ignoredepthvalues.
...And 2 more matches
msGetRegionContent - 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.
... return value type: boolean returned ranges are sorted by document position and do not overlap.
...And 2 more matches
Using the aria-describedby attribute - Accessibility
the aria-describedby attribute is not used only for form elements; it is also used to associate static text with widgets, groups of elements, panes, regions that have a heading, definitions, and more.
... 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 note: opinions may differ on how assistive technology should handle this technique.
...And 2 more matches
Using the aria-labelledby attribute - Accessibility
without an element id, the assistive technology cannot catalog the object.
... 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.
...And 2 more matches
Using the aria-valuenow attribute - Accessibility
if the current value is not known, the author should not set the aria-valuenow attribute.
... when the rendered value cannot be accurately represented as a number, authors should use the aria-valuetext attribute in conjunction with aria-valuenow to provide a user-friendly representation of the range's current value.
... note: opinions may differ on how assistive technology should handle this technique.
...And 2 more matches
Using the log role - Accessibility
when this role is added to an element, the browser will send out an accessible log event to assistive technology products which can then notify the user about 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.
... note: opinons may differ on how assistive technology should handle this technique.
...And 2 more matches
ARIA: alert role - Accessibility
the alert role is added to the node containing an alert message, not the element causing the alert to be triggered.
...they don't receive focus, and therefore focus does not need to be managed and no user interaction should be required.
...it should not be used on html where the user hasn't interacted with it.
...And 2 more matches
ARIA: List role - Accessibility
group a collection of related objects, limited to list items when nested in a list, not important enough to have their own place in a pages table of contents.
... for example, our above example should be rewritten as follows: <ul> <li>list item 1</li> <li>list item 2</li> <li>list item 3</li> </ul> or use an ordered list if the order of the list items matters: <ol> <li>list item 1</li> <li>list item 2</li> <li>list item 3</li> </ol> note: the aria list/listitem roles don't distinguish between ordered and unordered lists.
... as an aside, note that if you are using the semantic html elements of ol or ul and apply a role of presentation, each child li element inherits the presentation role because aria requires the listitem elements to have the parent list element.
...And 2 more matches
ARIA: heading role - Accessibility
keyboard interactions this role does not require any special keyboard navigation.
... changing attribute values usually not required, unless dynamically inserting content.
...section.</p> ...</div> however, instead, you should do: <div id="container"> <h1>the main page heading</h1> <p>this article is 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.
...And 2 more matches
Accessibility and Spacial Patterns - Accessibility
text and padding wcag standards for contrast perception do not take into account the effect of padding.
... for example, knowing braille is not enough.
... the braille dots have to be spatially apart from one another so as to be readable in a "human" way.
...And 2 more matches
-moz-force-broken-image-icon - CSS: Cascading Style Sheets
note: even if the value is set to 1 the alt attribute will still be displayed, alongside the broken image icon.
... formal definition initial value0applies toimagesinheritednocomputed valueas specifiedanimation typediscrete formal syntax <integer> examples html <img src='/broken/image/link.png' alt='broken image link'> css img { -moz-force-broken-image-icon: 1; height: 100px; width: 100px; } result screenshotlive sample note: unless the image has a specified height and width the broken image icon will not be displayed but the alt attribute will also be hidden if -moz-force-broken-image-icon is set to 1.
... notes this property will only work in gecko-based browsers.
...And 2 more matches
-webkit-mask-repeat-x - CSS: Cascading Style Sheets
no-repeat the mask image is not repeated; only one copy of the mask image is drawn.
... the remainder of the masked element's content is not displayed.
... round as the allowed space increases in size, the repeated images will stretch (leaving no gaps) until there is room for another one to be added.
...And 2 more matches
-webkit-mask-repeat-y - CSS: Cascading Style Sheets
no-repeat the mask image is not repeated vertically; only one copy of the mask image is drawn in vertical direction.
... the vertical remainder of the masked element's content is not displayed.
... round as the allowed vertical space increases in size, the repeated images will stretch (leaving no gaps) until there is room for another one to be added.
...And 2 more matches
::placeholder - CSS: Cascading Style Sheets
note: in most browsers, the appearance of placeholder text is a translucent or light gray color by default.
... syntax ::placeholder accessibility concerns color contrast contrast ratio placeholder text typically has a lighter color treatment to indicate that it is a suggestion for what kind of input will be valid, and is not actual input of any kind.
... it is important to ensure that the contrast ratio between the color of the placeholder text and the background of the input is high enough that people experiencing low vision conditions will be able to read it while also making sure there is enough of a difference between the placeholder text and input text color that users do not mistake the placeholder for inputed data.
...And 2 more matches
:scope - CSS: Cascading Style Sheets
WebCSS:scope
/* selects a scoped element */ :scope { background-color: lime; } currently, when used in a stylesheet, :scope is the same as :root, since there is not at this time a way to explicitly establish a scoped element.
...it is not an interesting paragraph.
... 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.
...And 2 more matches
-moz-device-pixel-ratio - CSS: Cascading Style Sheets
do not use this feature.
... note: this media feature is also implemented by webkit and by ie 11 for windows phone 8.1 as -webkit-device-pixel-ratio.
... 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.
...And 2 more matches
Border-radius generator - CSS: Cascading Style Sheets
pan'); info.classname = 'ui-input-slider-info'; info.textcontent = name; node.appendchild(info); } node.appendchild(slider_left); node.appendchild(input); node.appendchild(slider_right); node.classname = 'ui-input-slider ui-input-slider-container'; this.input = input; sliders[topic] = this; setvalue(topic, value); } var setvalue = function setvalue(topic, value, send_notify) { var slider = sliders[topic]; if (slider === undefined) return; if (value > slider.max) value = slider.max; if (value < slider.min) value = slider.min; slider.value = value; slider.node.setattribute('data-value', value); if (send_notify !== undefined && send_notify === false) { slider.input.value = value + slider.unit; return; } notify.call(slider); } var se...
....value); } var getnode = function getnode(topic) { return sliders[topic].node; } var subscribe = function subscribe(topic, callback) { if (subscribers[topic] === undefined) subscribers[topic] = []; subscribers[topic].push(callback); } var unsubscribe = function unsubscribe(topic, callback) { subscribers[topic].indexof(callback); subscribers[topic].splice(index, 1); } var notify = function notify() { for (var i in subscribers[this.topic]) { subscribers[this.topic][i](this.value); } } var init = function init() { var elem = document.queryselectorall('.ui-input-slider'); var size = elem.length; for (var i = 0; i < size; i++) new inputslider(elem[i]); } return { init : init, setmax : setmax, setmin : setmin, setunit : setunit, getnode : ge...
...ibute('type', 'checkbox'); checkbox.checked = state; label.setattribute('for', id); if (name) { label.classname = 'text'; if (align) label.classname += ' ' + align; label.textcontent = name; } node.appendchild(checkbox); node.appendchild(label); this.node = node; this.topic = topic; this.checkbox = checkbox; checkbox.addeventlistener('change', function(e) { notify.call(this); }.bind(this)); buttons[topic] = this; } var getnode = function getnode(topic) { return buttons[topic].node; } var setvalue = function setvalue(topic, value) { try { buttons[topic].checkbox.checked = value; } catch(error) { console.log(error); } } var subscribe = function subscribe(topic, callback) { if (subscribers[topic] === undefined) subscribe...
...And 2 more matches
CSS Box Alignment - CSS: Cascading Style Sheets
note: the documentation for each layout method will detail how box alignment is applied there.
...however the specification notes that the box alignment specification should be referred to as it may add additional capabilities over what is currently in flexbox.
... relationship to writing modes alignment is linked to writing modes in that when we align an item we do not consider whether we are aligning it to the physical dimensions of top, right, bottom and left.
...And 2 more matches
Handling content breaks in multicol - CSS: Cascading Style Sheets
a column box can contain other markup and there are many places where a break would not be ideal.
... for example, we would generally prefer that the figcaption of an image not be separated into a new column away from the image it refers to and ending a column with a heading looks strange.
...note that these properties only work inside a block container, such as a paragraph.
...And 2 more matches
Subgrid - CSS: Cascading Style Sheets
these grids however are independent of the parent grid and of each other, meaning that they do not take their track sizing from the parent grid.
... the rows in this example are not a subgrid and so behave as a nested grid does normally.
... note that line numbering restarts inside the subgrid — column line 1, when inside the subgrid, is the first line of the subgrid.
...And 2 more matches
The stacking context - CSS: Cascading Style Sheets
element with a position value fixed or sticky (sticky for all mobile browsers, but not older desktop).
... note: the hierarchy of stacking contexts is a subset of the hierarchy of html elements because only certain elements create stacking contexts.
... we can say that elements that do not create their own stacking contexts are assimilated by the parent stacking context.
...And 2 more matches
CSS selectors - CSS: Cascading Style Sheets
note: there are no selectors or combinators to select parent items, siblings of parents, or children of parent siblings.
...this means that the second element follows the first (though not necessarily immediately), and both share the same parent.
... syntax: a ~ b example: p ~ span will match all <span> elements that follow a <p>, immediately or not.
...And 2 more matches
Pseudo-classes - CSS: Cascading Style Sheets
/* any button over which the user's pointer is hovering */ button:hover { color: blue; } pseudo-classes let you apply a style to an element not only in relation to the content of the document tree, but also in relation to external factors like the history of the navigator (:visited, for example), the status of its content (like :checked on certain form elements), or the position of the mouse (like :hover, which lets you know if the mouse is over an element or not).
... note: in contrast to pseudo-classes, pseudo-elements can be used to style a specific part of an element.
...es :active :any-link :blank :checked :current :default :defined :dir() :disabled :drop :empty :enabled :first :first-child :first-of-type :fullscreen :future :focus :focus-visible :focus-within :has() :host :host() :host-context() :hover :indeterminate :in-range :invalid :is() :lang() :last-child :last-of-type :left :link :local-link :not() :nth-child() :nth-col() :nth-last-child() :nth-last-col() :nth-last-of-type() :nth-of-type() :only-child :only-of-type :optional :out-of-range :past :placeholder-shown :read-only :read-write :required :right :root :scope :state() :target :target-within :user-invalid :valid :visited :where() specifications specification status comment ...
...And 2 more matches
CSS Tutorials - CSS: Cascading Style Sheets
WebCSSTutorials
editor's note: we should look at using "difficulty level" tags on the tutorial/guide pages so that difficulty-based lists can be automatically built.
...though not that difficult, it requires a basic knowledge of css.
... css gradients gradients are images that transition smoothly from one color to another.
...And 2 more matches
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
note that firefox and edge also support -webkit-appearance, for compatibility reasons.
... compatibility note: if you wish to use this property on websites, you should test it very carefully.
...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.
...And 2 more matches
aspect-ratio - CSS: Cascading Style Sheets
this property is not yet implemented in browsers, however some browsers are implementing this internally in order to provide the aspect ratio mapping described below.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetaspect-ratio experimentalchrome partial support 79notes partial support 79notes notes chrome 79 adds internal support only for mapped valuesedge partial support 79notes partial support 79notes notes edge 79 adds internal support only for mapped valuesfirefox partial support 71notes partial support 71notes notes firefox...
... 71 adds internal support only for mapped values no support 69 — 71notes disabled notes firefox 69 adds internal support only for mapped valuesdisabled from version 69 until version 71 (exclusive): this feature is behind the layout.css.width-and-height-map-to-aspect-ratio.enabled preference (needs to be set to true).
...And 2 more matches
background-attachment - CSS: Cascading Style Sheets
(this is not compatible with background-clip: text.) local the background is fixed relative to the element's contents.
... scroll the background is fixed relative to the element itself and does not scroll with its contents.
... suddenly she came upon a little three-legged table, all made of solid glass; there was nothing on it except a tiny golden key, and alice's first thought was that it might belong to one of the doors of the hall; but, alas!
...And 2 more matches
background-position - CSS: Cascading Style Sheets
note that: if one value is top or bottom, then the other value may not be top or bottom.
... if one value is left or right, then the other value may not be left or right.
... this means, e.g., that top top and left right are not valid.
...And 2 more matches
<basic-shape> - CSS: Cascading Style Sheets
all <basic-shape> values use functional notation and are defined here using the value definition syntax.
... the required <string> is an svg path string encompassed in quotes the arguments not defined above are defined as follows: <shape-arg> = <length> | <percentage> <shape-radius> = <length> | <percentage> | closest-side | farthest-side defines a radius for a circle or ellipse.
... interpolation of basic shapes when animating between one <basic-shape> and another, the rules below are applied.
...And 2 more matches
box-decoration-break - CSS: Cascading Style Sheets
values slice the element is initially rendered as if its box were not fragmented, after which the rendering for this hypothetical box is sliced into pieces for each line/column/page.
... note that the hypothetical box can be different for each fragment since it uses its own height if the break occurs in the inline direction, and its own width if the break occurs in the block direction.
...note that if you stack the rendering of the two fragments horizontally next to each other it will result in the non-fragmented rendering.
...And 2 more matches
box-sizing - CSS: Cascading Style Sheets
for example, if you have four boxes with width: 25%;, if any has left or right padding or a left or right border, they will not by default fit on one line within the constraints of the parent container.
... note: it is often useful to set box-sizing to border-box to layout elements.
...the width and height properties include the content, but does not include the padding, border, or margin.
...And 2 more matches
break-after - CSS: Cascading Style Sheets
once forced breaks have been applied, soft breaks may be added if needed, but not on element boundaries that resolve in a corresponding avoid value.
... values generic break values auto allows, but does not force, any break (page, column, or region) to be inserted right after the principal box.
...if we are inside a multicol container then it would force a column break, inside paged media (but not inside a multicol container) a page break.
...And 2 more matches
break-before - CSS: Cascading Style Sheets
once forced breaks have been applied, soft breaks may be added if needed, but not on element boundaries that resolve in a corresponding avoid value.
... values generic break values auto allows, but does not force, any break (page, column, or region) to be inserted right before the principal box.
...if we are inside a multicol container then it would force a column break, inside paged media (but not inside a multicol container) a page break.
...And 2 more matches
calc() - CSS: Cascading Style Sheets
WebCSScalc
notes the + and - operators must be surrounded by whitespace.
... the * and / operators do not require whitespace, but adding it for consistency is both allowed and recommended.
... note: the chrome browser currently won’t accept some values returned by calc() when an integer is expected.
...And 2 more matches
caption-side - CSS: Cascading Style Sheets
top-outside the caption box should be positioned above the table, while the width and horizontal alignment behavior are not bound to the table's horizontal layout.
... the css 2.1 specification notes that the css 2 specification described a different behavior for the top value, which will be reintroduced by this value in a future specification.
... bottom-outside the caption box should be positioned below the table, while the width and horizontal alignment behavior are not bound to the table's horizontal layout.
...And 2 more matches
<display-box> - CSS: Cascading Style Sheets
please note that the css display level 3 spec defines how the contents value should affect "unusual elements" — elements that aren’t rendered purely by css box concepts such as replaced elements.
... due to a bug in browsers this will currently remove the element from the accessibility tree — screen readers will not look at what's inside.
... none turns off the display of an element so that it has no effect on layout (the document is rendered as though the element did not exist).
...And 2 more matches
float - CSS: Cascading Style Sheets
WebCSSfloat
a floating element is one where the computed value of float is not none.
...k block inline-table table table-row block table-row-group block table-column block table-column-group block table-cell block table-caption block table-header-group block table-footer-group block inline-flex flex inline-grid grid other unchanged note: if you're referring to this property from javascript as a member of the htmlelement.style object, modern browsers support float, but in older browsers you have to spell it as cssfloat, with internet explorer versions 8 and older using stylefloat.
... none the element must not float.
...And 2 more matches
font-size - CSS: Cascading Style Sheets
WebCSSfont-size
note: to maximize accessibility, it is generally best to use values that are relative to the user's default font size.
... note: defining font sizes in px is not accessible, because the user cannot change the font size in some browsers.
... ems another way of setting the font size is with em values.
...And 2 more matches
font-variation-settings - CSS: Cascading Style Sheets
note that this doesn't mean that the author has to include all of these in their font.
... note: registered axis tags are identified using lower-case tags, whereas 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.
...And 2 more matches
font-weight - CSS: Cascading Style Sheets
note that only four font weights are considered for relative weight calculation; see the meaning of relative weights section below.
...note that only four font weights are considered for relative weight calculation; see the meaning of relative weights section below.
... note that when using relative weights, only four font weights are considered — thin (100), normal (400), bold (700), and heavy (900).
...And 2 more matches
hyphens - CSS: Cascading Style Sheets
WebCSShyphens
note: the rules defining how hyphenation is performed are not explicitly defined by the specification, so the exact hyphenation may vary from browser to browser.
... values none words are not broken at line breaks, even if characters inside the words suggest line break points.
... note: the auto setting's behavior depends on the language being properly tagged to select the appropriate hyphenation rules.
...And 2 more matches
<image> - CSS: Cascading Style Sheets
WebCSSimage
syntax the <image> data type can be represented with any of the following: an image denoted by the <url> data type a <gradient> data type a part of the webpage, defined by the element() function an image, image fragment or solid patch of color, defined by the image() function a blending of two or more images defined by the cross-fade() function.
... note: not all browsers support every type of image on every property.
... accessibility concerns browsers do not provide any special information on background images to assistive technology.
...And 2 more matches
<length> - CSS: Cascading Style Sheets
WebCSSlength
note: although <percentage> values are also css dimensions, and are usable in some of the same properties that accept <length> values, they are not themselves <length> values.
... note: some properties allow negative <length>s, while others do not.
... note: these units, especially em and rem, are often used to create scalable layouts, which maintain the vertical rhythm of the page even when the user changes the font size.
...And 2 more matches
list-style-type - CSS: Cascading Style Sheets
note that: some types require a suitable font installed to display as expected.
... e.g., 壱萬壱阡壱百壱拾壱 the kanjis are designed so that they can't be modified to look like another correct one japanese-informal japanese informal numbering kannada -moz-kannada example katakana e.g.
...le ethiopic-halehame-ti-et -moz-ethiopic-halehame-ti-et example hangul -moz-hangul example example example hangul-consonant -moz-hangul-consonant example example example urdu -moz-urdu example accessibility concerns the voiceover screen reader has an issue where unordered lists with a list-style-type value of none applied to them will not be announced as a list.
...And 2 more matches
repeating-linear-gradient() - CSS: Cascading Style Sheets
if the first color does not have a color-stop-length, the color-stop-length defaults to 0.
...the order of the side keywords does not matter.
...a percentage of 0%, or a length of 0, represents the start of the gradient; the value 100% is 100% of the image size, meaning the gradient will not repeat.
...And 2 more matches
<resolution> - CSS: Cascading Style Sheets
the <resolution> css data type, used for describing resolutions in media queries, denotes the pixel density of an output device, i.e., its resolution.
... on screens, the units are related to css inches, centimeters, or pixels, not physical values.
... note: although the number 0 is always the same regardless of unit, the unit may not be omitted.
...And 2 more matches
revert - CSS: Cascading Style Sheets
WebCSSrevert
revert will not affect rules applied to children of an element you reset (but will remove effects of a parent rule on a child).
... the revert keyword is different from and should not be confused with initial, which uses the initial value defined on a per-property basis by the css specifications.
...</section> notice how paragraph still has a red color even though a color property for the section was reverted.
...And 2 more matches
right - CSS: Cascading Style Sheets
WebCSSright
for relatively positioned elements, the distance of the element from its normal position is based on the left property; or if left is also auto, the element is not moved horizontally at all.
... inherit specifies that the value is the same as the computed value from its parent element (which might not be its containing block).
... when both left and right are defined, if not prevented from doing so by other properties, the element will stretch to satisfy both.
...And 2 more matches
text-transform - CSS: Cascading Style Sheets
in irish (ga), certain prefixed letters remain in lowercase when the base initial is capitalized, 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).
... note: support for language-specific cases varies between browsers, so check the browser compatibility table.
... authors should not expect capitalize to follow language-specific title casing conventions (such as skipping articles in english).
...And 2 more matches
<time> - CSS: Cascading Style Sheets
WebCSStime
note: although the number 0 is always the same regardless of unit, the unit may not be omitted.
... in other words, 0 is invalid and does not represent 0s or 0ms.
... note: conversion between s and ms follows the logical 1s = 1000ms.
...And 2 more matches
user-modify - CSS: Cascading Style Sheets
it was originally planned to determine whether or not the content of an element can be edited by a user.
... write-only the user is able to edit the content, but not to read it.
... formal definition value not found in db!
...And 2 more matches
Web Audio playbackRate explained - Developer guides
note: try out this example live, and try adjusting the playback rate control to see the effect.
... 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.
... the pitch of the audio track does not change when playbackrate is altered.
...And 2 more matches
Media events - Developer guides
note: manually setting the currenttime will eventually fire a canplaythrough event in firefox.
... other browsers might not fire this event.
... mozaudioavailable sent when an audio buffer is provided to the audio layer for processing; the buffer contains raw audio samples that may or may not already have been played by the time you receive the event.
...And 2 more matches
Separate sites for mobile and desktop - Developer guides
the bad unfortunately, this approach is not without its drawbacks.
...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.
...And 2 more matches
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
usage notes heading information may be used by user agents, for example, to construct a table of contents for a document automatically.
...using more than one will not result in an error, but using only one is seen as a best practice.
...because of this, it is important to not skip one or more heading levels.
...And 2 more matches
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
WebHTMLElementcanvas
moz-opaque lets the canvas know whether or not translucency will be a factor.
... usage notes alternative content you may (and should) provide alternate content inside the <canvas> block.
... note: exceeding the maximum dimensions or area renders the canvas unusable — drawing commands will not work.
...And 2 more matches
<caption>: The Table Caption element - HTML: Hypertext Markup Language
WebHTMLElementcaption
tag omission the end tag can be omitted if the element is not immediately followed by ascii whitespace or a comment.
... deprecated attributes the following attributes are deprecated and should not be used.
... usage note: do not use this attribute, as it has been deprecated.
...And 2 more matches
<del>: The Deleted Text element - HTML: Hypertext Markup Language
WebHTMLElementdel
this element is often (but need not be) rendered by applying a strike-through style to the text.
...if the value cannot be parsed as a date with an optional time string, the element does not have an associated time stamp.
... examples <p><del>this text has been deleted</del>, here is the rest of the paragraph.</p> <del><p>this paragraph has been deleted.</p></del> result accessibility concerns the presence of the del element is not announced by most screen reading technology in its default configuration.
...And 2 more matches
<details>: The Details disclosure element - HTML: Hypertext Markup Language
WebHTMLElementdetails
note: the common use of a triangle which rotates or twists around to represent opening or closing the widget is why these are sometimes called "twisties." a <details> widget can be in one of two states.
... note: unfortunately, at this time there's no built-in way to animate the transition between open and closed.
... open this boolean attribute indicates whether or not the details — that is, the contents of the <details> element — are currently visible.
...And 2 more matches
<div>: The Content Division element - HTML: Hypertext Markup Language
WebHTMLElementdiv
as a "pure" container, the <div> element does not inherently represent anything.
... note: the align attribute is obsolete; do not use it anymore.
... usage notes the <div> element should be used only when no other semantic element (such as <article> or <nav>) is appropriate.
...And 2 more matches
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
WebHTMLElementkbd
the html keyboard input element (<kbd>) represents a span of inline text denoting textual user input from a keyboard, voice input, or any other text entry device.
... by convention, the user agent defaults to rendering the contents of a <kbd> element using its default monospace font, although this is not mandated by the html standard.
... usage notes other elements can be used in tandem with <kbd> to represent more specific scenarios: nesting a <kbd> element within another <kbd> element represents an actual key or other unit of input as a portion of a larger input.
...And 2 more matches
<menu> - HTML: Hypertext Markup Language
WebHTMLElementmenu
context : indicates the popup menu state, which represents a group of commands activated through another element.
... usage notes the <menu> and <ul> elements both represent an unordered list of items.
... an html menu can be used to create context menus (typically activated by right-clicking another element) or toolbars.
...And 2 more matches
<s> - HTML: Hypertext Markup Language
WebHTMLElements
however, <s> is not appropriate when indicating document edits; for that, use the <del> and <ins> elements, as appropriate.
... implementation note: up to gecko 1.9.2 inclusive, firefox implements the htmlspanelement interface for this element.
... examples <s>today's special: salmon</s> sold out<br> <span style="text-decoration:line-through;">today's special: salmon</span> sold out accessibility concerns the presence of the s element is not announced by most screen reading technology in its default configuration.
...And 2 more matches
<style>: The Style Information element - HTML: Hypertext Markup Language
WebHTMLElementstyle
type this attribute defines the styling language as a mime type (charset should not be specified).
... this attribute is optional and defaults to text/css if it is not specified; values other than the empty string or text/css are not used.
... note: there is very little reason to include this attribute in modern web documents.
...And 2 more matches
<summary>: The Disclosure Summary element - HTML: Hypertext Markup Language
WebHTMLElementsummary
usage notes the <summary> element's contents can be any heading content, plain text, or html that can be used within a paragraph.
... default label text if a <details> element's first child is not a <summary> element, the user agent will use a default string (typically "details") as the label for the disclosure box.
... see the browser compatibility section for details, as not all browsers support full functionality of this element yet.
...And 2 more matches
<title>: The Document Title element - HTML: Hypertext Markup Language
WebHTMLElementtitle
permitted content text that is not inter-element whitespace.
...note that leaving off </title> should cause the browser to ignore the rest of the page.
... usage notes the <title> element is always used within a page's <head> block.
...And 2 more matches
<wbr> - HTML: Hypertext Markup Language
WebHTMLElementwbr
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.
... permitted content empty tag omission it is an empty element; it must have a start tag, but must not have an end tag.
... notes on utf-8 encoded pages, <wbr> behaves like the u+200b zero-width space code point.
...And 2 more matches
dir - HTML: Hypertext Markup Language
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.
...And 2 more matches
hidden - HTML: Hypertext Markup Language
the hidden global attribute is a boolean attribute indicating that the element is not yet, or is no longer, relevant.
... the hidden attribute must not be used to hide content just from one presentation.
...if the content is not applicable or relevant, then there is no reason to link to it.
...And 2 more matches
HTTP authentication - HTTP
security of basic authentication as the user id and password are passed over the network as clear text (it is base64 encoded, but base64 is a reversible encoding), the basic authentication scheme is not secure.
...without these additional security enhancements, basic authentication should not be used to protect sensitive or valuable information.
...you cannot see the actual passwords as they are hashed (using md5-based hashing, in this case).
...And 2 more matches
Data URLs - HTTP
note: data urls are treated as unique opaque origins by modern browsers, rather than inheriting the origin of the settings object responsible for the navigation.
...note the use of percent-encoding (url-encoding) for the quote and space characters.
...note that the closing script tag is required.
...And 2 more matches
Resource URLs - HTTP
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.
... in the past, web content was able to access whatever resource: uris were desired — not only firefox’s internal resources, but also extensions’ assets.
...And 2 more matches
Accept-Language - HTTP
(by languages, we mean natural languages, such as english, and not programming languages.) using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the content-language response header.
... this header is a hint to be used when the server has no way of determining the language via another way, like a specific url, that is controlled by an explicit user decision.
...the content of the accept-language is often out of the control of the user (like when traveling and using an internet cafe in a different country); the user may also want to visit a page in another language than the locale of their user interface.
...And 2 more matches
Connection - HTTP
the connection general header controls whether or not the network connection stays open after the current transaction finishes.
... if the value sent is keep-alive, the connection is persistent and not closed, allowing for subsequent requests to the same server to be done.
... except for the standard hop-by-hop headers (keep-alive, transfer-encoding, te, connection, trailer, upgrade, proxy-authorization and proxy-authenticate), any hop-by-hop headers used by the message must be listed in the connection header, so that the first proxy knows it has to consume them and not forward them further.
...And 2 more matches
CSP: base-uri - HTTP
not setting this allows any url.
...you can also specify data schemes (not recommended).
...use this sparingly and definitely not for scripts.
...And 2 more matches
CSP: child-src - HTTP
you can also specify data schemas (not recommended).
...use this sparingly and definitely not for scripts.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
...And 2 more matches
CSP: default-src - HTTP
you can also specify data schemes (not recommended).
...use this sparingly and definitely not for scripts.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
...And 2 more matches
CSP: font-src - HTTP
you can also specify data schemas (not recommended).
...use this sparingly and definitely not for scripts.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
...And 2 more matches
CSP: form-action - HTTP
not setting this allows anything.
...you can also specify data schemes (not recommended).
...use this sparingly and definitely not for scripts.
...And 2 more matches
CSP: frame-src - HTTP
you can also specify data schemas (not recommended).
...use this sparingly and definitely not for scripts.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
...And 2 more matches
CSP: img-src - HTTP
you can also specify data schemes (not recommended).
...use this sparingly and definitely not for scripts.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
...And 2 more matches
CSP: manifest-src - HTTP
you can also specify data schemas (not recommended).
...use this sparingly and definitely not for scripts.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
...And 2 more matches
CSP: media-src - HTTP
you can also specify data schemas (not recommended).
...use this sparingly and definitely not for scripts.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
...And 2 more matches
CSP: object-src - HTTP
you can also specify data schemas (not recommended).
...use this sparingly and definitely not for scripts.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
...And 2 more matches
CSP: prefetch-src - HTTP
you can also specify data schemes (not recommended).
...use this sparingly and definitely not for scripts.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
...And 2 more matches
CSP: script-src-attr - HTTP
this includes only inline script event handlers like onclick, but not urls loaded directly into <script> elements.
...you can also specify data schemes (not recommended).
...use this sparingly and definitely not for scripts.
...And 2 more matches
CSP: script-src-elem - HTTP
the http content-security-policy (csp) script-src-elem directive specifies valid sources for javascript <script> elements, but not inline script event handlers like onclick.
...you can also specify data schemes (not recommended).
...use this sparingly and definitely not for scripts.
...And 2 more matches
CSP: upgrade-insecure-requests - HTTP
it is recommended to set either directive, but not both, unless you want to force https on older browsers that do not force it after a redirect to http.
... the upgrade-insecure-requests directive will not ensure that users visiting your site via links on third-party sites will be upgraded to https for the top-level navigation and thus does not replace the strict-transport-security (hsts) header, which should still be set with an appropriate max-age to ensure that users are not subject to ssl stripping attacks.
... <img src="http://example.com/image.png"> <img src="http://not-example.com/image.png"> these urls will be rewritten before the request is made, meaning that no insecure requests will hit the network.
...And 2 more matches
CSP: worker-src - HTTP
you can also specify data schemas (not recommended).
...use this sparingly and definitely not for scripts.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
...And 2 more matches
Content-Security-Policy - HTTP
elements controlled by object-src are perhaps coincidentally considered legacy html elements and are not receiving new standardized features (such as the security attributes sandbox or allow for <iframe>).
... navigate-to restricts the urls to which a document can initiate navigation by any means, including <form> (if form-action is not specified), <a>, window.location, window.open, etc.
... though the report-to directive is intended to replace the deprecated report-uri directive, report-to is not supported in most browsers yet.
...And 2 more matches
ETag - HTTP
WebHTTPHeadersETag
it lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed.
...weak etag values of two representations of the same resources might be semantically equivalent, but not byte-for-byte identical.
...the method by which etag values are generated is not specified.
...And 2 more matches
SameSite cookies - HTTP
strict cookies will only be sent in a first-party context and not be sent along with requests initiated by third party websites.
... the warning appears because any cookie that requests samesite=none but is not marked secure will be rejected.
...note that insecure sites (http:) can't set cookies with the secure directive.
...And 2 more matches
PATCH - HTTP
WebHTTPMethodsPATCH
patch is somewhat analogous to the "update" concept found in crud (in general, http is different than crud, and the two should not be confused).
... a patch is not necessarily idempotent, although it can be.
...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.
...And 2 more matches
Groups and ranges - JavaScript
do not forget to edit it as well, thanks!
...that is, it matches anything that is not enclosed in the brackets.
... (?:x) non-capturing group: matches "x" but does not remember the match.
...And 2 more matches
Text formatting - JavaScript
caution: if you edit this page, do not include any characters above u+ffff, until mdn bug 857438 is fixed ( https://bugzilla.mozilla.org/show_bug.cgi?id=857438 ).
... startswith, endswith, includes returns whether or not the string starts, ends or contains a specified string.
...this is a method of the string class, not a string instance.
...And 2 more matches
TypeError: invalid assignment to const "x" - JavaScript
a constant is a value that cannot be altered by the program during normal execution.
... it cannot change through re-assignment, and it can't be redeclared.
... rename if you meant to declare another constant, pick another name and re-name.
...And 2 more matches
JavaScript error reference - JavaScript
error: permission denied to access property "x"internalerror: too much recursionrangeerror: argument is not a valid code pointrangeerror: invalid array lengthrangeerror: invalid daterangeerror: precision is out of rangerangeerror: radix must be an integerrangeerror: repeat count must be less than infinityrangeerror: repeat count must be non-negativereferenceerror: "x" is not definedreferenceerror: assignment to undeclared variable "x"referenceerror: can't access lexical declaration "x" before initializ...
...are deprecatedsyntaxerror: "use strict" not allowed in function with non-simple parameterssyntaxerror: "x" is a reserved identifiersyntaxerror: json.parse: bad parsingsyntaxerror: malformed formal parametersyntaxerror: unexpected tokensyntaxerror: using //@ to indicate sourceurl pragmas is deprecated.
... use //# insteadsyntaxerror: a declaration in the head of a for-of loop can't have an initializersyntaxerror: applying the "delete" operator to an unqualified name is deprecatedsyntaxerror: for-in loop head declarations may not have initializerssyntaxerror: function statement requires a namesyntaxerror: identifier starts immediately after numeric literalsyntaxerror: illegal charactersyntaxerror: invalid regular expression flag "x"syntaxerror: missing ) after argument listsyntaxerror: missing ) after conditionsyntaxerror: missing : after property idsyntaxerror: missing ; before statementsyntaxerror: missing = in const declarationsyntaxerror: missing ] after element listsyntaxerror: missing formal parametersyntaxerror: missing name after .
...And 2 more matches
Array.prototype.reduce() - JavaScript
note: if initialvalue is not provided, reduce() will execute the callback function starting at index 1, skipping the first index.
...62/#sec-array.prototype.reduce if (!array.prototype.reduce) { object.defineproperty(array.prototype, 'reduce', { value: function(callback /*, initialvalue*/) { if (this === null) { throw new typeerror( 'array.prototype.reduce ' + 'called on null or undefined' ); } if (typeof callback !== 'function') { throw new typeerror( callback + ' is not a function'); } // 1.
...if len is 0 and initialvalue is not present, // throw a typeerror exception.
...And 2 more matches
Array.prototype.fill() - JavaScript
(note all elements in the array will be this exact value.) start optional start index, default 0.
... fill is intentionally generic: it does not require that its this value be an array object.
... fill is a mutator method: it will change the array itself and return it, not a copy of it.
...And 2 more matches
Array.prototype.findIndex() - JavaScript
if it is not provided, then undefined is used.
...callback will not process the elements appended to the array after the call to findindex() begins.
... if (this == null) { throw new typeerror('"this" is null or not defined'); } var o = object(this); // 2.
...And 2 more matches
Array.prototype.push() - JavaScript
if the length property cannot be converted into a number, the index used is 0.
... although strings are native, array-like objects, they are not suitable in applications of this method, as strings are immutable.
... do not use this method if the second array (morevegs in the example) is very large because the maximum number of parameters that one function can take is limited in practice.
...And 2 more matches
Array.prototype.sort() - JavaScript
the time and space complexity of the sort cannot be guaranteed as it depends on the implementation.
...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.
...And 2 more matches
Error.prototype.stack - JavaScript
description each step will be separated by a newline, with the first part of the line being the function name (if not a call from the global scope), then by an at (@) sign, the file location (except when the function is the error constructor as the error is being thrown), a colon, and, if there is a file location, the line number.
... (note that the error object also possesses the filename, linenumber and columnnumber properties for retrieving these from the error thrown (but only the error, and not its trace).) note that this is the format used by firefox.
...while an object (or array, etc.) would appear in the converted form "[object object]", and as such could not be evaluated back into the actual objects, scalar values could be retrieved (though it may be — it is still possible in firefox 14 — easier to use arguments.callee.caller.arguments, as could the function name be retrieved by arguments.callee.caller.name).
...And 2 more matches
FinalizationRegistry.prototype.register() - JavaScript
this cannot be the target object.
...if provided (and not undefined), this must be an object.
... if not provided, the target cannot be unregistered.
...And 2 more matches
Function.name - JavaScript
property attributes of function.name writable no enumerable no configurable yes note that in non-standard, pre-es2015 implementations the configurable attribute was false as well.
...emethod: function() {} }; console.log(f.name); // "f" console.log(object.somemethod.name); // "somemethod" you can define a function with a name in a function expression: let object = { somemethod: function object_somemethod() {} }; console.log(object.somemethod.name); // logs "object_somemethod" try { object_somemethod } catch(e) { console.log(e); } // referenceerror: object_somemethod is not defined the name property is read-only and cannot be changed by the assigment operator: example below contradicts with what is said at the beginning of this section and doesn't work as described.
....name; // "set foo"; function names in classes you can use obj.constructor.name to check the "class" of an object (but be sure to read the warnings below): function foo() {} // es2015 syntax: class foo {} var fooinstance = new foo(); console.log(fooinstance.constructor.name); // logs "foo" warning: the script interpreter will set the built-in function.name property only if a function does not have an own property called name (see section 9.2.11 of the ecmascript2015 language specification).
...And 2 more matches
Intl.NumberFormat() constructor - JavaScript
options optional an object with some or all of the following properties: compactdisplay only used when notation is "compact".
... notation the formatting that should be displayed for the number, the defaults is "standard" "standard" plain number formatting "scientific" return the order-of-magnitude for formatted number.
... signdisplay when to display the sign for the number; defaults to "auto" "auto" sign display for negative numbers only "never" never display sign "always" always display sign "exceptzero" sign display for positive and negative numbers, but not zero style the formatting style to use , the default is "decimal".
...And 2 more matches
Math.hypot() - JavaScript
if at least one of the arguments cannot be converted to a number, nan is returned.
... because hypot() is a static method of math, you always use it as math.hypot(), rather than as a method of a math object you created (math is not a constructor).
...if any of the arguments is nan (unless another argument is ±infinity), the result is nan.
...And 2 more matches
Object.is() - JavaScript
return value a boolean indicating whether or not the two arguments are the same value.
...two values are the same if one of the following holds: both undefined both null both true or both false both strings of the same length with the same characters in the same order both the same object (means both object have same reference) both numbers and both +0 both -0 both nan or both non-zero and both not nan and both have the same value this is not the same as being equal according to the == operator.
... the == operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as "" == false being true), but object.is doesn't coerce either value.
...And 2 more matches
Object.isSealed() - JavaScript
return value a boolean indicating whether or not the given object is sealed.
...an object is sealed if it is not extensible and if all its properties are non-configurable and therefore not removable (but not necessarily non-writable).
...object.preventextensions(empty); object.issealed(empty); // === true // the same is not true of a non-empty object, // unless its properties are all non-configurable.
...And 2 more matches
Object.prototype.__proto__ - JavaScript
the effects on the performance of altering inheritance are subtle and far-flung, and are not limited to simply the time spent in obj.__proto__ = ...
...the object must be extensible according to object.isextensible(): if it is not, a typeerror is thrown.
...providing any other value will do nothing.
...And 2 more matches
Object.setPrototypeOf() - JavaScript
the object.setprototypeof() method sets the prototype (i.e., the internal [[prototype]] property) of a specified object to another object or null.
...in addition, the effects of altering inheritance are subtle and far-flung, and are not limited to simply the time spent in the object.setprototypeof(...) statement, but may extend to any code that has access to any object whose [[prototype]] has been altered.
...does nothing if the prototype parameter isn't an object or null (i.e., number, string, boolean, or undefined).
...And 2 more matches
Promise.all() - JavaScript
note, google chrome 58 returns an already resolved promise in this case.
...it is typically used when there are multiple asynchronous tasks that are dependent on one another to complete successfully, as it does not wait and will reject immediately upon any of the input promises rejecting.
... in comparison, the promise returned by promise.allsettled() will wait for all input promises to complete, regardless of whether or not one rejects.
...And 2 more matches
Promise.any() - JavaScript
the promise.any() method is experimental and not fully supported by all browsers and platforms.
...it short-circuits after a promise fulfils, so it does not wait for the other promises to complete once it finds one.
...this can be beneficial if we need only one promise to fulfil but we do not care which one does.
...And 2 more matches
handler.defineProperty() - JavaScript
return value the defineproperty() method must return a boolean indicating whether or not the property has been successfully defined.
... interceptions this trap can intercept these operations: object.defineproperty() reflect.defineproperty() invariants if the following invariants are violated, the proxy will throw a typeerror: a property cannot be added, if the target object is not extensible.
... a property cannot be added as or modified to be non-configurable, if it does not exists as a non-configurable own property of the target object.
...And 2 more matches
handler.getOwnPropertyDescriptor() - JavaScript
a property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object.
... a property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible.
... a property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible.
...And 2 more matches
Reflect.construct() - JavaScript
if newtarget is not present, its value defaults to target.
... exceptions a typeerror, if target or newtarget are not constructors.
...ass, args, otherclass) // ...has the same result as this: let obj2 = object.create(otherclass.prototype) oneclass.apply(obj2, args) console.log(obj1.name) // 'one' console.log(obj2.name) // 'one' console.log(obj1 instanceof oneclass) // false console.log(obj2 instanceof oneclass) // false console.log(obj1 instanceof otherclass) // true console.log(obj2 instanceof otherclass) // true //another example to demonstrate below: function func1(a, b, c, d) { console.log(arguments[3]); } function func2(d, e, f, g) { consol.log(arguments[3]); } let obj1 = reflect.construct(func1, ['i', 'love', 'my', 'india']) obj1 however, while the end result is the same, there is one important difference in the process.
...And 2 more matches
RegExp.prototype.sticky - JavaScript
the sticky property reflects whether or not the search is sticky (searches in strings only from the index indicated by the lastindex property of this regular expression).
...the "y" flag indicates that it matches only from the index indicated by the lastindex property of this regular expression in the target string (and does not attempt to match from any later indexes).
... you cannot change this property directly.
...And 2 more matches
String.prototype.charAt() - JavaScript
if the index cannot be converted to the integer or no index is provided, the default is 0, so the first character of str is returned.
... is 'b' the character at index 0 is 'b' the character at index 1 is 'r' the character at index 2 is 'a' the character at index 3 is 'v' the character at index 4 is 'e' the character at index 999 is '' getting whole characters the following provides a means of ensuring that going through a string loop always provides a whole character, even if the string contains characters that are not in the basic multi-lingual plane.
...r.length; i++) { if ((chr = getwholechar(str, i)) === false) { continue; } // adapt this line at the top of each loop, passing in the whole string and // the current iteration and returning a variable to represent the // individual character console.log(chr); } function getwholechar(str, i) { var code = str.charcodeat(i); if (number.isnan(code)) { return ''; // position not found } if (code < 0xd800 || code > 0xdfff) { return str.charat(i); } // high surrogate (could change last hex to 0xdb7f to treat high private // surrogates as single characters) if (0xd800 <= code && code <= 0xdbff) { if (str.length <= (i + 1)) { throw 'high surrogate without following low surrogate'; } var next = str.charcodeat(i + 1); if (0xdc00 > next ...
...And 2 more matches
String.prototype.charCodeAt() - JavaScript
if the unicode code point cannot be represented in a single utf-16 code unit (because its value is greater than 0xffff) then the code unit returned will be the first part of a surrogate pair for the code point.
...if index is not a number, it defaults to 0.
...(for information on unicode, see the javascript guide.) note: charcodeat() will always return a value that is less than 65536.
...And 2 more matches
String.fromCodePoint() - JavaScript
"rangeerror: nan is not a valid code point").
... description this method returns a string (and not a string object).
... polyfill the string.fromcodepoint() method has been added to ecmascript 2015 and may not be supported in all web browsers or environments yet.
...And 2 more matches
String.prototype.includes() - JavaScript
the includes() method determines whether one string may be found within another string, returning true or false as appropriate.
...(defaults to 0.) return value true if the search string is found anywhere within the given string; otherwise, false if not.
... description this method lets you determine whether or not a string includes another string.
...And 2 more matches
String.raw() - JavaScript
(but it is not identical; see explanations in this issue.) it's used to get the raw string form of template strings, that is, substitutions (e.g.
...\n) are not.
... exceptions typeerror a typeerror is thrown if the first argument is not a well-formed object.
...And 2 more matches
String.prototype.replaceAll() - JavaScript
as of august 2020 the replaceall() method is supported by firefox but not by chrome.
...it is treated as a literal string and is not interpreted as a regular expression.
... description this method does not change the calling string object.
...And 2 more matches
String.prototype.split() - JavaScript
if separator is omitted or does not occur in str, the returned array contains one element consisting of the entire string.
... warning: when the empty string ("") is used as a separator, the string is not split by user-perceived characters (grapheme clusters) or unicode characters (codepoints), but by utf-16 codeunits.
...any leftover text is not included in the array at all.
...And 2 more matches
TypedArray.prototype.filter() - JavaScript
callback is invoked only for indexes of the typed array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values.
... typed array elements which do not pass the callback test are simply skipped, and are not included in the new typed array.
... filter() does not mutate the typed array on which it is called.
...And 2 more matches
TypedArray.prototype.find() - JavaScript
callback is invoked only for indexes of the typed array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values.
...if it is not provided, then undefined is used.
... find does not mutate the typed array on which it is called.
...And 2 more matches
WeakMap - JavaScript
primitive data types as keys are not allowed (e.g.
... by contrast, native weakmaps hold "weak" references to key objects, which means that they do not prevent garbage collection in case there would be no other reference to the key object.
...native weakmaps can be particularly useful constructs when mapping keys to information about the key that is valuable only if the key has not been garbage collected.
...And 2 more matches
WebAssembly.Module.customSections() - JavaScript
exceptions if module is not a webassembly.module object instance, a typeerror is thrown.
... note that the webassembly text format currently doesn't have a syntax specified for adding new custom sections; you can however add a name section to your wasm during conversion from text format over to .wasm.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jscustomsectionschrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
...And 2 more matches
WebAssembly.Table.prototype.set() - JavaScript
if value is not an exported webassembly function or null, a typeerror is thrown.
...le length, and invoke the two referenced functions that are now stored in the table (the table2.wasm module (see text representation) adds two function references to the table, both of which print out a simple value): webassembly.instantiatestreaming(fetch('table2.wasm'), importobject) .then(function(obj) { console.log(tbl.length); console.log(tbl.get(0)()); console.log(tbl.get(1)()); }); note how you've got to include a second function invocation operator at the end of the accessor to actually invoke the referenced function and log the value stored inside it (e.g.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jssetchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
...And 2 more matches
WebAssembly.compile() - JavaScript
exceptions if buffersource is not a typed array, a typeerror is thrown.
... var worker = new worker("wasm_worker.js"); fetch('simple.wasm').then(response => response.arraybuffer() ).then(bytes => webassembly.compile(bytes) ).then(mod => worker.postmessage(mod) ); note: you'll probably want to use webassembly.compilestreaming() in most cases, as it is more efficient than compile().
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jscompilechrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
...And 2 more matches
Logical AND (&&) - JavaScript
even though the && operator can be used with operands that are not boolean values, it can still be considered a boolean operator since its return value can always be converted to a boolean primitive.
... to explicitly convert its return value (or any expression in general) to the corresponding boolean value, use a double not operator or the boolean constructor.
... short-circuit evaluation the logical and expression is evaluated left to right, it is tested for possible "short-circuit" evaluation using the following rule: (some falsy expression) && expr is short-circuit evaluated to the falsy expression; short circuit means that the expr part above is not evaluated, hence any side effects of doing so do not take effect (e.g., if expr is a function call, the calling never takes place).
...And 2 more matches
in operator - JavaScript
// arrays let trees = ['redwood', 'bay', 'cedar', 'oak', 'maple'] 0 in trees // returns true 3 in trees // returns true 6 in trees // returns false 'bay' in trees // returns false (you must specify the index number, not the value at that index) 'length' in trees // returns true (length is an array property) symbol.iterator in trees // returns true (arrays are iterable, works only in es2015+) // predefined objects 'pi' in math // returns true // custom objects let mycar = {make: 'honda', model: 'accord', year: 1998} 'make' in mycar // returns true 'model' in mycar // returns true you must specify an...
...for example, you can specify a string created with the string constructor, but you cannot specify a string literal.
... let color1 = new string('green') 'length' in color1 // returns true let color2 = 'coral' // generates an error (color2 is not a string object) 'length' in color2 using in with deleted or undefined properties if you delete a property with the delete operator, the in operator returns false for that property.
...And 2 more matches
new operator - JavaScript
description the new keyword does the following things: creates a blank, plain javascript object; links (sets the constructor of) this object to another object; passes the newly created object from step 1 as the this context; returns this if the function doesn't return an object.
...an object can have a property that is itself another object.
... the object (not null, false, 3.1415 or other primitive types) returned by the constructor function becomes the result of the whole new expression.
...And 2 more matches
void operator - JavaScript
it should be noted that the precedence of the void operator should be taken into account and that parentheses can help clarify the resolution of the expression following the void operator: void 2 == '2'; // (void 2) == '2', returns false void (2 == '2'); // void (2 == '2'), returns undefined examples immediately invoked function expressions when using an immediately-invoked function expression, void can be...
...for example: <a href="javascript:void(0);"> click here to do nothing </a> <a href="javascript:void(document.body.style.backgroundcolor='green');"> click here for green background </a> note: javascript: pseudo protocol is discouraged over other alternatives, such as unobtrusive event handlers.
...this can cause unintended side effects by returning the result of a function call that previously returned nothing.
...And 2 more matches
Expressions and operators - JavaScript
yield* delegate to another generator function or iterable object.
... ~ bitwise not operator.
... logical not operator.
...And 2 more matches
block - JavaScript
examples block scoping rules with var or function declaration in non-strict mode variables declared with var or created by function declarations in non-strict mode do not have block scope.
...in other words, block statements do not introduce a scope.
...do not use them.
...And 2 more matches
break - JavaScript
if the statement is not a loop or switch, this is required.
...the labeled statement can be any block statement; it does not have to be preceded by a loop statement.
... a break statement, with or without a following label, cannot be used within the body of a function that is itself nested within the current loop, switch, or label statement that the break statement is intended to break out of.
...And 2 more matches
const - JavaScript
global constants do not become properties of the window object, unlike var variables.
...it does not mean the value it holds is immutable—just that the variable identifier cannot be reassigned.
... a constant cannot share its name with a function or a variable in the same scope.
...And 2 more matches
for - JavaScript
variables declared with var are not local to the loop, i.e.
... for example, in the initialization block it is not required to initialize variables: var i = 0; for (; i < 9; i++) { console.log(i); // more statements } like the initialization block, the condition block is also optional.
... if you are omitting this expression, you must make sure to break the loop in the body in order to not create an infinite loop.
...And 2 more matches
throw - JavaScript
each of the following throws an exception: throw 'error2'; // generates an exception with a string value throw 42; // generates an exception with the value 42 throw true; // generates an exception with the value true throw new error('required'); // generates an error object with the message of required also note that the throw statement is affected by automatic semicolon insertion (asi) as no line terminator between the throw keyword and the expression is allowed.
...', 'dec']; if (months[mo] !== undefined) { return months[mo]; } else { throw new userexception('invalidmonthno'); } } try { // statements to try var mymonth = 15; // 15 is out of bound to raise the exception var monthname = getmonthname(mymonth); } catch (e) { monthname = 'unknown'; console.error(e.message, e.name); // pass exception object to err handler } another example of throwing an object the following example tests an input string for a u.s.
... * * accepted formats for a zip code are: * 12345 * 12345-6789 * 123456789 * 12345 6789 * * if the argument passed to the zipcode constructor does not * conform to one of these patterns, an exception is thrown.
...And 2 more matches
Installing and uninstalling web apps - Progressive web apps (PWAs)
some parts of the pwa ecosystem are supported, while others are not.
...note that in android 8 and higher, a system-level "add to home screen" permission dialog will be shown first.
... note: you can find out a lot more about chrome install banners from the article web app install banners.
...And 2 more matches
Responsive Navigation Patterns - Progressive web apps (PWAs)
top and left navigation menus are common on larger screens, but are often not the optimal way to present information on small screens because of the reduced screen real estate.
... note: html/css for the corresponding patterns will be available soon.
... pattern 1: top toggle menu in this pattern, as the screen width is reduced, the top navigation items rearrange until there is not enough space.
...And 2 more matches
alignment-baseline - SVG: Scalable Vector Graphics
note: as a presentation attribute alignment-baseline can be used as a css property.
... as a presentation attribute, it can be applied to any element but it has effect only on the following four elements: <tspan>, <tref>, <altglyph>, and <textpath> usage notes value auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | top | center | bottom default value auto animatable yes auto the value is the dominant-baseline of the script to which the character belongs - i.e., use the dominant-baseline of the parent.
... note: this keyword may be mapped to text-top.
...And 2 more matches
color-interpolation - SVG: Scalable Vector Graphics
note: for filter effects, the color-interpolation-filters property controls which color space is used.
... when a child element is blended into a background, the value of the color-interpolation property on the child determines the type of blending, not the value of the color-interpolation on the parent.
... for gradients which make use of the href or the deprecated xlink:href attribute to reference another gradient, the gradient uses the propertyʼs value from the gradient element which is directly referenced by the fill or stroke property.
...And 2 more matches
color-profile - SVG: Scalable Vector Graphics
note: as a presentation attribute, color-profile can be used as a css property.
... as a presentation attribute, it can be applied to any element but it only has an effect on the following element: <image> usage notes value auto | srgb | <name> | <iri> default value auto animatable yes auto all colors are presumed to be defined in the srgb color space unless a more precise embedded profile is specified within content data.
...for images that do not have a profile, the srgb profile is used.
...And 2 more matches
overflow - SVG: Scalable Vector Graphics
it has the same parameter values and meaning as the css overflow property, however, the following additional points apply: if it has a value of visible, the attribute has no effect (i.e., a clipping rectangle is not created).
... when scroll is specified on an <svg> element, a scrollbar or panner is normally shown for the svg viewport whether or not any of its content is clipped.
... although the initial value for overflow is auto, it is overwritten in the user agent style sheet for the <svg> element when it is not the root element of a stand-alone document, the <pattern> element, and the <marker> element to be hidden by default.
...And 2 more matches
stop-color - SVG: Scalable Vector Graphics
note: with respect to gradients, svg treats the transparent keyword differently than css.
... svg does not calculate gradients in pre-multiplied space, so transparent really means transparent black.
... note: as a presentation attribute, stop-color can be used as a css property.
...And 2 more matches
target - SVG: Scalable Vector Graphics
WebSVGAttributetarget
000/svg"> <a href="https://developer.mozilla.org" target="_self"> <text x="0" y="20">open link within iframe</text> </a> <a href="https://developer.mozilla.org" target="_blank"> <text x="0" y="60">open link in new tab or window</text> </a> <a href="https://developer.mozilla.org" target="_top"> <text x="0" y="100">open link in this tab or window</text> </a> </svg> usage notes value _self | _parent | _top | _blank | <xml-name> default value _self animatable yes _replace the current svg image is replaced by the linked content in the same rectangular area in the same frame as the current svg image.
... note: this value was never well implemented, and the distinction between _replace and _self has been made redundant by changes in the html definition of browsing contexts.
...if the user agent does not support multiple windows/tabs, the result is the same as _top.
...And 2 more matches
x - SVG: Scalable Vector Graphics
WebSVGAttributex
value <length> | <percentage> default value 0 animatable yes note: starting with svg2, x is a geometry property meaning this attribute can also be used as a css property for <foreignobject>.
... value <length> | <percentage> default value 0 animatable yes note: starting with svg2, x is a geometry property meaning this attribute can also be used as a css property for images.
... value <length> | <percentage> default value 0 animatable yes note: starting with svg2, x is a geometry property meaning this attribute can also be used as a css property for rectangles.
...And 2 more matches
y - SVG: Scalable Vector Graphics
WebSVGAttributey
value <length> | <percentage> default value 0 animatable yes note: starting with svg2, y is a geometry property meaning this attribute can also be used as a css property for <foreignobject>.
... value <length> | <percentage> default value 0 animatable yes note: starting with svg2, y is a geometry property meaning this attribute can also be used as a css property for images.
... value <length> | <percentage> default value 0 animatable yes note: starting with svg2, y is a geometry property meaning this attribute can also be used as a css property for rectangles.
...And 2 more matches
Specification Deviations - SVG: Scalable Vector Graphics
the 'class' and 'style' attributes unlike html and mathml, the svg specification does not specify the 'style' and 'class' attributes on all svg elements.
...in general this change will not be visible to svg authors (the elements for which the svg specification does not define the 'class' and 'style' attribute are elements that are not displayed directly).
...requiring svg authors to know which elements can and cannot take a 'class' attribute would just put an extra burden on them.
...And 2 more matches
Clipping and masking - SVG: Scalable Vector Graphics
in this case, any half-transparent effects are not possible, it's an all-or-nothing approach.
...note, that the clippath element is usually placed in a defs section.
... the rect will not be painted, however.
...And 2 more matches
Web security
secure contexts a secure context is a window or worker for which there is reasonable confidence that the content has been delivered securely (via https/tls), and for which the potential for communication with contexts that are not secure is limited.
... robots.txt to be written site maps to be written integrity same-origin policy the same-origin policy is a critical security mechanism that restricts how a document or script loaded from one origin can interact with a resource from another origin.
... http x-content-type-options the x-content-type-options response http header is a marker used by the server to indicate that the mime types advertised in the content-type headers should not be changed and be followed.
...And 2 more matches
Using shadow DOM - Web Components
an important aspect of web components 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.
... note: shadow dom is supported by default in firefox (63 and onwards), chrome, opera, and safari.
... note that the shadow dom is not a new thing by any means — browsers have used it for a long time to encapsulate the inner structure of an element.
...And 2 more matches
Axes - XPath
WebXPathAxes
if an xpath expression does not specify an axis, this is understood by default.
... since only the root node or element nodes have children, any other use will select nothing.
...attribute and namespace nodes are not included - the parent of an attribute node is an element node, but attribute nodes are not the children of their parents.
...And 2 more matches
lang - XPath
WebXPathFunctionslang
notes a node's language is determined by its xml:lang attribute.
... if the current node does not have an xml:lang attribute, then the value of the xml:lang attribute of the nearest ancestor that has an xml:lang attribute will determine the current node's language.
... if the language cannot be determined (no ancestor has an xml:lang attribute), this function will return false.
...And 2 more matches
<xsl:stylesheet> - XSLT: Extensible Stylesheet Language Transformations
optional attributes exclude-result-prefixes specifies any namespace used in this document that should not be sent to the output document.
... default-collation specifies the default collation used by all xpath expressions appearing in attributes or text value templates that have the element as an ancestor, unless overridden by another default-collation attribute on an inner element.
...this is most often used when the stylesheet is embedded in another xml document.
...And 2 more matches
Loading and running WebAssembly code - WebAssembly
webassembly is not yet integrated with <script type='module'> or es2015 import statements, thus there is not a path to have the browser fetch modules for you using imports.
...the object looks like this: { module : module // the newly compiled webassembly.module object, instance : instance // a new webassembly.instance of the module object } note: usually we only care about the instance, but it’s useful to have the module in case we want to cache it, share it with another worker or window via postmessage(), or simply create more instances.
... note: the second overload form takes a webassembly.module object as an argument, and returns a promise directly containing the instance object as the result.
...And 2 more matches
Cross-domain Content Scripts - Archive of obsolete content
your add-on's package.json under the "cross-domain-content" key, which itself lives under the "permissions" key: "permissions": { "cross-domain-content": ["http://example.org/", "http://example.com/"] } the domains listed must include the scheme and fully qualified domain name, and these must exactly match the domains serving the content - so in the example above, the content script will not be allowed to access content served from https://example.com/.
... wildcards are not allowed.
... this feature is currently only available for content scripts, not for page scripts included in html files shipped with your add-on.
...t.send(); }); function getsummary(forecast) { return forecast.regionalfcst.fcstperiods.period[0].paragraph[0].$; } finally, we need to add the "cross-domain-content" key to "package.json": "permissions": { "cross-domain-content": ["http://datapoint.metoffice.gov.uk"] } content permissions and unsafewindow if you use "cross-domain-content", then javascript values in content scripts will not be available from pages.
SDK and XUL Comparison - Archive of obsolete content
security if they're not carefully designed, firefox add-ons can open the browser to attack by malicious web pages.
... although it's possible to write insecure add-ons using the sdk, it's not as easy, and the damage that a compromised add-on can do is usually more limited.
... low-level apis and third-party modules that's not the whole story.
... note that by doing this you lose some of the benefits of programming with the sdk including simplicity, compatibility, and to a lesser extent security.
addon-page - Archive of obsolete content
create a page that does not contain navigational elements.
... 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.
...after this, the page loaded from "data/index.html" will not contain navigational elements: var addontab = require("sdk/addon-page"); var data = require("sdk/self").data; require("sdk/tabs").open(data.url("index.html")); this only affects the page at "data/index.html": all other pages are displayed normally.
l10n - Archive of obsolete content
note that you can't currently use localize strings appearing in content scripts or html files, but you can share the localized strings you want by assigning it's values to a json serializable object.
... 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.
... note that if you use this parameter, you can't supply any placeholders.
...if you do not include the count parameter, you can supply one or more placeholder strings that are to be inserted into the translated string at locations defined by the translator.
page-worker - Archive of obsolete content
a page worker may be destroyed, after which its memory is freed, and you must create a new instance to load another page.
... the page is not displayed to the user.
...after you destroy a page worker, its memory is freed and you must create a new instance if you need to load another page.
...it contains a single key named script whose value is a boolean that indicates whether or not to execute script in the content.
content/mod - Archive of obsolete content
if window is not specified, modification is removed from all the windows it's being attached to.
...if window is not provided modification is removed from all targets it's being attached to.
...if target does not represents valid content null is returned.
...if target is not provided modification is removed from all targets it's being attached to.
preferences/service - Archive of obsolete content
returns string,number,boolean : preference value, returns defaultvalue if no preference is set, returns undefined if defaultvalue is not provided.
... returns boolean : returns whether or not the application preference name exists.
... returns boolean : returns whether or not the application preference name both exists and has been set to a non-default value by the user (or a program acting on the user's behalf).
...if no user-set value is defined on name, the function does nothing.
window/utils - Archive of obsolete content
usage private windows with this module your add-on will see private browser windows even if it has not explicitly opted into private browsing, so you need to take care not to store any user data derived from private browser windows.
...private windows will not be included in this list if your add-on has not opted into private browsing.
...note that these windows may still be loading.
...in particular: null: get all window types navigator:browser: get "normal" browser windows devtools:scratchpad: get scratchpad windows navigator:view-source: get view source windows if you're not also passing options, you can omit this, and it's the same as passing null.
Creating Reusable Modules - Archive of obsolete content
note that you usually won't // need to work with the string paths.
...note that you usually won't // need to work with the string paths.
...note that you usually won't // need to work with the string paths.
... } return path; } exports.promptforfile = promptforfile; md5.js next, create another file in "lib", called "md5.js".
Canvas code snippets - Archive of obsolete content
this can be very useful to compare for example if a user has painted over another area as explained in this blog post.
...this can be used to determine if the mouse cursor is inside a certain shape or not.
...to', 'beginpath', 'beziercurveto', 'clearrect', 'clip', 'closepath', 'drawimage', 'fill', 'fillrect', 'filltext', 'lineto', 'moveto', 'quadraticcurveto', 'rect', 'restore', 'rotate', 'save', 'scale', 'settransform', 'stroke', 'strokerect', 'stroketext', 'transform', 'translate']; var gettermethods = ['createpattern', 'drawfocusring', 'ispointinpath', 'measuretext', // 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', ...
... note that this only works if you are running the page from chrome.
QuerySelector - Archive of obsolete content
along the lines of other frameworks such as jquery or prototype, shortening the "queryselector" name can be convenient: function $ (selector, el) { if (!el) {el = document;} return el.queryselector(selector); } function $$ (selector, el) { if (!el) {el = document;} return el.queryselectorall(selector); // note: the returned object is a nodelist.
... // if you'd like to convert it to a array for convenience, use this instead: // return array.prototype.slice.call(el.queryselectorall(selector)); } alert($('#myid').id); (note that while using the firefox web console, the above functions are available automatically.) both xul and even xml can be easily made supportable (an alternative approach to the following would be to add chromewindow.prototype or window.prototype, accessing this.document.queryselector, or following the jquery style of chaining by returning 'this' within each prototype method of $()): htmldocument.prototype.$ = function (selector) { // only for html return this.queryselector(selector); }; example: <h1>test!</h1> <script> htmldocument.prototype.$ = function (selector) { return this.queryselector(selec...
...e.$ = function (selector) { return this.queryselector(selector); }; var xulns = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'; alert(document.getelementsbytagnamens(xulns, 'hbox')[0].$('vbox').nodename); // vbox ]]></script> xml example: <foo xmlns="somens"><bar/></foo> in document earlier var foo = document.getelementsbytagnamens('somens', 'foo')[0]; alert(foo.$('bar')); note that for plain xml, the # 'id' selector will not work with an 'id' attribute (since a such-named attribute need not necessarily be of type id in xml, though it is in html and xul), nor will it work with xml:id.
... however, it will work with attribute selectors that target non-prefixed attributes (such as 'id', but not xml:id: http://www.w3.org/tr/selectors-api/#resolving) (even though css3 does support namespaced attribute selectors: http://www.w3.org/tr/css3-selectors/#attrnmsp and potentially xml:id as #: http://www.w3.org/tr/css3-selectors/#id-selectors ).
getAttributeNS - Archive of obsolete content
as some browsers do not support getattributens, the following might be used to work on them as well.
... note that all gecko-based browsers (including firefox) support dom:element.getattributens.
... this function is not necessary for gecko-based browsers.
...atch prefixes found above with desired local name if (attrs2[i].nodename.match(xmlnsprefix) && attrs2[i].nodevalue === ns ) { // e.g., 'xmlns:xlink' and 'http://www.w3.org/1999/xlink' return attrs[j].nodevalue; } } thisitem = thisitem.parentnode; } } } return ''; // if not found (some implementations return 'null' but this is not standard) } alert(getattributenswrapper (someelement, 'http://www.w3.org/1999/xlink', 'href')); // gets xlink:href, xl:href, etc.
Mozilla Documentation Roadmap - Archive of obsolete content
first of all, the in-site search is not reliable, so we recommend using a search engine like google, with queries such as "mdc javascript code modules" or "javascript code modules site:developer.mozilla.org".
...it includes links to tutorials and documentation, development tools, and most notably, the mozilla add-ons forum.
... another somewhat obscure communication channel is the mozilla newsgroups.
...another advantage is that discussions are archived and searchable through google groups.
Add-ons - Archive of obsolete content
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).
... legacy add-ons this section contains links to documentation for legacy technology for add-on development, including: legacy extensions for firefox for android add-ons that work with desktop firefox do not automatically work in firefox for android: overlay extensions this page contains links to documentation for the approach to developing extensions for gecko-based applications which uses: performance best practices in extensions one of firefox's great advantages is its extreme extensibility.
...this article offers some best practices and suggestions that can not only improve the performance and speed of your extension, but also of firefox itself.
...some items mentioned are strict guidelines, meaning that if you don't follow them then your add-on will not be approved on mozilla add-ons.
Case Sensitivity in class and id Names - Archive of obsolete content
for example, you would not want to do something like: .urgent {color: purple;} .urgent {color: yellow;} even though these are technically two distinct class names, browsers other than netscape 6 will treat them as though they are the same thing.
... therefore, authors should not rely on case-sensitivity as a way of creating distinct identifiers, unless they are designing solely for a truly standards-compliant browser such as netscape 6.
... recommendation because of the flaws which are present in some existing implementations and the restrictions defined in html 4.01, it is doubly important to ensure that your class and id names are of a consistent case throughout a document, and that you do not attempt to define names which are case-insensitive matches.
... note: this reprinted article was originally part of the devedge site.
Installing plugins to Gecko embedding browsers on Windows - Archive of obsolete content
for example, netscape 6.0 and 6.01 do not write any of these keys into the registry, and thus these keys are not available for plugin vendors to parse for these two browsers.
... go to hkey_local_machine\software\mozilla caveat emptor: if the mozilla subkey is not present under hkey_local_machine, look under hkey_current_user\software\mozilla\.
... go to hkey_local_machine\software\mozilla caveat emptor: if the mozilla subkey is not present under hkey_local_machine, look under hkey_current_user\software\mozilla\.
... go to hkey_local_machine\software\mozilla caveat emptor: if the mozilla subkey is not present under hkey_local_machine, look under hkey_current_user\software\mozilla\.
Same-origin policy for file: URIs - Archive of obsolete content
specifically, a file can read another file only if the parent directory of the originating file is an ancestor directory of the target file.
... directories cannot be loaded this way, however.
... for example, if you have a file foo.html which accesses another file bar.html and you have navigated to it from the file index.html, the load will succeed only if bar.html is either in the same directory as index.html or in a directory contained within the same directory as index.html.
...for cross-window dom access, each file is treated as a separate origin, with one exception: if a file is loaded from another file that would otherwise be able to load it following this same-origin policy, they are considered to have the same origin.
Making a Mozilla installation modifiable - Archive of obsolete content
mozilla's user interface is made up of xul (described below), xbl (a topic for another tutorial), javascript, css, and image files.
...although jar archives are binary files, mozilla's ui is not compiled into machine code; mozilla instead builds its ui from the non-compiled files in the archive each time it starts up.
...on unix-like operating systems with bash-like shells, you can run the following command within that directory to accomplish this task: for file in *.jar; do unzip $file; done on operating systems with dos-like shells, the following command accomplishes this task: for %file in (*.jar); do unzip %file note that there are platform-specific files — en-mac.jar, en-unix.jar, and en-win.jar — in that directory.
...make sure you start the modified copy and not the default installation on your machine, and shut down "quick launch" if you are on windows and that feature is enabled.
Making it into a static overlay - Archive of obsolete content
a xul overlay is a xul file containing elements to be inserted into another xul file when the other xul file is rendered into an application interface.
...note that we've added a new attribute to the statusbarpanel element: insertbefore.
... this attribute identifies another statusbarpanel element within statusbar before which our element should appear.
...we could instead have used an insertafter attribute to place the element after another.
Dehydra Function Reference - Archive of obsolete content
process_function(decl, body) dehydra calls this for each function definition (declarations without bodies are not included), including both top-level functions, class member functions, and inline class member functions.
...if a property is not specified then it will not be passed to the runtime.
...it is not possible to define new warnings in dehydra, thus one has to figure out a warning code from an existing warning and hijack it for ulterior purposes.
...it does not print the location.
Drag and Drop - Archive of obsolete content
for example, dragging files to other directories, or dragging an icon to another window to open the document it refers to.
...if something cannot be dragged, it should not start a drag session.
... note that drag sessions can be created from within mozilla itself or from other applications.
...if the object can be dropped on the element, the drag session should be notified.
Block and Line Layout Cheat Sheet - Archive of obsolete content
maxelementwidth the maximum width for elements within the frame that cannot be broken down further; e.g., the longest word in a paragraph.
... note that an out-of-flow frame (e.g., a floater) may affect this value.
...when null, the frame need not compute it.
...(if not, the top margin will be applied as a result of the generational margin collapsing logic in nsblockreflowcontext::computecollapsedtopmargin().
Content states and the style system - Archive of obsolete content
to this end, when a <code>contentstateschanged</code> notification is dispatched for a content node the first thing that's done is to is to check whether the content state change something could affect any styles.
... the way we determine whether the selector might have stopped or started matching the node is by just checking whether it matches with the caveat that all the state-dependent pseudo-classes corresponding to the states that changed must be treated as matching (whether they actually do and whether they're negated or not).
... for example, say we have the selectors: a:hover a:not(:hover) div:hover and the hover state on some node changes.
... we then try matching the node against these selectors, with the assumption that both :hover and :not(:hover) match the node.
Introducing the Audio API extension - Archive of obsolete content
please note that this document describes a non-standard experimental api.
...those samples may or may not have been played yet at the time of the event and have not been adjusted for mute or volume settings on the media element.
...it's important to note that the samples are not separated by channels; they are all delivered together.
...it's important to note that not all the samples might get written in the stream.
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.
... warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser.
...be returned: error string description "error:usercancel" the user canceled the import operation "error:invalidcertificate" one of the certificate packages was incorrectly formatted "error:internalerror" the software encountered some internal error, such as out of memory "error:invalidrequestid" the request id in the response message does not match any outstanding request ...
Me - Archive of obsolete content
ArchiveMozillaJetpackMetaMe
note: this page documents the jetpack prototype, which is no longer under active development.
...the namespace currently lives in the future and must be imported before it is used: jetpack.future.import("me"); methods onfirstrun(funcfunction)jetpack.me.onfirstrun() allows jetpacks to be notified after they are successfully installed.
...note that this mechanism is independent of the first-run page; in particular, the callback is not a load event listener or jquery ready callback.
...inside the function, this is the jetpack's content.function example jetpack.me.onfirstrun(function(){ jetpack.notifications.show("oh boy, i'm installed!");}); ...
Bundles - Archive of obsolete content
the bundle can hold additional resources currently limited to: application ini settings application icon script for the application chrome, not the web content installing a bundle when prism opens a webapp bundle it will unpack it into the webapps/{webapp-id} folder.
...since this folder maybe be located in a directory that requires elevated privileges, the web application should not write data to it.
...note: the webapp must have an id in order to be installed.
...the extension looks for <link> tags in the webpage that point to a webapp bundle: <link rel="webapp" href="prismdemo.webapp" title="prism demo"> when the extension finds such a <link> tag, it will notify the user.
HostWindow - Archive of obsolete content
when not displayed the entire location bar section is hidden.
...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.
RDF Datasource How-To - Archive of obsolete content
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.
...an "address book" datasource could translate a database file into statements like "spammer128@hotmail.com's real name is 'billy dumple'" and "spammer128@hotmail.com is considered an 'important friend'." statements from one datasource can be combined with statements from another datasource using a composite datasource.
...there are several existing vocabularies of note, including: the rdf schema specification.
... 1 as of this writing, it is not currently possible to implement javascript xpcom components; however, it may soon be possible to do so via xpconnect.
Remote debugging - Archive of obsolete content
when a bug is reproducible by a community member, but not on a developer's computer, a last-resort strategy is to debug it on the community member's computer.
... the crash victim should at least know how to run a debugger, if not how to use it, and should have a debug build of firefox handy.
...the developer trusts that his time is not being wasted: the crash is a real bug in firefox.
... there give more information about the stack than a breakpad crash report: not only the names of the functions on the stack, but also the values they were passed.
Table Layout Strategy - Archive of obsolete content
min_con des_con fix min_adj des_adj fix_adj pct pct_adj min_pro final the width parameter have the following meaning: #define width_not_set -1 #define num_widths 10 #define num_major_widths 3 // min, des, fix #define min_con 0 // minimum width required of the content + padding #define des_con 1 // desired width of the content + padding #define fix 2 // fixed width either from the content or cell, col, etc.
...for instance one cell could have a large min width,the next could have a specified fixed width and another a specified pct width.
... special cases note: the following examples are not shown correctly due to technical constraints on wiki content.
...="0*"><col> <tbody> <tr><td>foo</td><td>bar</td></tr> </tbody> </table> this shrink wrapping width has usually the suffix 0proportional effective columns <tbody></tbody>foobarbazzap <table width="200px" border> <tbody> <tr><td>foo</td><td colspan="2" width="120px">bar</td></tr> <tr><td>baz</td><td>zap</td></tr> </tbody> </table> the colspan here is bogus, so the third column should not get any width.
Abc Assembler Tests - Archive of obsolete content
sample abcasm test /* ***** begin license block ***** * version: mpl 1.1/gpl 2.0/lgpl 2.1 * * the contents of this file are subject to the mozilla public license version * 1.1 (the "license"); you may not use this file except in compliance with * the license.
...if you wish to allow use of your version of this file only * under the terms of either the gpl or the lgpl, and not to allow others to * use your version of this file under the terms of the mpl, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the gpl or the lgpl.
... if you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the mpl, the gpl or the lgpl.
...null" // testname pushtrue // expected pushnull pushnull lessequals // actual callpropvoid compare_stricteq 3 // use .try / .catch to catch typeerror // convert_o null .try { pushnull convert_o pop findproperty fail pushstring "convert_o null" pushstring "exception should have been thrown: typeerror: error #1009: cannot access a property or method of a null object reference." getlocal1 callpropvoid fail 3 jump finished_convert_o_null } .catch { getlocal0 pushscope setlocal2 // save typeerror findproperty compare_typeerror pushstring "convert_o null" // test name pushstring "typeerror: error #1009" // expected getlocal2 //...
Tuning Pageload - Archive of obsolete content
during this delay, the page that's coming in is not painted, unless it ends up fully loaded before the delay expires.
... the idea here is twofold.this reduces ugly visual jitter as the new page comes in by not starting painting till after we have a bunch of the data.this makes overall page load time shorter by not doing extra repaints very early on.
... content.notify.* controls the information flow from content sink to rendering model.
...specifically - content.notify.ontimer controls whether the frame constructor is notified off a timer at all content.notify.backoffcount controls how many times that happens for a given page (the default is arbitrarily many times).
Binding Implementations - Archive of obsolete content
it can be assumed that the anonymous content of the binding has been fully constructed, although the bindingattached event will not have fired.
...when set to true, the property's value cannot be altered.
... the following is currently not implemented in mozilla, it seems.
... note: the following paragraphs suggest a syntax for how javascript might enable access to base class methods and properties.
addDirectory - Archive of obsolete content
version, string xpisourcepath, object localdirspec, string relativelocalpath, boolean forceupdate); parameters the adddirectory method has the following parameters: registryname the pathname in the client version registry for the root directory of the files that are to be installed.this parameter can be an absolute pathname (beginning with a /) or a relative pathname, (not beginning with a slash).
...a relative pathname is appended to the registry name of the package as specified by the package parameter to the initinstall method.this parameter can also be null, in which case the xpisourcepath parameter is used as a relative pathname.note that the registry pathname is not the location of the software on the computer; it is the location of information about the software inside the client version registry.
...when xpisourcepath is an empty string, registryname cannot be null.
...also see the note about binaries on the macintosh platform in addfile.
browser.type - Archive of obsolete content
if this is not set, the loaded document has the same access as the window containing the browser.
...the content that is loaded inside the browser is not allowed to access the chrome above it.
...the content that is loaded inside the browser is not allowed to access the chrome above it.
...the content that is loaded inside the browser is not allowed to access the chrome above it.
mousethrough - Archive of obsolete content
« xul reference home mousethrough type: one of the values below determines whether mouse events are passed to the element or not.
... if this attribute is not specified, the value is inherited from the parent of the element.
...this means that the element will not receive any mouse events due to either clicking or movement.
...if the mousethrough attribute was not used, the image would receive all mouse events and the button could not be pressed with the mouse.
close - Archive of obsolete content
note that the close event is only fired when the user presses the close button on the titlebar; (i.e.
... not file -> quit).
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
Floating Panels - Archive of obsolete content
a floating panel can be created using the panel element with at least two additional attributes as in the following example: <panel id="tools-panel" noautohide="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.
...on mac, floating panels are invisible when another application is made active, and become visible again when the xul application is made active.
...a label for the titlebar may be set using the label attribute, as in the following example: <panel id="info-panel" noautohide="true" titlebar="normal" label="image properties"> closing a floating panel unlike other panels, a floating panel does not close when clicking outside of it.
Panels - Archive of obsolete content
note that the panel is not placed in a separate file and is instead placed inside another window.
...this causes the panel to be displayed not where the mouse was clicked but aligned along the bottom edge of the label.
...note that this will also keep the focus within the panel when it is closed.
... this process of removing the focus when opening and closing a popup occurs after the popupshowing event or popuphiding event is fired, which means that if those events are cancelled, the focus is not adjusted.
Popup Guide - Archive of obsolete content
a popup is not created as a separate window or file, instead it is included inside another window or dialog.
...often, depending on what was clicked on, certain commands may be hidden if not applicable to that element.
... platform specific menu considerations see special per-platform menu considerations for some notes about handling menus on certain platforms, for instance creating the application menu on a macintosh.
...another common task is to create an extension which adds an item to the browser's context menu.
Actions - Archive of obsolete content
in this example, there's only one variable to use, ?relateditem, since ?start is the starting point and the start and end points cannot be the same.
...although the uri attribute should only be on one element, it does not have to be the outermost element in the action body.
...one difference is that this content is only generated once, not for every result.
...here is an image of [this example] (note: see the next section for an explanation of why there are extra buttons here.) « previousnext » ...
Additional Template Attributes - Archive of obsolete content
the listbox here does not have any children, although it may do.
...the generated content is always inserted into the root node, in this example the listbox, not inside the template.
...this isn't particularly useful although there is a very slight optimization since the builder does not need to scan the action body looking for the member variable when compiling the queries and rules.
...note also that a rule element is needed here, otherwise the builder will think the container and member attributes are conditions to check.
XML Assignments - Archive of obsolete content
for instance, you might want to display not the name of a person, but the length of their name.
...however, you cannot use a expression that returns a number in the query, as the query must return dom nodes as results.
...note that while the query expression uses the root node (or reference node) as the xpath context, the expressions for the assign element are evaluated using each result node as the context.
...(in this case, the number of xml node siblings in the document, not the number of real siblings the people have, clearly the people in the datasource aren't actually siblings).
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
if an event does not match any of the handler events, it is simply passed to the inner content as usual.
...you might have a need to change whether an element can have the focus or not.
...for simplicity, the entire text is cut and not just the selected text.
... a copy operation is similar but does not clear the text afterwards.
Adding Labels and Images - Archive of obsolete content
text elements you cannot embed text directly into a xul file without tags around it and expect it to be displayed.
...the text will not wrap, so the text will all be displayed on a single line.
...description element for descriptive text not associated with any particular control, you can use the description tag.
...note that the tag name is different than html (image instead of img).
Creating a Wizard - Archive of obsolete content
note that wizards currently only work properly from chrome urls.
...in the example above, it has been placed on the second page, but not the first page.
...if it returns false, then the wizard does not close, which might occur if the function savedoginfo() encountered invalid input, for example.
... when trying to use a function in the event above, such as pageadvanced, you should use return funcname() instead of just calling funcname() or it will not work as expected e.g.
Input Controls - Archive of obsolete content
note that while in html, several different kinds of fields can be created with the input element, in xul there are separate elements for each type.
...in xul, you can use the textbox element for this purpose as well -- two separate elements are not necessary.
... notice that the label and the text input field have now appeared in the window.
...note that the control attribute has been used so that the textbox is selected when the label is clicked.
Introduction - Archive of obsolete content
note that only the user interface will be created, with only limited functionality.
... the actual finding of files will not be implemented.
...however, these types of applications do not have security restrictions placed on them, so they may access local files and read and write preferences, for example.
... this tutorial attempts to cover much of xul's functionality, however, not all features are discussed.
Manipulating Lists - Archive of obsolete content
similar to the dom appendchild() function except that it takes a string label, and you do not have to worry about where to add it in the list structure.
...in other cases, you may wish to check to ensure that selecteditem is not null before continuing.
...however, menulists do not fire the select event; instead you can listen to the command event to handle when an item is selected.
...the ensureindexisvisible() method is similar in that it also scrolls to show a row, but this method does not scroll if the item is already visible.
Modifying the Default Skin - Archive of obsolete content
this documentation has not been fully updated for firefox quantum.
... support for the userchrome.css file and any of its elements described below are not guaranteed in future versions of firefox.
... menuitem { border: 1px solid red; } if you look in one of the skin archives, you will notice that each contain a number of style sheets and a number of images.
...this is because a particular skin's design might not use images and it may need some more complex design.
More Button Features - Archive of obsolete content
example 1 : source view <button label="help" image="happy.png"/> button with css image another way to specify the image is by using the css list-style-image style property on the button.
...note that you really should put the style declarations in a separate style sheet.
...note that the two attributes are not specified when the default value can be used.
...note that selecting one of these menu items does not change the label on the button, unlike a menulist.
More Menu Features - Archive of obsolete content
notice how the menu bar was added inside the toolbox.
...we'll assume that there's nothing to paste.
...when another item is selected, the previously selected item is unchecked.
...the last menu item, earth, while a radio button, is not part of this group because it has a different name.
More Wizards - Archive of obsolete content
note that the goto() method, because it causes a page change, will fire the events again, so you'll have to make sure you handle that case.
... wizard functions the wizard works much like a tabbed panel, except that the tabs are not displayed and the user navigates between pages by using the buttons along the bottom.
...thus, you do not have to load and save information between pages.
... another useful property of the wizard is currentpage, which holds a reference to the currently displayed wizardpage.
RDF Datasources - Archive of obsolete content
the special datasource rdf:null corresponds to nothing.
...you will notice that the value of the ref attribute in the example is http://www.some-fictitious-zoo.com/mammals which corresponds to one of the seq elements in the rdf file.
...because rule one has no content, nothing will be displayed for these ones.
...the end effect is that we get a popup menu containing all the mammals which have a specimen that is not 0.
Simple Menu Bars - Archive of obsolete content
although you can create custom menus, any special style rules or non-menu elements that you place on a menu may not be applied.
...note that it has been placed inside a flexible toolbox.
... the menu element is normally placed on a menubar, although it does not have to be.
...it does not associate a key action with the menuitem however.
Updating Commands - Archive of obsolete content
note that we don't need to figure out which element to use or which controller to use.
...also, we could just call docommand without checking if the command was enabled or not, although we probably shouldn't do that.
...you will need to think about when a command is valid and when it is not.
...note that the command updater will receive notifications about all focus events on all elements, even if other event handlers respond to the event.
listhead - Archive of obsolete content
attributes disabled properties acesssibletype, disabled examples (example needed) attributes disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
... in the case of form elements, it will not be submitted.
... do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case.
listheader - Archive of obsolete content
/listhead> <listitem> <listcell label="george"/> <listcell label="house painter"/> </listitem> <listitem> <listcell label="mary ellen"/> <listcell label="candle maker"/> </listitem> <listitem> <listcell label="roger"/> <listcell label="swashbuckler"/> </listitem> </listbox> attributes disabled type: boolean indicates whether the element is disabled or not.
...if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire.
... in the case of form elements, it will not be submitted.
... do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case.
scrollbox - Archive of obsolete content
note that a scrollbox doesn't cause scrollbars to be displayed.
... <vbox flex="1" style="overflow:auto"> <label value="01 four score and seven years ago "/> <label value="02 our fathers brought forth on "/> <label value="03 this continent, a new nation, "/> <label value="04 conceived in liberty, and "/> <label value="05 dedicated to the proposition "/> <label value="06 that all men are created equal."/> </vbox> the flex="1" above may or may not be needed, or even desired.
... note that this example doesn't use a scrollbox tag; you only need that tag if you want to programmatically scroll in addition to the automatic scroll bars.
... note: avoid nested scroll boxes; it's maddening for the experienced user and confusing for the less experienced user.
tabbox - Archive of obsolete content
attributes eventnode, handlectrlpageupdown, handlectrltab properties accessibletype, eventnode, handlectrlpageupdown, handlectrltab, selectedindex, selectedpanel, selectedtab, tabs, tabpanels examples <tabbox id="mytablist" selectedindex="2"> <tabs> <tab label="a first tab"/> <tab label="second tab"/> <tab label="another tab"/> <tab label="last tab"/> </tabs> <tabpanels> <tabpanel><!-- tabpanel first elements go here --></tabpanel> <tabpanel><!-- tabpanel second elements go here --></tabpanel> <tabpanel><button label="click me"/></tabpanel> <tabpanel><!-- tabpanel fourth elements go here --></tabpanel> </tabpanels> </tabbox> attributes eventnode type: one of the values bel...
...if this attribute is not specified, events are listened to from the tabbox.
... thus, if this attribute is not used, the tabbox or an element inside it must have the focus for the keyboard navigation to apply.
...if this attribute is set to false, these keys do not navigate between tabs.
Components - Archive of obsolete content
place after a new component has been written it must be placed in the app/components/ directory (not xulrunner/components/).
...unlike extensions, it must be directly in that directory, not a subdirectory.
...for new components or interface changes of existing ones to be noticed at all, you need to change the buildid in application.ini to trigger a re-registration of the components.
... alternatively, you can delete compreg.dat and xpti.dat in the user profile directory - that of your xulrunner app, not that of firefox/mozilla.
What XULRunner Provides - Archive of obsolete content
the following features are either already implemented or planned: gecko features xpcom networking gecko rendering engine dom editing and transaction support (no ui) cryptography xbl (xbl2 planned) xul svg xslt xml extras (xmlhttprequest, domparser, etc.) web services (soap) auto-update support (not yet complete) type ahead find toolbar history implementation (the places implementation in the 1.9 cycle) accessibility support ipc services for communication between gecko-based apps (not yet complete) storage/sqlite interfaces user interface features the following user interface is supplied by xulrunner, and may be overridden by embedders under certain circumstances: apis and user...
... extension manager file picker (uses native os filepicker as appropriate) find toolbar helper app dialog/ui security ui (maintenance of ssl keychains, etc) embedding apis the following embedding apis are provided by xulrunner: cross-platform embedding (xre_initembedding) javaxpcom embedding gtkmozembed (linux only) activex control (windows only) (not yet complete) obsolete since gecko 7.0 nsview-based-widget (mac os x only) (not yet complete) the "maybe" list the following features have been discussed and may be included if developer time permits and code size is controlled: ldap support spellchecking support (with or without dictionaries provided) see bug 285977 core support for profile roaming (with application-specific extensibil...
...ity) pyxpcom embedding (not yet complete) - but it does work, if you compile a custom build that includes the pyxpcom bindings and there is a working python available.
... what's out xulrunner will not supply: bookmarks or history ui (must be managed by the application/embedder) xforms (xforms will be available as an extension) ...
2006-09-29 - Archive of obsolete content
it was determined that the generated elements from wordpress do not follow the wc3 guidelines in appendix c of xhtml 1.0.
... * * the |height| member of the return value may be * ns_unconstrainedsize, but the |width| member must not be.
... * @param amargin the sum of the left and right margins of the * frame, including actual values resulting from * percentages, but not including actual values * resulting from 'auto'.
...it was concluded that a frame model change is utilized within a popup, not a layout change.
NPWindow - Archive of obsolete content
should not be modified by the plug-in.
...should not be modified by the plug-in.
...the window field holds a platform-specific handle to a drawable or an off-screen pixmap, as follows: windows: hdc mac os: pointer to np_port structure unix/x11: not used.
... the plug-in should not modify the field values in this structure.
Why RSS Slash is Popular - Counting Your Comments - Archive of obsolete content
rss does not have any facilites for including this information in an <item>, so the rss slash module exists to fill in this gap.
...although not necessary, people also often use other rss modules to get at (and read) the comments (since rss does not currently provide facilities for this either).
...one of the shortcomings of the <slash:comments> element is that does not tell you what that moment in time was.
...and that rss feeds that are aggregations of other rss feeds will not be able to assert this.
Getting Started - Archive of obsolete content
however, those experienced with rss may also find this useful as an aid in filling in any missing information about rss that they were not aware of, or as a refresher guide.
... note: if you are not a web developer and do not want to become one, then this tutorial is not for you.
... note: a word processor is not a text editor.
... it is not mandatory to create rss files in this tutorial (you can just read on), but this would be a less effective way for you to learn.
Digital Signatures - Archive of obsolete content
but encryption and decryption, by themselves, do not address another problem: tampering.
... the content of the hashed data cannot, for all practical purposes, be deduced from the hash-which is why it is called "one-way." similarly, in public key encryption, a key pair is generated for digital signing.
...if the two hashes match, the data has not changed since it was signed.
...once you have signed some data, it is difficult to deny doing so later, assuming that the private key has not been compromised or out of the owner's control.
SSL and TLS - Archive of obsolete content
draft this page is not complete.
... note: longer rsa keys are required to provide security as computing capabilities increase.
...triple des (data encryption standard) is the second-strongest cipher supported by ssl, but it is not as fast as rc4.
...the drawback to using ecc is that it is not as widely supported as rsa.
Threats - Archive of obsolete content
threats may involve intentional actors (e.g., attacker who wants to access information on a server) or unintentional actors (e.g., administrator who forgets to disable user accounts of a former employee.) threats can be local, such as a disgruntled employee, or remote, such as an attacker in another geographical area.
...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.
... certificate system common criteria certification 8.1: deployment, planning, and installation original document information author(s): joint task force transformation initiative title: national institute of standards and technology (nist) special publication 800-30 revision 1, guide for conducting risk assessments last updated date: september 2012 copyright information: this document is not subject to copyright.
... original document information author(s): karen scarfone, wayne jansen, and miles tracy title: national institute of standards and technology (nist) special publication 800-123, guide to general server security last updated date: july 2008 copyright information: this document is not subject to copyright.
-moz-stack-sizing - Archive of obsolete content
the property is set not on the stack itself, but on the stack's children.
... this lets you ignore certain children, but not others.
... note: in previous versions of gecko it was possible to work around the problem by setting very large negative bottom and right margins on the stack element and equally large positive bottom and right margins on the children whose size you didn't want to ignore.
... (the problem does not affect children moved above or to the left of the stack.) initial valuestretch-to-fitapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values stretch-to-fit the child will influence the stack's size.
-ms-block-progression - Archive of obsolete content
formal syntax tb | rl | bt | lr specifications not part of any specification.
...images are not rotated, but tables are.
... box layout in vertical orientations is exactly analogous to layout in the horizontal orientation: width, height, top, bottom, right, and left do not rotate with the text.
... only one block progression is active at a time; these values cannot be combined.
E4X for templating - Archive of obsolete content
e) { if (cond && cond != undefined) { // we need undefined condition for e4x return h(cond); } else if (_else) { return _else(cond); } return ''; // empty string allows conditions in attribute as well as element content } for example: {_if(elems.length(), function () <description>{elems[0]}</description>, function _else () <label>no data</label> )} note that the simple xmllist() constructor (<></>) may be useful to still be able to use an expression closure (i.e., without needing return statements and braces): {_if(elems.length(), function () <> <markup/> <markup/> </>)} note that, while it is convenient to store such e4x in separate file templates (to be eval()d at a later time, taking into account security considerations, such...
... using such functions can also be easily serialized inline (and then perhaps converted to the dom) as needed: var list = <>{_if(elems.length(), function () <> <markup/> <markup/> </>)}</>.toxmlstring(); iterating functions such as the following foreach (which can work with arrays, objects, or e4x objects) are quite convenient in iterating over complex structures such as e4x would not normally allow.
... /* the first two arguments are optional: (h is a handler with an explicit argument v only, or beginning with k, v) lev is optional argument to note recursive depth (if part of recursion) */ function foreach (min, max, arr, h, lev) { var k, ret=<></>, it = 1; lev = lev || 0; if (typeof min === 'number') { if (typeof max !== 'number') { lev = h; h = arr; arr = max; max = min; min = 1; } } else { lev = arr; h = max; arr = min; max = number.positive_infinity; min = 1; } if (h.length === 1) { for (k in arr) { if (it < min) { ++it; continue; } if (it > max) { break...
... else { var ser = (new xmlserializer()).serializetostring(item); ret += new xml(ser); } }); return ret; } example: var fruits = <fruits> <item>pear</item> <item>banana</item> <item>grapes</item> </fruits>; alert( // using a javascript 1.8 expression closure <output> {sort(fruits.*, function (a, b) a.text() > b.text() /* text() call may not be necessary */ )} </output>.toxmlstring() ); /* <output> <item>banana</item> <item>grapes</item> <item>pear</item> </output> */ the above utility also works if the input is an htmlcollection, an array of strings, an array of dom objects, or an array of e4x objects (assuming the comparison function is changed or adapted accordingly).
Accessing XML children - Archive of obsolete content
operator or [] notation to set properties.
...this gives an xml document of <foo> <bar> <baz/> <quux/> </bar> </foo> note, however, that assigning a non-xml value to a child element that doesn't exist will create that element.
...var element = <foo> <bar baz="1">red</bar> <bar baz="2">blue</bar> </foo>; var list = element.bar; list.length(); // returns 2 list[0]; // the first bar element list[1]; // the second bar element notice further that this list is "live" in the sense that changes made to the list are reflected back in the element that the list originally came from.
...var a = <foo> some text <bar>not text</bar> more text </foo>; var list = a.text(); list.length(); // returns 2 list[0]; // returns " some text " list[1]; // returns " more text " you can similarly access comment nodes: xml.ignorecomments = false; var a = <foo> some <!-- abc --> text </foo>; var comments = a.comments(); alert(comments[0]); // returns <!-- abc --> the * selector will return all child nodes in an xml list.
ECMAScript 2016 to ES.Next support in Mozilla - Archive of obsolete content
async function expression (firefox 52) asyncfunction (firefox 52) await (firefox 52) trailing commas in function parameter lists (firefox 52) ecmascript 2018 spread in object literals and rest parameters (firefox 55) for await...of (firefox 57) global_objects/sharedarraybuffer (firefox 57, with flags) global_objects/promise/finally (firefox 58) global_objects/regexp/dotall (not yet implemented; in other browsers) regexp lookbehind assertions (not yet implemented; in other browsers) regexp unicode property escapes (not yet implemented; in other browsers) regexp named capture groups (not yet implemented; in other browsers) ecmascript 2019 array.flat() (firefox 62) array.flatmap() (firefox 62) object.fromentries() (firefox 63) string.trimstart() and string.trime...
... implemented proposals not in es.next this section needs to be updated to reflect current changes.
... (may 2019) the following features are already implemented, but only available in the firefox nightly channel and not yet included in a draft edition of an ecmascript specification.
...this feature is non-standard and not documented.
ActiveXObject - Archive of obsolete content
warning: this object is a microsoft extension and is supported in internet explorer only, not in windows 8.x store apps.
...for example, for the local intranet zone, you typically need to change a custom setting to "initialize and script activex controls not marked as safe for scripting." to identify members of an automation object that you can use in your code, you may need to use a com object browser, such as the ole/com object viewer, if no reference documentation is available for the automation object.
...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.
Debug.msTraceAsyncCallbackCompleted - Archive of obsolete content
if not specified, debug.ms_async_op_status_success is used.
... the possible values for status include: debug.ms_async_op_status_success debug.ms_async_op_status_canceled debug.ms_async_op_status_error note: some debugging tools do not display the information sent to the debugger.
... 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 - Archive of obsolete content
do not use!
... syntax you do not instantiate the debug object.
... if the script is not being debugged, the debug methods and properties have no effect.
...debugging may be enabled or disabled whether or not a debugger is attached.
GetObject - Archive of obsolete content
do not use!
... 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.
...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.
...for example: myobject.line(9, 90); myobject.inserttext(9, 100, "hello, world."); myobject.saveas("c:\\drawings\\sample.drw"); note: use the getobject function when there is a current instance of the object, or if you want to create the object with a file already loaded.
@set - Archive of obsolete content
warning: conditional compilation is not supported in internet explorer 11 standards mode and windows 8.x store apps.
...strings are not.
... this works because nan is the only value not equal to itself.
... requirements supported in all versions of internet explorer, but not in windows 8.x store apps.
New in JavaScript 1.2 - Archive of obsolete content
note that netscape navigator 3.0 and earlier ignored scripts with the language attribute set to "javascript1.2" and higher.
...--> new features in javascript 1.2 new objects you can create objects using literal notation (inspired by dictionary literal syntax from python 1.x).
... arrays can now be created using literal notation (inspired by list literal syntax from python 1.x).
... number now produces nan rather than an error if x is a string that does not contain a well-formed numeric literal.
Archived JavaScript Reference - Archive of obsolete content
do not use it!array.observe()the array.observe() method was used for asynchronously observing changes to arrays, similar to object.observe() for objects.
...for each distinct property, a specified statement is executed.function.aritynot part of any standard.function.prototype.isgenerator()the non-standard isgenerator() method used to determine whether or not a function is a generator.
...do not use it!handler.enumerate()the handler.enumerate() method used to be a trap for for...in statements, but has been removed from the ecmascript standard in es2016 and is deprecated in browsers.legacy generator functionthe legacy generator function statement declares 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.
... extensions to the otherwise standard javascript apis.new in javascriptthis chapter contains information about javascript's version history and implementation status for mozilla/spidermonkey-based javascript applications, such as firefox.number.tointeger()the number.tointeger() method used to evaluate the passed value and convert it to an integer, but its implementation has been removed.object.getnotifier()the object.getnotifer() method was used to create an object that allows to synthetically trigger a change, but has been deprecated and removed in browsers.object.observe()the object.observe() method was used for asynchronously observing the changes to an object.
forEach - Archive of obsolete content
feel free to alter the text as english is not my mother tongue and i'm more concerned with the code quality that the english grammar ;-s dotnetcarpenter 30 june 2012 <hr> the compatibility section goes to extraordinary lengths in providing a foreach implementation.
...if you wish to make changes, and especially if you wish to revert another user's changes, please either add a comment here, or post to dev-mdc@lists.mozila.org, explaining the change you desire.
...those extra features like foreach are gecko only, and it should be mentioned that they should *_not_* be used on web pages.
... if (value>1){ return false;//we could have some way to break when we return false } }); //woulld print 1 2 --porfirio 11:17, 22-06-2008 another option would be to throw stopiteration and catch it within foreach().
XForms Input Element - Archive of obsolete content
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.
...characteristics a text field is presented to the user when there is no type given for the bound node or a type is specified that is not handled by one of the other widgets (as documented below).
...will not work with xsd:datetime (behavior defaults to text input).
... calendar a form author may notice a xforms input element represented by a calendar widget in the mozilla xforms processor if the control meets the following criteria (xhtml/xul).
Archived open Web documentation - Archive of obsolete content
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.
... 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.
...do not use this ancient feature.
Correctly Using Titles With External Stylesheets - Archive of obsolete content
this can lead to a stylesheet being ignored, which is typically not what an author intends to do.
...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.
...this is different than persistent stylesheets, which are always applied to a document, whether an alternate stylesheet has been selected or not.
Fixing Table Inheritance in Quirks Mode - Archive of obsolete content
if the author had set a font size on the body element, for example, the font size of text within a table would match the user's default, not the body style.
...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.
...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.
... note: this reprinted article was originally part of the devedge site.
Mozilla's DOCTYPE sniffing - Archive of obsolete content
any "doctype html system" as opposed to "doctype html public", except for the ibm doctype noted below a doctype declaration without a dtd, i.e., <!doctype html>.
...in 1.0 and 1.1alpha and earlier (but not in 1.0.1 or 1.1beta), the presence of an xml declaration triggered full standards mode.
... a doctype declaration that cannot be understood (e.g., no matching quote).
... note that all public identifier comparisons are case-insensitive due to the significant number of pages that use public identifiers with incorrect case.
XQuery - Archive of obsolete content
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 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.
... notes for developers wishing to access xquery in their own extensions at present, the extension works simply by using liveconnect to work with berkeley db xml's java api (and via a java wrapper class which circumvents liveconnect's current inability to handle some types of java exceptions properly).
... however, the extension demonstrates a technique which does not depend on using xpcom, while still giving full privileges.
Building up a basic demo with A-Frame - Game development
note: an entity is any element — it can be an object like a box, cylinder or cone, but it can also be a camera, light or sound source.
... note: the distance values (e.g.
...we are not limited to the default entities like <a-cube> — using <a-entity> we can create custom advanced shapes.
... note: you can also check it out on github.
Building up a basic demo with PlayCanvas editor - Game development
this can be a more pleasant working environment if you are not someone who likes to code.
... next you'll see your project's page — there's not much yet.
... note: yes, you read that right — you need to enter the hex value without the hash/pound symbol.
...click on the root folder in the hierarchy panel (to make sure that the new shape appears in the root, and not as a child of the box) then click on the big add entity (plus) button and select cylinder from the dropdown list — it will add a new cylinder shape to the scene.
Mobile touch controls - Game development
note: the game captain rogers: battle at andromeda is built with phaser and managing the controls is phaser-based, but it could also be done in pure javascript.
... note: the touch events reference article provides more examples and information.
...r); the touchhandler function looks like this: function touchhandler(e) { if(e.touches) { playerx = e.touches[0].pagex - canvas.offsetleft - playerwidth / 2; playery = e.touches[0].pagey - canvas.offsettop - playerheight / 2; output.innerhtml = "touch: "+ " x: " + playerx + ", y: " + playery; e.preventdefault(); } } if the touch occurs (touches object is not empty), then we will have all the info we need in that object.
... we can get the first touch (e.touches[0], our example is not multitouch-enabled), extract the pagex and pagey variables and set the player's ship position on the screen by subtracting the canvas offset (distance from the canvas and the edge of the screen) and half the player's width and height.
Crisp pixel art look with image-rendering - Game development
but since today's screens render content at high resolutions, there is a problem with making sure the pixel art does not look blurry.
... original size 4x size 4x size (scaled with an image editor) none vendor's algorithm nearest-neighbor algorithm a css-based solution the good news is that you can use css to 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.
... set the <canvas> element's image-rendering css property to some value that does not make the image blurry.
...ript to set up the canvas and load the image: // get canvas context var ctx = document.getelementbyid('game').getcontext('2d'); // load image var image = new image(); image.onload = function () { // draw the image into the canvas ctx.drawimage(image, 0, 0); } image.src = 'https://udn.realityripple.com/samples/11/a2954fe197.png'; this code used together produces the following result: note: you can check out the original code on github (and a live example.) ...
Extra lives - Game development
in this article we'll implement a lives system, so that the player can continue playing until they have lost three lives, not just one.
... making our text styling dry as you probably noticed we're using the same styling for all three texts: scoretext, livestext and lifelosttext.
... events you have probably noticed the add() and addonce() method calls in the above two code blocks and wondered how they differ.
... the difference is that the add() method binds the given function and causes it to be executed every time the event occurs, while addonce() is useful when you want to have the bound function executed only once and then unbound so it is not executed again.
2D breakout game using Phaser - Game development
erent versions of the mdn breakout game we are building together — are available on github: initialize the framework scaling load the assets and print them on screen move the ball physics bounce off the walls player paddle and controls game over build the brickfield collision detection the score win the game extra lives animations and tweens buttons randomizing gameplay as a note on learning paths — starting with pure javascript 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.
...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 series of articles can be used as material for hands-on game development workshops.
Visual-js game engine - Game development
new link is : https://github.com/zlatnaspirala/visual-ts-game-engine basic licence rules : 1) each file in this project has its own license , be careful , do not violate the basic rules.
... 1) click create application 2) enter new application name in input prompt 3) select folder for server part of application (important : www is not secure place) 4) select folder for client part of application ( any path in www) 5) new app name will appear in project list , select and click open application 6) open your server folder : install node.js modules one way - use windows bat-s file (in server root folder with prefix install_ ) second way - open cmd terminal and enter next command : npm install mysql npm install deliver...
... now you can use on-page-editor (nice for visual setup , checking positions and dimensions - not for logic ) .
...- important safari not working at the moment chrome , firefox , opera tutorial - pencil (animation path) : how to use pencil tool to create path object .
Visual typescript game engine - Game development
* 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.
...there's server package.json independently from the client part also config is not common.
... - running rtc3 server is also easy : command 'npm run broadcaster' is not necessary for beginners.
...html/css is not prior to this project.
First-class Function - MDN Web Docs Glossary: Definitions of Web-related terms
for example, in such a language, a function can be passed as an argument to other functions, can be returned by another function and can be assigned as a value to a variable.
... the function that we pass as an argument to another function, is called a callback function.
... example | return a function javascript function sayhello() { return function() { console.log("hello!"); } } in this example; we need to return a function from another function - we can return a function because we treated function in javascript as a value.
... you have to use another variable.
Function - MDN Web Docs Glossary: Definitions of Web-related terms
only function expressions can be anonymous, function declarations must have a name: // when used as a function expression (function () {}); // or using the ecmascript 2015 arrow notation () => {}; the following terms are not used in the ecmascript language specification, they're jargon used to refer to different types of functions.
... a named function is a function with a function name: // function declaration function foo() {}; // named function expression (function bar() {}); // or using the ecmascript 2015 arrow notation const foo = () => {}; an inner function is a function inside another function (square in this case).
... an outer function is a function containing a function (addsquares in this case): function addsquares(a,b) { function square(x) { return x * x; } return square(a) + square(b); }; //using ecmascript 2015 arrow notation const addsquares = (a,b) => { const square = x => x*x; return square(a) + square(b); }; a recursive function is a function that calls itself.
... function loop(x) { if (x >= 10) return; loop(x + 1); }; //using ecmascript 2015 arrow notation const loop = x => { if (x >= 10) return; loop(x + 1); }; an immediately invoked function expressions (iife) is a function that is called directly after the function is loaded into the browser’s compiler.
Perceived performance - MDN Web Docs Glossary: Definitions of Web-related terms
this measure relies on human perception, not an objective metric like time to interactive.
...perceived performance is not how fast your site is; it's how fast your users think it is.
... perceived performance is not measured by when your site is done loading but when it has loaded enough for users to believe it has loaded and is interactive.
... speed index is a common metric for measuring perceived performance, though it's not perfect.
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
firefox does not support it natively, but the following function aims to allow its use with documents passed into it.
... (note that this has not been thoroughly tested for all circumstances and may not necessarily reflect the standard behavior completely.) note also that if you wish to allow xml:base, you will need the xml:base function, and the line beginning var href = ...
...|| (href.indexof('file://') === 0 && href.match(patternxml))) { /* grab the response as text (see below for that routine) and then find encoding within*/ var encname = '([a-za-z][a-za-z0-9._-]*)'; var pattern = new regexp('^<\\?xml\\s+.*encoding\\s*=\\s*([\'"])'+encname+'\\1.*\\?>'); // check document if not?
...(pattern); if (encodingtype) { encodingtype = encodingtype[2]; } else { encodingtype = 'utf-8'; } // need to make a whole new request apparently since cannot convert the encoding after receiving it (to know what the encoding was) var request2 = new xmlhttprequest(); request2.overridemimetype('text/plain; charset='+encodingtype); request2.open('get', href, false); request2.setrequestheader('if-modified-since', 'thu, 1 ...
Cacheable - MDN Web Docs Glossary: Definitions of Web-related terms
not all http responses can be cached, these are the following constraints for an http response to be cached: the method used in the request is itself cacheable, that is either a get or a head method.
...(for example, firefox does not support it per https://bugzilla.mozilla.org/show_bug.cgi?id=109553.) other methods, like put or delete are not cacheable and their result cannot be cached.
... note that some non-cacheable requests/responses to a specific uri may invalidate previously cached responses on the same uri.
... when both, the method of the request and the status of the response, are cacheable, the response to the request can be cached: get /pagex.html http/1.1 (…) 200 ok (…) a put request cannot be cached.
Safe - MDN Web Docs Glossary: Definitions of Web-related terms
all safe methods are also idempotent, but not all idempotent methods are safe.
... safe methods don't need to serve static files only; a server can generate an answer to a safe method on-the-fly, as long as the generating script guarantees safety: it should not trigger external effects, like triggering an order in an e-commerce web site.
...in particular, an application should not allow get requests to alter its state.
... a call to a safe method, not changing the state for the server: get /pagex.html http/1.1 a call to a non-safe method, that may change the state of the server: post /pagex.html http/1.1 a call to an idempotent but non-safe method: delete /idx/delete http/1.1 learn more general knowledge definition of safe in the http specification.
Combinators - Learn web development
adjacent sibling combinator the adjacent sibling selector (+) is used to select something if it is right next to another element at the same level of the hierarchy.
... if you insert some other element such as a <h2> in between the <h1> and the <p>, you will find that the paragraph is no longer matched by the selector and so does not get the background and foreground color applied when the element is adjacent.
... general sibling combinator if you want to select siblings of an element even if they are not directly adjacent, then you can use the general sibling combinator (~).
...next we will move on to another important part of css — the css box model.
Test your skills: sizing - Learn web development
note: you can try out solutions in the interactive editors below, however, it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
...the first should be sized so that the height will be at least 100 pixels tall, even if there is less content than would cause it to grow to that height, however, the content should not overflow if there is more content than fits in 100 pixels.
... task two this task has a box, which contains another box.
...if you imagine that the box is responsive and therefore could grow and shrink, which property would you apply to the image so that the large image shrinks down into the box but the small image does not stretch.
CSS layout - Learn web development
now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another.
... note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... positioning positioning allows you to take elements out of the normal document layout flow, and make them behave differently, for example sitting on top of one another, or always remaining in the same place inside the browser viewport.
...however there will be visitors to your site who use older browsers, or browsers which do not support the methods you have used.
Using CSS generated content - Learn web development
however, there are situations where it makes sense to specify certain content as part of the stylesheet, not as part of the document.
... note: content specified in a stylesheet does not become part of the dom.
... this issue does not arise if the content you specify consists of symbols or images that apply in all languages and cultures.
...for details, see referring to characters not represented in a character encoding and characters and case in the css specification.
Styling lists - Learn web development
soft, slightly leavened flatbread.</dd> <dt>halloumi</dt> <dd>a semi-hard, unripened, brined cheese with a higher-than-usual melting point, usually made from goat/sheep milk.</dd> <dt>green salad</dt> <dd>that green healthy stuff that many of us just use to garnish kebabs.</dd> </dl> if you go to the live example now and investigate the list elements using browser developer tools, you'll notice a couple of styling defaults: the <ul> and <ol> elements have a top and bottom margin of 16px (1em) and a padding-left of 40px (2.5em.) the list items (<li> elements) have no set defaults for spacing.
...for example, the following css: ul { list-style-type: square; list-style-image: url(example.png); list-style-position: inside; } could be replaced by this: ul { list-style: square url(example.png) inside; } the values can be listed in any order, and you can use one, two or all three (the default values used for the properties that are not included are disc, none, and outside).
...the following example: <ol start="4" reversed> <li>toast pita, leave to cool, then slice down the edge.</li> <li>fry the halloumi in a shallow, non-stick pan, until browned on both sides.</li> <li>wash and chop the salad.</li> <li>fill pita with salad, hummus, and fried halloumi.</li> </ol> gives you this output: note: if there are more list items in a reversed list than the value of the start attribute, the count will continue to zero and then into negative values.
...the following example: <ol> <li value="2">toast pita, leave to cool, then slice down the edge.</li> <li value="4">fry the halloumi in a shallow, non-stick pan, until browned on both sides.</li> <li value="6">wash and chop the salad.</li> <li value="8">fill pita with salad, hummus, and fried halloumi.</li> </ol> gives you this output: note: even if you are using a non-number list-style-type, you still need to use the equivalent numerical values in the value attribute.
What software do I need to build a website? - Learn web development
those formats are not suitable for writing web pages.
...here is a short list of editors: operating system built-in editor third-party editor windows notepad notepad++ visual studio code web storm brackets shiftedit sublime text mac os textedit textwrangler visual studio code brackets shiftedit sublime text linux vi (all unix) gedit (gnome) kate (kde) leafpad (xfce) ...
... note: ftp is inherently insecure.
... next steps some of this software is free, but not all of it.
Web forms — Working with user data - Learn web development
however, for historical and technical reasons it's not always obvious how to use them to their full potential.
... note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... validating and submitting form data client-side form validation sending data is not enough — we also need to make sure that the data users enter into forms is in the correct format to process it successfully, and that it won't break our applications.
... we also want to help our users to fill out our forms correctly and not get frustrated when trying to use our apps.
Front-end web developer - Learn web development
if you are not sure if front-end web development is for you, and/or you want a gentle introduction before starting a longer and more complete course, work through our getting started with the web module first.
... getting help we have tried to make learning front-end web development as comfortable as possible, but you will probably still get stuck because you don't understand something, or some code is just not working.
... the learning pathway getting started time to complete: 1.5–2 hours prerequisites nothing except basic computer literacy.
... guides installing basic software — basic tool setup (15 min read) background on the web and web standards (45 min read) learning and getting help (45 min read) semantics and structure with html time to complete: 35–50 hours prerequisites nothing except basic computer literacy, and a basic web development environment.
Publishing your website - Learn web development
tips for finding hosting and domains mdn does not promote specific commercial hosting companies or domain name registrars.
... note: make sure your folder has an index.html file.
... note: it may take a few minutes for your website to go live.
... if your website does not display immediately, wait a few minutes.
What will your website look like? - Learn web development
note: complex projects need detailed guidelines that go into all the details of colors, fonts, spacing between items on a page, appropriate writing style, and so on.
...for your first simple webpage, there's not much to sketch out, but you should get in the habit of doing this now.
... note: even on real, complex websites, the design teams usually start out with rough sketches on paper and later on build digital mockups using a graphics editor or web technologies.
... note that most images on the web, including in google images, are copyrighted.
Getting started with the Web - Learn web development
you won't build another facebook right away, but it's not hard to get your own simple website online, so we'll start there.
... by working through the articles listed below in order, you will go from nothing to getting your first webpage online.
...when you're building a website, you need to assemble these files into a sensible structure and make sure they can talk to one another.
... how the web works when you access your favorite website, a lot of complicated things happen in the background that you may not know about.
Use HTML to solve common problems - Learn web development
LearnHTMLHowto
how to create a list of items with html how to stress or emphasize content how to indicate that text is important how to display computer code with html how to annotate images and graphics how to mark abbreviations and make them understandable how to add quotations and citations to web pages how to define terms with html hyperlinks one of the main reasons for html is making navigation easy with hyperlinks, which can be used in many different ways: how to create a hyperlink how to create a table of contents with html images & multimedia how to...
... how to use css within a webpage how to use javascript within a webpage embedded content how to embed a webpage within another webpage how to add flash content within a webpage uncommon or advanced problems beyond the basics, html is very rich and offers advanced features for solving complex problems.
...it's one of the most complex html structures, and mastering it is not easy: how to create a data table how to make html tables accessible data representation how to represent numeric and code values with html — see superscript and subscript, and representing computer code.
... 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 internationalization html is not monolingual.
Test your skills: Math - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... note: in the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
... add the first two variables together and store the result in another variable.
... subtract the fourth variable from the third and store the result in another variable.
Test your skills: Strings - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... note: in the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
... use a combination of the variables you have and available string properties/methods to trim down the original quote to "i do not like green eggs and ham.", and store it in a variable called revisedquote.
... in fixedquote, replace "green eggs and ham" with another food that you really don't like.
Test your skills: JSON - Learn web development
note: you can try out the solution in the interactive editor below.
... note: in the example below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
... why are the para1.textcontent = motherinfo; and para2.textcontent = kitteninfo; lines inside the displaycatinfo() function, and not at the end of the script?
...if you put your code on codepen for example, it would fail because the json it is requesting is not on the same origin.
What is web performance? - Learn web development
how a user perceives your performance is as important, or perhaps more important, than any objective statistic, but it's subjective, and not as readily measurable.
... perceived performance is user perspective, not a metric.
...such an approach is much better than just showing nothing, which will make it feel like it is taking a lot longer and possibly lead to your users thinking it is broken and giving up.
... note: web performance includes both objective measurements like time to load, frames per second, and time to interactive, and subjective experiences of how long it felt like it took the content to load.
JavaScript performance - Learn web development
objective: to learn about the effects of javascript on performance optimization, and how a javascript file size is not the only impact on web performance.
... similar to images and video, the best way to improve performance is to omit what is not, in fact, necessary.
... but not all bytes downloaded have the same impact.
...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?
React resources - Learn web development
however, it also fragments your stylesheet across your codebase, and this fragmentation might not be worthwhile.
...notice, too, that the form, filterbutton, and todo components are indented to the right – this indicates that app is their parent.
...most of the time, props are an appropriate method for sharing data; for complex, deeply nested applications, however, they're not always best.
... routing while routing is traditionally handled by a server and not an application on the user's computer, it is possible to configure a web application to read and update the browser's location, and render certain user interfaces.
Rendering a list of Vue components - Learn web development
to help vue optimize rendering the elements in the list, it tries to patch list elements so it's not recreating them every time the list changes.
...this is really useful, as we want our todo items to display their label properties as their label, not a static label of "my todo item".
... in addition, we want their checked status to reflect their done properties, not always be set to done="false".
... summary and that brings us to the end of another article.
Mozilla Plugin Accessibility
if the plugin needs those keystrokes, the can consume them and not pass them on.
...user cannot keyboard navigate out of a plugin we will apply the same solution as in problem 4 above.
...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.
ZoomText
here's how you can test: download a copy of mozilla 1.8a6 (this is not firefox).
... read the release notes if you're interested.
... mozilla issues cannot tab into frames and iframes.
... cannot customize the sidebar with the keyboard only.
Creating a Language Pack
// lots of notifications about missing entities ...
... x-testing: changed: 6 missinginfiles: 6124 missing: 5 0% of entries changed this step is not necessary anymore to create the language pack, because it is included in the next command.
...there is a target to get those, too, another way to test it to repack the en-us binary.
... // lots of notifications about missing entities ...
Debugging JavaScript
(note that before firefox 28, this was labeled "browser debugger" and only the debugger was available, not the whole toolbox.) note that you must accept the incoming connection : (you may disable the pop-up above with the devtools.debugger.prompt-connection set to false in about:config.
...(note that before firefox 28, only the script debugger was available.) the use of these tools are the same as the built-in tools.
...(the pref also warns on common javascript idioms that are not errors).
...in debug builds this also dumps a stack trace to the console, even when the debugger is not running.
Debugging Table Reflow
reflow the most efficient tool to claim that html-table code is the victim and not the source of layout bugs is a frame reflow debug log.
... block reflow another way to debug the reflow process is implemented inside nsblockframe.cpp.
... debug_table_strategy editor's note: the following examples are not shown correctly due to the wiki's technical constraint.
...the first line of the data dump shows that no width has yet been assigned to the columns mcolwidths=-1 -1 -1 -1, -1 stands for: #define width_not_set -1 this is followed by a reference to the column frame pointers: col frame cache -> 0=00b93138 1=00b931f0 2=024dd728 3=024dd780 this is followed by the information which width has been set for each column.
Debugging
fortunately, over the years, mozilla developers have come up with not just technologies and features to help you debug code, but have devised tips and techniques that can help too.
... advanced debugging techniques understanding crash reports how to read crash reports, which are full of information yet often not easy to interpret and act on.
... debugging frame reflow and debugging table reflow notes on debugging issues in gecko's layout engine.
...note that these are replaced frequently by our tinderboxes.
Simple Sunbird build
installing build tools if your system is not listed below, see the build prerequisites page.
... ubuntu linux: sudo apt-get build-dep sunbird sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libiw-dev autoconf2.13 cvs fedora linux: sudo yum groupinstall 'development tools' 'development libraries' 'gnome software development' sudo yum install mercurial autoconf213 glibc-static libstdc++-static yasm wireless-tools-devel mesa-libgl-devel mac: install xcode tools.
...(if you get a message saying this application did not install properly then you should see a windows dialog giving you the option to re-install with the 'correct settings'.
... # use this only if not on windows!
Gecko Logging
note: log module names can only contain specific characters.
...this should not be used directly in code.
... note: this option disables 'append' and forces 'timestamp'.
... e10s note when a content process is in sandbox, it cannot write to stderr or any file.
Contributing to the Mozilla code base
perhaps you do not know programming yet, but you want to start learning?
... 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 contribute.
...of course, if you are not a student, feel free to fix one of these bugs.
...the reviewer in those bugs might be another good choice we have a list of modules, which lists peers and owners for the module.
Message manager overview
cific message from frame scripts removemessagelistener() : stop listening to a specific message interfaces nsiframescriptloader nsimessagelistenermanager nsimessagebroadcaster how to access you can access it as a property of the browser window: // chrome script let windowmm = window.messagemanager; browser message manager note that in this context, "browser" refers to the xul <browser> object, which is a frame that hosts a single web document.
... it does not refer to the more general sense of a web browser.
... the content frame message manager provides the global object for frame scripts (but note that there is trickery to ensure that top-level variables defined by frame scripts are not shared).
...this is the recommended way to load a script that executes just once per child process, which is something you might want to do if you are interacting with some global service (for example, adding listeners to observer notifications or registering a content policy).
Message manager overview
note that in this context, "browser" refers to the xul <browser> object, which is a frame that hosts a single web document.
... it does not refer to the more general sense of a web browser.
...this is the recommended way to load a script that executes just once per child process, which is something you might want to do if you are interacting with some global service (for example, adding listeners to observer notifications or registering components).
...sagemanager;1"] .getservice(ci.nsisyncmessagesender); parent process message manager the parent process message manager lives in the implements nsimessagelistenermanager nsimessagebroadcaster child process message manager implements nsimessagelistenermanager nsimessagesender loading scripts per child process since the process message managers do not support script loading the only way to implement per-child process code is to use a frame script which imports a custom javascript module (jsm).
HTMLIFrameElement.getActive()
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.
... syntax var amiactive = instanceofhtmliframeelement.getactive(); returns a boolean indicating whether the current browser <iframe> is the currently active frame (true) or not (false.) parameters none.
... example var browser = document.queryselector('iframe'); var amiactive = browser.getactive(); specification not part of any specification.
HTMLIFrameElement.getCanGoBack()
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.
...}); returns a promise that resolves with a boolean that equals true if the history can be navigated backward or false if not.
... example function canmovebwd() { browser.getcangoback().then(function(result) { if (result) { back.disabled = false; console.log("it's possible to navigate the history backward."); } else { back.disabled = true; console.log("it's not possible to navigate the history backward."); } }); } specification not part of any specification.
HTMLIFrameElement.getCanGoForward()
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.
...}); returns a promise that resolves with a boolean that equals true if the history can be navigated forward or false if not.
... example function canmovefwd() { browser.getcangoforward().then(function(result) { if (result) { fwd.disabled = false; console.log("it's possible to navigate the history forward."); } else { fwd.disabled = true; console.log("it's not possible to navigate the history forward."); } }); } specification not part of any specification.
HTMLIFrameElement.getScreenshot()
the image will be cropped if necessary but will not be distorted vertically or horizontally.
... note: getscreenshot() waits for the event loop to go idle before it takes the screenshot.
... mimetype optional a mime type specifying the format of the image to be returned; if not specified, the default used is image/jpeg.
... examples var browser = document.queryselector('iframe'); var request = browser.getscreenshot(100, 100); request.onsuccess = function() { var blob = request.result; var url = url.createobjecturl(blob); } specification not part of any specification.
mozbrowseraudioplaybackchange
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.
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
mozbrowserclose
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.
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
mozbrowserdocumentfirstpaint
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.
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
mozbrowserfirstpaint
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.
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
mozbrowsericonchange
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.
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
mozbrowserloadend
non-standard this feature is not on a current w3c standards track, but it is supported on the firefox os platform.
... although implementations may change in the future and it is not supported widely across browsers, it is suitable for use in code dedicated to firefox os apps.
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
mozbrowserloadstart
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.
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
mozbrowsermanifestchange
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.
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
mozbrowseropensearch
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.
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
mozbrowseropentab
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.
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
mozbrowseropenwindow
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.
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
mozbrowserresize
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.
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
mozbrowserscroll
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.
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
mozbrowserscrollareachanged
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.
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
mozbrowserscrollviewchange
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.
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
mozbrowsertitlechange
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.
... bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
HTMLIFrameElement.sendMouseEvent()
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.
... modifiers a number representing a key pressed at the same time the mouse button was clicked: 1 : alt 2 : ctrl 4 : shift 8 : meta 16 : alt gr 32 : caps lock 64 : fn 128 : num lock 256 : scroll 512 : symbol lock 1024 : win note: you can specify multiple key modifiers separated by a pipe symbol, for example 1 | 1014.
... examples var browser = document.queryselector('iframe'); browser.sendmouseevent("mousemove", x, y, 0, 0, 0); browser.sendmouseevent("mousedown", x, y, 0, 1, 0); browser.sendmouseevent("mouseup", x, y, 0, 1, 0); specification not part of any specification.
HTMLIFrameElement.setActive()
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.
... parameters boolean a boolean that indicates whether the iframe is to be the active frame (true) or not (false).
... example var browser = document.queryselector('iframe'); browser.setactive(); specification not part of any specification.
HTMLIFrameElement.setVisible()
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.
... the visible state of a browser <iframe> has nothing to do with its actual visibility (which is handled through css).
... examples var browser = document.queryselector('iframe'); browser.setvisible(true); specification not part of any specification.
Browser API
should not reflect the frame hierarchy.
...note that this method is available for touch enabled devices only.
...note that this is obsolete.
...note that this is obsolete, and newer implementations use mozbrowsercaretstatechanged instead.
Embedding Tips
register your own nsiwebprogresslistener object to listen for progress and state notifications.
... register your ownnsiwebprogresslistener object to listen for progress and state notifications.
...when the operation is completed, the onstatechange will be notified by a combination of state_stop | state_is_network state flags.
...use xre_notifyprofile to make gecko actually use a profile location.
Getting from Content to Layout
nscssframeconstructor gets notified from the document's presshell (which implements nsidocumentobserver and observes the document) about all nodes in the document.
... the frame constructor takes these notifications and does the following: dispatches "restyle events" which trigger the reprocessing of relevant css selectors and any restyling that needs to occur.
... a list of restyle roots (places in the content tree where all descendants need to be restyled but nothing on the parent chain does) are also stored.
... the restyles accumulated in the restyletracker are dispensed with from various method on the presshell that involve reflow and flushing notifications.
How to investigate Disconnect failures
usually disconnects happens when a modal dialog freezes and we cannot close it sp we close firefox with the modal frozen.
... we cannot investigate failures via mozmill, because we do not catch the crashes, so the crashes' information is not logged; we have to go to ci machines and investigate directly.
... the event viewer can be found on windows: computer management > event viewer > windows logs > application and here we look for errors that overlapped with the test run; we cannot see the freezes (the main thread is blocked).
... crashes (not freezes) if we have a crash we always should submit it.
Infallible memory allocation
currently, while code is transitioned to be compatible with infallible memory allocators, you have to explicitly decide whether to use infallible allocation or not.
...under extreme memory conditions, it's possible that the allocation will fail; however, the allocation routine will not, in this scenario, return to your code.
... choosing a memory allocator as you write new code that needs to allocate memory, there are some simple rules to follow to help you decide whether to use a fallible or an infallible memory allocator: if you're allocating what may be a large chunk of memory, you should allocate the memory fallibly (using malloc() for example), and check the result to be sure it's not null.
... if you don't know whether or not the memory will be large, use the standard malloc() routine.
Introduction to Layout in Mozilla
may not be directly manipulated detailed walk-through setting up content model construction frame construction style resolution reflow painting setting up assume basic knowledge of embedding and network apis (doc shell, streams) content dll auto-registers a document loader factory (dlf) @mozilla.org/content-viewer-factory/view;1?type=text/html all mime types mapp...
... some buffering and fixup occurs here opencontainer, closecontainer, addleaf content sink creates and attaches content nodes using nsicontent interface content sink maintains stack of “live” elements more buffering and fixup occurs here insertchildat, appendchildto, removechildat frame construction content sink uses nsidocument interface to notify of Δs in content model contentappended, contentinserted, contentremoved presshell is registered as document observer receives contentappended, etc.
... notifications passes these to the style set object, who in turn passes to the frame constructor frame constructor creates frames constructframeinternal recursively walks content tree, resolves style and creates frames either created by tag (<select>) or by display type (<p>) frame manager maintains mapping from content to frame style resolution compute stylistic information based on the style rules that apply for the frame’s content node style data broken into different structures display, visibility, font, color, background, … inherit vs.
...nager paints views back-to-front, invoking presshell’s paint method presshell::paint walks from the view to the frame; invokes nsiframe::paint for each layer incrementalism single-threaded simple (no locking) can’t leave event queue unattended content construction unwinds “at will” parser and content sink do some buffering content sink has “notification limits” efficiency vs.
DownloadTarget
method overview promise refresh() properties attribute type description exists read only boolean indicates whether or not the target file exists.
... size read only number the size of the target file, in bytes, or zero if the download has not yet been completed.
...it currently indicates the size of the main file (such as the html document) rather than the sum of all of the files' sizes, but you must not rely upon this behavior, as it is subject to change.
...if the download is in progress or has been finalized, this method does nothing and returns a resolved promise.
OS.File.Error
instances of os.file.error are used by os.file to notify of file-related errors.
... using os.file.error example: finding out whether the problem is due to a file that does not exist try { let file = os.file.open("myfile.txt"); // ...
... } catch (ex) { if (ex instanceof os.file.error && ex.becausenosuchfile) { // the file does not exist } } global object os.file.error methods overview the following functions are utility functions that may be used to construct instances of os.file.error, setting the platform-specific error number.
... becausenosuchfile true if the operation failed because a file or directory does not exist, false otherwise.
Webapps.jsm
importing components.utils.import("resource://gre/modules/webapps.jsm"); // exported symbol is domapplicationregistry method overview init: function() loadcurrentregistry: function() notifyappsregistrystart: function notifyappsregistrystart() notifyappsregistryready: function notifyappsregistryready() sanitizeredirects: function sanitizeredirects(asource) _savewidgetsfullpath: function(amanifest, adestapp) appkind: function(aapp, amanifest) updatepermissionsforapp: function(aid, aispreinstalled) updateofflinecacheforapp: function(aid) installpreinstalledapp: function installpreinstalledapp(aid) removeifhttpsduplicate: function(aid) installsystemapps: funct...
...: function(asubject, atopic, adata) addmessagelistener: function(amsgnames, aapp, amm) removemessagelistener: function(amsgnames, amm) formatmessage: function(adata) receivemessage: function(amessage) getappinfo: function getappinfo(aappid) broadcastmessage: function broadcastmessage(amsgname, acontent) registerupdatehandler: function(ahandler) unregisterupdatehandler: function(ahandler) notifyupdatehandlers: function(aapp, amanifest, azippath) _getappdir: function(aid) _writefile: function(apath, adata) dogetlist: 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) cancel...
...pdate, 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) isreceipt: function(data) addreceipt: function(adata, amm) removereceipt: function(adata, amm) replacereceipt: function(adata, amm) setenabled: function(adata) getmanifestfor: function(amanifesturl, aentrypoint) getappbymanifesturl: function(amanifesturl) getfullappbymanifesturl: function(amanifestu...
...rl, aentrypoint, alang) getmanifestcspbylocalid: function(alocalid) getdefaultcspbylocalid: function(alocalid) getapplocalidbystoreid: function(astoreid) getappbylocalid: function(alocalid) getmanifesturlbylocalid: function(alocalid) getapplocalidbymanifesturl: function(amanifesturl) getcoreappsbasepath: function() getwebappsbasepath: function() _islaunchable: function(aapp) _notifycategoryandobservers: function(subject, topic, data, msg) registerbrowserelementparentforapp: function(amsg, amn) receiveappmessage: function(appid, message) _clearprivatedata: function(appid, browseronly, msg) _sendprogressevent: function() updatestatechanged: function appobs_update(aupdate, astate) applicationcacheavailable: function appobs_cacheavail(aapplicationcache) ...
L10n Checks
the file names will be shown in a hierarchical form, so in the example above, your files are browser.dtd in ab-cd/browser/chrome/browser and migration.dtd in another directory level deeper.
... the output closes with a summary, giving the total counts of missing and obsolete strings and some statistics on how many strings are changed or not, excluding access and command keys.
..."kompozer"), e.g.: check-l10n-completeness -l browser/locales/l10n.ini ../l10n/ de compare every directory in the source mode you can tell l10n checks to compare every directory, not only the ones set in the all-locales file, by setting the -f parameter (useful for e.g.
...0 - quiet; 5 - show all messages merge in the source mode you can tell l10n checks to merge missing strings and files into the locale files by setting a merge directory, e.g.: check-l10n-completeness -m output_dir suite/locales/l10n.ini ../l10n/ de note: only files which were merged will be saved in that directory.
Localizing XLIFF files for iOS
do not delete the <source> tag sets.
...keep in mind the following sets of characters that need to remain untranslated: $(some_text_here) is a variable format, %1$@ is another variable format.
... <note> tags contain localizer notes from developers and should not be translated.
... <trans-unit id="add to bookmarks"> <source>add to bookmarks</source> <target>agregar a marcadores</target> <note>no comment provided by engineer.</note> </trans-unit> save your translations along the way.
Localization prerequisites
other varieties of "make" will not work.
... autoconf-2.13 - autoconf 2.5x will not work.
...you can try one of these: notepad++ or notepad2 on windows, vim, gedit or kate on gnu/linux, bbedit on mac os x.
...there is no warranty; not even for merchantability or fitness for a particular purpose great, hg works.
Localization technical reviews
overview you've completed most, if not all, of your localization work.
... focusses on technical accuracy and completion of l10n work, not translation quality.
...there should not be any utf-7 encodings in the file toolkit/chrome/global/intl.properties.
...once they are fixed, push your fix to your repo, attach it to the corresponding bug using the same mercurial revision number as before, and then request another review.
Writing localizable code
about localizers a few notes about localizers for developers who rarely deal with them: localizers like tools, and they don't like editors, localization tools are often based on key-value pairs, at least some localizers have their talents focused on language skills and are not savvy in programming, or even building applications.
... try not to assume grammar in composite strings splitting sentences into several keys often inadvertently presumes a grammar, a sentence structure, and such composite strings are often very difficult to translate.
...there are few exceptions to this rule, but in general, the localized file should comply with standards and should not require build tools to be transformed.
... l10n impact on frozen trees, there is the rule to not check in l10n-impact changes.
Mozilla Framework Based on Templates (MFBT)
(the <stdint.h> standard header is not available on all platforms and so cannot be used directly.
...the function macros control inlining, note whether a function returns, and enforce various c++-related restrictions on inheritance and use.
... likely.h provides moz_likely and moz_unlikely macros to annotate conditions with their expected truthiness.
... guardobjects.h provides macros which can be used to annotate an raii-style guard class, so that any attempt to create an unnamed temporary for it will assert.
MathML3Testsuite
the sections are marked with passed, failed, not-tested or some parts pass, giving the status of trunk builds with the appropriate fonts installed.
... when the markup is intentionally errorous, the correct behavior is not defined by the recommendation and hence the tests are considered passed if there is no fatal error (crash, etc).
...note that in general, comparing with the "sample rendering" is not enough to conclude on the success/failure of the test.
... so please do not edit these pages if you are not able to explain gecko's rendering.
Measuring performance using the PerfMeasurement.jsm code module
note: the perfmeasurement.jsm javascript code module can only be used from chrome -- that is, from within the application itself or an add-on.
...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.
...now we want to benchmark a function that is pretty fast (but not fast enough), so we run it several thousand times: for (let i = 0; i < 10000; i++) { set_up_some_state(); monitor.start(); code_to_be_benchmarked(); monitor.stop(); clean_up_afterward(); } we call the perfmeasurement object's start() method when we want to start recording, and stop() when we want to stop recording.
...since we enable monitoring immediately before calling code_to_be_benchmarked(), and disable it as soon as it returns, the code in set_up_some_state() and clean_up_afterward() is not measured.
Memory Profiler
you may need to set the "xpinstall.signatures.required" pref to false in order to install it, since the xpi is not yet signed.
... another common approach is to plot the allocations or the memory usages along the timeline.
... 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.
powermetrics
note: the power profiling overview is worth reading at this point if you haven't already.
... other things to note.
...run with the --show-all to see all of these at once, but note that you'll need a very wide window to see all the data.
... also note that powermetrics -h is a better guide to the the command-line options than man powermetrics.
Performance
a development environment is not required.
...they are slow and not particular easy to use, and thus most suitable for use by expert developers.
...the "leaks" tool is not recommended for use with spidermonkey or firefox, because it gets confused by tagged pointers and thinks objects have leaked when they have not (see bug 390944).
...that log can then be replayed against firefox's default memory allocator independently or through another replace-malloc library, allowing the testing of other allocators under the exact same workload.
Phishing: a short definition
the impact has not improved much since.
...earlier responses by affected banks, and payment providers, was to attempt educating users to not click links in emails, along with requesting to verify email legitimacy through checking for relevant personal information.
... another solution is to strengthen logins with pictures, or colored words, often chosen when signing up for a service.
...this qr code is nothing more than a random, secret key, that is stored on the user’s phone.
Preference reference
in name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey.browser.urlbar.trimurlsthe 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.dom.event.clipboardevents.enableddom.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 old behavior can be restored by setting the preference mail.tabs.drawintitlebar to false.nglayout.debug.disable xul fastloadthe preference nglayout.debug.disable_xul_fastload controls whether or not xul fastload is used.nglayout.debug.disable_xul_cacheto improve performance, mozilla caches chrome xul documents the first time they load for faster loading later.
... the effect is that the source xml file is not read and re-parsed each time the chrome in question is displayed.
...by default, the reader mode in firefox mobile is only enabled if the memory is greater than 384mb.ui.alertnotificationoriginui.alertnotificationorigin controls the position and direction from which popup notifications invoked by nsialertsservice are sliding in.ui.spellcheckerunderlineui.spellcheckerunderline holds the colour which is used to underline words not recognized by the spellchecker.ui.spellcheckerunderlinestyleui.spellcheckerunderlinestyle holds the style which is used to underline words not re...
Cached Monitors
this arrangement allows a cached monitor to be associated with another object without preallocating a monitor for all objects.
... pr_cwait waits for a notification that a monitor's state has changed.
... pr_cnotify notifies a thread waiting for a change in the state of monitored data.
... pr_cnotifyall notifies all the threads waiting for a change in the state of monitored data.
Condition Variables
this chapter describes the api for creating and destroying condition variables, notifying condition variables of changes in monitored data, and making a thread wait on such notification.
... a call to pr_waitcondvar causes a thread to block until a specified condition variable receives notification of a change of state in its associated monitored data.
... other threads may notify the condition variable when changes occur.
... condition variable type prcondvar condition variable functions pr_newcondvar pr_destroycondvar pr_waitcondvar pr_notifycondvar pr_notifyallcondvar ...
Logging
logging is not compiled in for the win16 platform.
... logging is compiled into the nspr debug builds; logging is not compiled into the nspr optimized builds.
... variables control the behavior of logging at execution time: nspr_log_modules nspr_log_file logging functions and macros the functions and macros for logging are: pr_newlogmodule pr_setlogfile pr_setlogbuffering pr_logprint pr_logflush pr_log_test pr_log pr_assert pr_assert pr_static_assert (new in nspr 4.6.6xxx this hasn't been released yet; the number is a logical guess) pr_not_reached use example the following sample code fragment demonstrates use of the logging and debugging aids.
... before running the compiled program, set the environment variable nspr_log_modules to userstuff:5 static void userlogstuff( void ) { prlogmoduleinfo *mylm; printn i; pr_static_assert(5 > 4); /* nspr 4.6.6 or newer */ mylm = pr_newlogmodule( "userstuff" ); pr_assert( mylm ); pr_log( mylm, pr_log_notice, ("log a notice %d\n", 999 )); for (i = 0; i < 10 ; i++ ) { pr_log( mylm, pr_log_debug, ("log debug number: %d\n", i)); pr_sleep( 500 ); } pr_log( mylm, pr_log_notice, "that's all folks\n"); } /* end userlogstuff() */ see also nspr logging reference ...
Monitors
however, this safety does not extend to protecting the monitor object from deletion.
... pr_wait waits for a notify on a specified monitor's condition variable.
... pr_notify notifies a thread waiting on a specified monitor's condition variable.
... pr_notifyall notifies all threads waiting on a specified monitor's condition variable.
PRIntervalTime
a platform-dependent type that represents a monotonically increasing integer--the nspr runtime clock.
... important note the counters used for interval times are allowed to overflow.
...interval has expired ...> as long as the interval and the elapsed time (now - epoch) do not exceed half the namespace allowed by a printervaltime (231-1), the expression shown above provides the expected result even if the signs of now and epoch differ.
...nspr guarantees that there will be at least 1000 ticks per second and not more than 100000.
PR_DetachThread
returns the function returns nothing.
... note: as of nspr release v3.0, pr_attachthread and pr_detachthread are obsolete.
... a native thread not created by nspr is automatically attached the first time it calls an nspr function, and automatically detached when it exits.
... in nspr release 19980529b and earlier, it is necessary for a native thread not created by nspr to call pr_attachthread before it calls any nspr functions, and call pr_detachthread when it is done calling nspr functions.
PR_GetRandomNoise
produces a random value for use as a seed value for another random number generator.
...a return value of zero means that pr_getrandomnoise is not implemented on this platform, or there is no available noise to be returned at the time of the call.
... pr_getrandomnoise is intended to provide a "seed" value for a another random number generator that may be suitable for cryptographic operations.
... this implies that the random value provided may not be, by itself, cryptographically secure.
PR_Interrupt
file i/o is considered instantaneous, so file i/o functions cannot be interrupted.
... unfortunately the standard input, output, and error streams are treated as files by nspr, so a pr_read call on pr_stdin cannot be interrupted even though it may block indefinitely.
... in the nt implementation, pr_connect cannot be interrupted.
... in the nt implementation, a file descriptor is not usable and must be closed after an i/o function on the file descriptor is interrupted.
PR_JoinThread
pr_jointhread must not be called until after pr_createthread has returned.
... if pr_jointhread is not called on the same thread as pr_createthread, then it is the caller's responsibility to ensure that pr_createthread has completed.
... several threads cannot wait for the same thread to complete.
... the calling thread is not blocked if the target thread has already terminated.
PR_PushIOLayer
if the layer is not successfully pushed onto the stack, pr_failure.
... even if the id parameter indicates the topmost layer of the stack, the value of the file descriptor describing the original stack will not change.
...accessing the object via the pointer is not permitted while the runtime has ownership.
... the contents of the caller's object are swapped into another container, including the reference to the object's destructor.
Threads
to synchronize the termination of a thread, you can join it with another thread (see pr_jointhread).
...nspr does not check for the validity of the thread.
... interrupting and yielding pr_interrupt requests an interrupt of another thread.
... once the target thread has been notified of the request, the request stays with the thread until the notification either has been delivered exactly once or is cleared.
JSS FAQ
MozillaProjectsNSSJSSJSS FAQ
for jss 3.2 and higher, if you use jdk 1.4 or higher you will not need to install the jce, but if you using an earlier version of the jdk then you will also have to install jce 1.2.1.
...setcipherpolicy does not need to be called by a jss app unless that app wants to limit itself to export-allowed cipher suites.
...in general, a key is a handle to an underlying object on a pkcs #11 token, not merely a java object residing in memory.
... not in the near future due to pluggability is disabled in the jsse version included in j2se 1.4.x for export control reasons.
NSS Memory allocation
after that function returns, any arenas that still appear to be leaked have truly been leaked, and are not merely on the free list.
...if and when an arena is leaked, the developer wants to see the call stack of the most recent allocation of the arena, not the stack of the oldest allocation of that arena.
... but leak analysis tools only record the allocation of memory from the heap, not memory from the arena free list, so they will always show the first allocation (from the heap) and not the most recent allocation (from the arena free list).
... consequently, when the arena free list is in use, the allocation call stacks shown will typically not be the stack of the code that most recently allocated that arena, but rather will be the stack of the code that first allocated that arena from the heap, and then placed it on the free list.
Hashing - sample 1
the nss same code below computes the hash of a file and saves it to another file, this illustrates the use of nss message apis.
...if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/.
... * returns null if the name if not a supported algorithm */ static secoidtag hashnametooidtag(const char *hashname) { int i, nhashes = sizeof(hash_names); secoidtag hashtag = sec_oid_unknown; for (i = 0; i < nhashes; i++) { if (port_strcasecmp(hashname, hash_names[i].hashname) == 0) { hashtag = hash_names[i].oid; break; } } return hashtag; } /* * newline */ static vo...
... */ printashex(outfile, digest, len); } while (0); /* cleanup */ if (hashcontext != null) hash_destroy(hashcontext); return secsuccess; } /* * this sample computes the hash of a file and saves it * to another file.
Utilities for nss samples
if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/.
...l checkpassword(char *cp); /* * getpassword */ 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.
...if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/.
...characters long with one or more\n"); 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.
FC_Finalize
if the library is not initialized, it does nothing.
... the preserved argument is not used and must be null.
... fc_finalize should check the preserved argument and return ckr_arguments_bad if preserved is not null.
... fc_finalize should return ckr_cryptoki_not_initialized if the library is not initialized.
FC_GetInfo
manufacturerid: the pkcs #11 library manufacturer, "mozilla foundation", padded with spaces to 32 characters and not null-terminated.
... librarydescription: description of the library, "nss internal crypto services", padded with spaces to 32 characters and not null-terminated.
...fc_getinfo should return ckr_cryptoki_not_initialized if the library is not initialized.
... examples note the use of the %.32s format string to print the manufacturerid and librarydescription members of the ck_info structure.
FC_OpenSession
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.
...the nss cryptographic module currently doesn't call the surrender callback function notify.
pkfnc.html
this function will return the newest certificate that matches the subject, based on the notbefore / notafter fields of the certificate.
...do not try to free the string yourself.
...do not try to free the string yourself.
... many tokens keep track of the number of attempts to enter a password and do not allow further attempts after a certain point.
ssltyp.html
as long as you use the form shown here, your code will not need revision.
... syntax #include <keyt.h> typedef struct seckeyprivatekeystr seckeyprivatekey; description key structures are not shared objects.
...when freeitem is not pr_false, also frees the item structure itself.
...when freeitem is not pr_false, also zeroes and frees the item structure itself.
TLS Cipher Suite Discovery
tls does not allow all possible combinations of choices from those categories to be used.
...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.
... each new release of a tls implementation may contain support for new cipher suites not supported in previous versions.
...*/ ssl_import const pruint16 ssl_numimplementedciphers; of course, the raw integer numbers of the cipher suites are not likely to be known to most users, so libssl provides a function by which the application can obtain a wealth of information about any supported cipher suite, by its number.
Renaming With Pork
pork does not yet have a ui, but it is also build-system agnostic and scales to large codebases.
... these notes are based on tools pork refactoring toolchain [required].
...convince gcc to create annotated .ii files while compiling the analysis copy.
...note the -k,-w0 options are passed down to the mcpp preprocessor such that it can annotate files with more precise position information.
Rhino license
* * redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer.
... * * - redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution.
... * * this software is provided by the copyright holders and contributors "as * is" and any express or implied warranties, including, but not limited to, * the implied warranties of merchantability and fitness for a particular * purpose are disclaimed.
... in no event shall the copyright owner or * contributors be liable for any direct, indirect, incidental, special, * exemplary, or consequential damages (including, but not limited to, * procurement of substitute goods or services; loss of use, data, or * profits; or business interruption) however caused and on any theory of * liability, whether in contract, strict liability, or tort (including * negligence or otherwise) arising in any way out of the use of this * software, even if advised of the possibility of such damage.
Rhino optimization
another benefit of the interpreted mode is that the interpreter performs tail-call elimination of recursive functions.
... if the optimization package is not available, then optimization acts as if it is always -1.
... note some language features (indirect calls to eval, use of the arguments property of function objects) were previously not supported in higher optimization levels.
... scripts are optimized at compile time, not at execution time.
Rhino overview
see the specification for more information on the standard, and rhino version 1.6r1 release notes for details on the implementation in rhino.
...these features are generally not broadly useful, yet they impose significant constraints on implementations that hamper or prevent optimization.
... array.prototype.tostring and object.prototype.tostring version 1.2 only returns array or object literal notation ("[1]" or "{a:1, b:2}" for example).
... string.prototype.substring for version 1.2 only, the two arguments are not swapped if the first argument is less than the second one.
The JavaScript Runtime
not java.lang.long, since a double representation of a long may lose precision.
...(this caveat does not apply to scripts that use liveconnect; the java values are wrapped and unwrapped as appropriate to conform to the above type constraints.) property access properties in javascript objects may be accessed using either string or numeric identifiers.
...however, this is not the implementation used in practice because a number to string conversion is too expensive to be performed on every array access.
...similarly, values of numbers that do not fix in integers (like 1.1 and 0x100000000) must be converted to strings.
SpiderMonkey Internals: Thread Safety
note: starting in gecko 12.0, jsruntime is single-threaded.
...this means that objects cannot be shared across compartments.
...the jscontext can be thought of as a machine that knows how to run javascript code, or as an abstraction of the notion of a thread.
...threads must not do anything that would affect gc while outside a request.
JS::IdentifyStandardInstance
if not, return jsproto_null.
...if not, return jsproto_null.
...if not, return jsproto_null.
...if not, return jsproto_null.
JSErrorReport
to counter this attack, html5 specifies that script errors should be sanitized ("muted") when the script is not same-origin with the global for which it is loaded.
...it will not cause the current operation to fail.
... jsreport_strict_mode_error this condition is an error in strict mode code, a warning if js_has_strict_option(cx), and otherwise should not be reported at all.
...for application that do not use unicode, set uclinebuf and uctokenptr to null.
JSObjectOps.getRequiredSlot
jsobjectops is not a supported api.
...this documentation should be considered spidermonkey internals documentation, not api documentation.
...see note below.
... note: the slot parameter is a zero-based index into obj slots, unlike the index parameter to the js_getreservedslot and js_setreservedslot api entry points, which is a zero-based index into the jsclass_reserved_slots(clasp) reserved slots that come after the initial well-known slots: proto, parent, class, and optionally, the private data slot.
JS_DeleteElement2
on success, *succeeded receives false if the property was not deleted because it is permanent and true otherwise.
...if an object references an element belonging to a prototype, the element reference is removed from the object, but the prototype's element is not deleted.
... notes per the ecma standard, js_deleteelement2 removes read-only properties from objects as long as they are not also permanent.
...in both these cases, *succeeded will receive the stored value of the property that was not deleted.
JS_DeleteProperty2
on success, *succeeded receives false if the property was not deleted because it is permanent and true otherwise.
...no property is deleted, but this is not an error.
...no property is deleted, but this is not an error.
...otherwise, if obj is not configurable, an error is raised.
JS_DestroyContext
js_destroycontextnogc does not perform garbage collection.
... js_destroycontextmaybegc may or may not perform garbage collection; the engine makes an educated guess as to whether enough memory would be reclaimed to justify the work.
... in a js_threadsafe build, it does not matter whether the calling thread is in a request on cx.
... however, there must not be any suspended requests on cx.
JS_DumpHeap
startkind jsgctracekind trace kind of startthing, if startthing is not null.
... // note: the order here is determined by our value packing.
... jstrace_outofline = 0x07, // the following kinds do not have an exposed c++ idiom.
...not all of the matching c++ types are exposed, and those that are, are opaque.
JS_EnterLocalRootScope
even if js_gc is // called, these new values will not be collected.
... js_leavelocalrootscope(cx); return ok; } note: js_leavelocalrootscope or js_leavelocalrootscopewithresult must be called once for every prior successful call to js_enterlocalrootscope.
... if js_enterlocalrootscope fails, you must not make the matching js_leavelocalrootscope call.
... local root scopes do not cover objects that are the result of jsapi calls like js_getproperty or js_callfunction.
JS_ExecuteScript
obsolete since jsapi 39 obj must not be an array, an e4x xml object, a with object, or a proxy.
... in ecmascript terms, the script is executed in a new execution context, but that context is not initialized quite as described in any of the three cases in ecma 262-3 §10.2.
...scopechain must not include the global object on it; that's implicit.
... to execute a script that has not been compiled, use js::evaluate instead.
JS_GetNaNValue
get the not-a-number (nan) floating-point number as a value of type js::value.
... description js_getnanvalue returns a value of type js::value that represents an ieee floating-point quiet not-a-number (nan).
... nan is not equal to any other value.
... in fact, it is not even equal to itself: if x is nan, then x != x.
JS_GetProperty
if the lookup proceeds without error, exactly one of the following cases applies: if the property is not found, then *vp is set to undefined.
...for many objects, including objects of standard classes such as object and array, this hook does nothing and returns true, so the property get succeeds and undefined is left in *vp.
...otherwise *vp is set to the property's stored value, or undefined if the property does not have a stored value, and then the property's getter is called with the arguments (cx, obj, id, vp).
... for many properties, the getter does nothing and returns true, so the property get succeeds and the property's stored value is left in *vp.
JS_GetScopeChain
these objects represent the lexical scope of the currently executing statement or expression, not the call stack, so they include: the variable objects of any enclosing functions or let statements or expressions, and any objects selected by enclosing with statements, in order from the most-nested scope outward; lastly the global object against which the function was created.
... note that cx's current global object, as set by js_setglobalobject, is not guaranteed to be on the scope chain.
...if the context is currently executing a script, and not in any function, it's running in a scope that was passed to js_executescript or a similar function by the application.
... this scope chain may or may not contain cx's current global object.
JS_NewContext
javascript objects, functions, strings, and numbers may be shared among the contexts in a jsruntime, but they cannot be shared across jsruntimes.
...this is a memory management tuning parameter which most users should not adjust.
... the stackchunksize parameter does not control the javascript stack size.
... (the jsapi does not provide a way to adjust the stack depth limit.) passing a large number for stackchunksize is a mistake.
JS_SetBranchCallback
the callback does not need to call js_beginrequest()).
...the engine does not execute finally blocks in this case; this is the same behavior as any native method or callback.
...another use is to call js_maybegc periodically.
...the callback simply increments the counter and does nothing further (returning js_true immediately) unless the counter has reached the threshold value.
JS_SetFunctionCallback
note: this method is only available if moz_trace_jscalls was defined at compile time using --enable-trace-jscalls.
...the callback must not modify the current state of execution.
... the call stack cannot be relied upon, because this callback may be invoked from the jit code when the stack frame and context are in an indeterminate state.
... note that debuggers should probably use js_setcallhook in preference to this function, because it is invoked when the javascript stack is guaranteed to be in a consistent state (and therefore it is valid to inspect and modify local variables, generate stack traces, and set breakpoints.) callback syntax typedef void (* jsfunctioncallback)(const jsfunction *fun,const jsscript *scr, const jscontext *cx, int entering); name type description fun const jsfunction * the javascript function being invoked or exited.
JS_SetInterruptCallback
the callback does not need to call js_beginrequest()).
...the embedding should thus not rely on callbacks being triggered through the external api only.
... important note: additional callbacks can occur inside the callback handler if it re-enters the js engine.
...some common uses for an interrupt callback are: to run garbage collection periodically, by calling js_maybegc; to periodically take a break from script execution to update the ui (though note that mozilla does not do this, by design); to enforce application limits on the amount of time a script may run.
JS_ValueToFunction
this conversion is dangerous and almost entirely useless, because the resulting jsfunction is not a real function object and therefore cannot be safely passed to any other jsapi function.
...a jsfunction represents only the compiled code and not the environment of the function.
... unless the function happens to be a native function, this means it isn't attached to any global or enclosing scope, and therefore must not be treated like a real function.
...(implementation note: the actual conversion is performed by the object itself.
JS_YieldRequest
momentarily suspend the current jsapi request, allowing garbage collection to run if another thread has requested it.
...a program can call this function periodically to ensure that a long-running request does not block garbage collection indefinitely.
... jsapi 1.7 and earlier js_yieldrequest did not cause cx to relinquish objects it created to other threads that are blocked waiting for them.
...in spidermonkey 1.8 and later, this function will be present, but will do nothing, in non-js_threadsafe builds.
jsid
also, there is an additional jsid value, jsid_void, which does not occur in js scripts but may be used to indicate the absence of a valid jsid.
... a void jsid is not a valid id and only arises as an exceptional api return value, such as in js_nextproperty.
... embeddings must not pass jsid_void into jsapi entry points expecting a jsid and do not need to handle jsid_void in hooks receiving a jsid except when explicitly noted in the api contract.
... a jsid is not implicitly convertible to or from a jsval; js_valuetoid or js_idtovalue must be used instead.
Frecency algorithm
invalid places have a frecency value of zero, and will not show up in autocomplete results.
...efault score +140 100 * (140/100.0) - first bucket weight and bookmarked bonus +84 70 * (120/100.0) - second bucket weight and followed-link bonus +14 10 * (140/100.0) - fifth bucket weight and bookmarked bonus +14 10 * (140/100.0) - fifth bucket weight and bookmarked bonus -- 252 (4 * 252 / 4) - final frecency score notes the number of sampled visits is min(10 most recent visits pref, total visit counts).
... the total visit count includes embedded, undefined, etc visits (does not exclude invalid or embedded visits).
... developer notes there are various development notes you can read about places that may offer additional insights: initial algorithm ideas implementation notes history the initial algorithm design was by mike connor and seth spitzer.
Retrieving part of the bookmarks tree
it contains administrative data as well as user data, and is therefore not recommended for use in querying.
...as long as the container is open, it will listen for notifications from the bookmarks system to keep itself up-to-date.
...otherwise, it will continue to get observer notifications and update itself, slowing down the whole browser.
...rootnode.containeropen = false; if you encounter a node with a type of result_type_folder or another type of container, you can open these folders and descend into the hierarchy.
Creating XPCOM components
note: in general, you should try to avoid having to create xpcom components.
... note:this article describes a method that uses xpidl but you should use webidl instead.
... methods creating an instance of your component weblock1.cpp using xpcom utilities to make things easier xpcom macros generic xpcom module macros common implementation macros declaration macros weblock2.cpp string classes in 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 webloc...
...ile manipulating files with nsifile using nsilocalfile for reading data processing the white list data iweblock method by method lock and unlock addsite removesite setsites getnext getsites hasmoreelements finishing the component using frozen interfaces copying interfaces into your build environment implementing the nsicontentpolicy interface receiving notifications implementing the nsicontentpolicy uniform resource locators checking the white list creating nsiuri objects building the weblock ui user interface package list client code overview xul the xul document the locking ui site adding ui weblock.xul overlaying new user interface into mozilla weblockoverlay.xul other resources weblock.css i...
Components.utils.waiveXrays
any expando properties are not visible, and if any native properties have been redefined, this has no effect.
...this means you don't have to care whether the initial object is an xray or not.
...if obj is not an xray, this function just returns obj.
... 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: // chrome code // contentwindow is an xray var isxray = components.utils.isxraywrapper(gbrowser.contentwindow); // true // expandos are not visible in xrays var foo = gbrowser.contentwindow.foo; // undefined // you can waive xray vision for an object var waived = components.utils.waivexrays(gbrowser.contentwindow); isxray = components.utils.isxraywrapper(waived); // false foo = waived.foo; // "i'm an expando" // waiving is transitive isxray...
Components object
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.
...some properties of components require advanced privileges and may not work in web pages.
... utils.scheduleprecisegc requests that garbage collection occur sometime in the future when no javascript code is running; accepts a callback function to receive notification once collection is complete.
JavaXPCOM
javaxpcom is not actively maintained.
... note: javaxpcom was included in xulrunner up through version 1.9.2.
... it has been removed in xulrunner 2, and is not actively maintained.
...as you will see in this article, working with xpcom objects in java is not that much different than doing so in c++.
Language bindings
these exception objects may be thrown when implementing xpcom interfaces in javascript, and they can provide better diagnostics in the error console if not caught than simply throwing an nsresult's value will.components.idcomponents.id is a constructor that creates native objects that conform to the nsijsid interface.components.interfacescomponents.interfaces is a read-only object whose properties are interfaces indexed by their names.components.interfacesbyidcomponents.interfacesbyid is a read-only array of classes indexed by iid.components.issucce...
...the result is structured cloned back to the original context, unless it is native (for example, if it returns a dom node, this is not structured cloned, because the original context will see that through an xraywrapper already), so it's guaranteed to behave predictably.
...any expando properties are not visible, and if any native properties have been redefined, this has no effect.components.utils.makeobjectpropsnormalensures that the specified object's methods are all in the object's scope, and aren't cross-component wrappers.components.utils.reporterrorcomponents.utils.reporterror reports a javascript error object to the error console, and returns.
...javaxpcom is not actively maintained.plxpcomplxpcom (perl xpcom) provides language bindings letting you use xpcom from perl code.
nsACString_internal
it represents a single contiguous array of characters, which may or may not be null-terminated.
... this type is not instantiated directly.
... the caller must not modify the characters at the returned address.
... the caller may modify the characters at the returned address (up to but not exceeding the length of the string).
nsAString_internal
it represents a single contiguous array of characters, which may or may not be null-terminated.
... this type is not instantiated directly.
... the caller must not modify the characters at the returned address.
... the caller may modify the characters at the returned address (up to but not exceeding the length of the string).
IAccessibleComponent
other-licenses/ia2/accessiblecomponent.idlnot scriptable this interface is implemented by any object that can be rendered on the screen.
...[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.
...[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.
...if the object is not on any screen the returned position is (0,0).
IAccessibleRelation
other-licenses/ia2/accessiblerelation.idlnot scriptable this interface gives access to an object's set of relations.
...s_false if there is nothing to return, [out] value is null.
...note that this array is to be allocated by the client and freed when no longer needed.
...ntargets actual number of targets in the returned array (not more than maxtargets) return value s_false if there is nothing to return, ntargets() is set to 0.
IAccessibleValue
other-licenses/ia2/accessiblevalue.idlnot scriptable this interface gives access to a single numerical value.
... return value s_false if there is nothing to return, [out] value is null.
...it does not have to be the same type as that returned by method currentvalue().
...it does not have to be the same type as that returned by method currentvalue().
amIWebInstallListener
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.
...ze_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); void onwebinstalldisabled(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); boolean onwebinstallrequested(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindowinternal.
... methods onwebinstallblocked() called when the website is not allowed to directly prompt the user to install add-ons.
imgILoader
libpr0n does not keep a strong ref to the observer; this prevents reference cycles.
...libpr0n does not keep a strong ref to the observer; this prevents reference cycles.
...alistener a listener that you must send the channel's notifications and data to.
... can be null, in which case imagelib has found a cached image and is not interested in the data.
nsIBidiKeyboard
or israel (hebrew) keyboard layout, beside an us (english) layout.) inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) method overview boolean islangrtl(); void setlangfrombidilevel(in pruint8 alevel); attributes attribute type description havebidikeyboards boolean indicates whether or not the system has at least one keyboard for each direction (left-to-right and right-to-left) installed.
... note: this throws ns_error_not_implemented if the widget layer doesn't provide this information.
...(supported on: win32, mac, gtk2) note: prior to gecko 1.9 this method used a parameter 'out prbool aisrtl' to return the value.
...return value true if the current keyboard is right-to-left, false if it is not.
nsIClassInfo
violates the xpcom interface guidelines exceptions thrown ns_error_not_available if the class does not have a classid contractid string a contractid through which an instance of this class can be created, or null.
... note: this flag is private and is for use by the mozilla codebase only.
... 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.
nsIClipboard
methods emptyclipboard() this method empties the clipboard and notifies the clipboard owner.
...it does not clear the native clipboard.
... forcedatatoclipboard() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) some platforms support deferred notification for putting data on the clipboard this method forces the data onto the clipboard in its various formats this may be used if the application going away.
...it does not actually retrieve the data and should be a very inexpensive call.
nsIClipboardCommands
mozilla does not use a private clipboard, instead it places its data directly onto the system clipboard.
...cancutselection() returns whether there is a selection and it is not read-only.
...canpaste() returns whether the current contents of the clipboard can be pasted and if the current selection is not read-only.
...return value true if there is data to paste on the clipboard and the current selection is not read-only, false otherwise.
nsIComponentManager
exceptions thrown ns_error_factory_not_registered indicates that the specified class is not registered.
... exceptions thrown ns_error_factory_not_registered indicates that the specified class is not registered.
... exceptions thrown ns_error_factory_not_registered indicates that the specified class is not registered.
... exceptions thrown ns_error_factory_not_registered indicates that the specified class is not registered.
nsIComponentRegistrar
registration lasts for this run only, and is not cached.
... note: formerly this method would register component files directly.
...this value is intended as a human-readable name for the class and need not be globally unique.
...this value is intended as a human-readable name for the class and need not be globally unique.
nsICookie
status_flagged 3 the cookie was not accepted.
... policy_none 1 the site did not send a compact policy along with the cookie.
... policy_explicit_consent 4 the site does not collect identifiable information unless user opts in.
... policy_no_ii 5 the site does not collect identifiable information.
nsICookiePermission
nt64 aexpiry); nsiuri getoriginatinguri(in nsichannel achannel); void setaccess(in nsiuri auri, in nscookieaccess aaccess); constants constant value description access_default 0 nscookieaccess's access default value access_allow 1 nscookieaccess's access allow value access_deny 2 nscookieaccess's access deny value access_session 8 additional values for nscookieaccess, which are not directly used by any methods on this interface, but are nevertheless convenient to define here.
... methods canaccess() tests whether or not the given uri/channel may access the cookie database, either to set or get cookies.
...cansetcookie() tests whether or not the given uri/channel may set a specific cookie.
...if the root content docshell or its principal's uri cannot be obtained, this method will throw.
nsIDownload
download objects are used by the download manager (see nsidownloadmanager to manage files that are queued to download, being downloaded, and finished being downloaded.) inherits from: nsitransfer last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) note: once the download is completed, the download manager stops updating the nsidownload object.
... id unsigned long the id by which the download is identified uniquely in the database - not globally unique.
... mimeinfo nsimimeinfo provides the targets relevant mime information, including its mime type, helper application, and whether or not the helper should be executed automatically once the download is complete.
... resumable boolean indicates if the download can be resumed after being paused or not.
nsIDroppedLinkHandler
if true, the source is not checked.
... exceptions thrown ns_error_dom_security_err error will be thrown and the event canceled if the receiving target should not load the uri for security reasons.
... this will occur if the source of the drag initiated a link for dragging that it itself cannot access.
... adisallowinherit acount receives the count of alinks array alinks recives an array of objects with nsidroppedlinkitem interface return value nothing.
nsIEventTarget
dispatch_sync 1 this flag specifies the synchronous mode of event dispatch, in which the dispatch() method does not return until the event has been processed.
... note: passing this flag to dispatch may have the side-effect of causing other events on the current thread to be processed while waiting for the given event to be processed.
... exceptions thrown ns_error_unexpected indicates that the thread is shutting down and has finished processing events, so this event would never run and has not been dispatched.
...if events dispatched to this target will be processed on another thread, returns false.
nsIFactory
exceptions thrown ns_error_no_interface indicates that the requested interface is not supported.
... ns_error_no_aggregation indicates that aggregation is not supported.
... gecko 1.7 note as of gecko 1.7, this method is unused.
... most implementations do nothing interesting with this method.
nsIFrameLoaderOwner
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview [noscript, notxpcom] alreadyaddrefed_nsframeloader getframeloader(); void swapframeloaders(in nsiframeloaderowner aotherowner); attributes attribute type description frameloader nsiframeloader the frame loader owned by this nsiframeloaderowner.
...[noscript, notxpcom] alreadyaddrefed_nsframeloader getframeloader(); parameters none.
... exceptions thrown ns_error_dom_security_err if the swap is not allowed on security grounds.
... ns_error_not_implemented if the swapping logic is not implemented for the either the current frame loader owner or the specified one with which you're trying to swap.
nsIGeolocationProvider
xpcom/system/nsigeolocationprovider.idlscriptable notify the geolocation service that a new geolocation has been discovered.
...method overview boolean isready(); obsolete since gecko 1.9.2 void shutdown(); void startup(); void watch(in nsigeolocationupdate callback); methods isready() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) reports whether or not the device is ready and has a position.
...watch() attaches a callback listener to be notified when a location change is observed.
... void watch( in nsigeolocationupdate callback ); parameters callback an nsigeolocationupdate to be notified when position changes.
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.
nsIHTTPHeaderListener
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) note: the plugin author must provide an instance to {geturl,posturl}() that implements both nsipluginstreamlistener and nsihttpheaderlistener.
...note: you must copy the values of the params.
...value does not include a terminating newline.
... note: you must copy this value.
nsIHttpActivityDistributor
tributor;1 as a service: var httpactivitydistributor = components.classes["@mozilla.org/network/http-activity-distributor;1"] .getservice(components.interfaces.nsihttpactivitydistributor); method overview void addobserver(in nsihttpactivityobserver aobserver); void removeobserver(in nsihttpactivityobserver aobserver); methods addobserver() begins delivery of notifications of http transport activity.
... void addobserver( in nsihttpactivityobserver aobserver ); parameters aobserver the nsihttpactivityobserver that should receive notifications of http transport activity; this object's nsihttpactivityobserver.observeactivity() method will be called each time activity occurs.
... removeobserver() stops delivery of notifications of http transport activity.
... void removeobserver( in nsihttpactivityobserver aobserver ); parameters aobserver the nsihttpactivityobserver that should no longer receive notifications of http transport activity.
nsIHttpActivityObserver
if this is false, the observeactivity() method should not be called.
...note: this attribute is present only for compatibility and should not be used.
...because a single http transaction may consist of multiple chunks of data transmitted through separate socket writes, each socket activity notification will only reflect the number of bytes transmitted in that chunk.
... http transaction activity for activity notifications of type activity_type_http_transaction, there are three activities that include extra data: activity_subtype_request_header aextrastringdata contains the text of the header.
nsILoginManagerCrypto
if the user is not logged in, performing a crypto operation will result in a master password prompt.
...can throw if the user cancels entry of their master password, or if the ciphertext value can not be successfully decrypted (for example, if it was encrypted with some other key).
...note: the current implemention of this inferface simply uses nss/psm's "secret decoder ring" service.
... it is not recommended for general purpose encryption/decryption.
nsILoginManagerPrompter
the prompt will be associated with this window (or, if a notification bar is being used, topmost opener in some cases).
... prompttochangepasswordwithusernames() ask the user if they want to change the password for one of multiple logins, when the caller can not determine exactly which login should be changed.
... note: because the caller does not know the username of the login to be changed, anewlogin.username and anewlogin.usernamefield will be set (using the user's selection) before modifylogin() is called.
... prompttosavepassword() ask the user if they want to save a login (yes, never, not now) void prompttosavepassword( in nsilogininfo alogin ); parameters alogin the login to be saved.
nsIMemoryReporter
note: this interface is undergoing heavy development, and is subject to rapid changes.
... note: this attribute was called memoryused prior to gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4), and its type was long long.
... kind_other 2 an allocation that does not fit into another kind category.
... note: the amount field should be given a value 100 times the actual percentage; this number will be divided by 100 when shown.
nsIMimeConverter
this should only be used by native code, as xpconnect translation causes it to not work properly.
... structured whether or not this string may contain <> blocks which should not be encoded (e.g., the from and to headers).
...thunderbird stored uint32 properties (not a complete list): indexed used for spotlight integration on osx.
... notaphishmessage indicates whether phisihing filters have been run on a message yet.
nsIPermissionManager
it should not be used by consumers.
...this requires an exact hostname match, subdomains are not a match.
... remarks this service broadcasts the following notification when the permission list is changed: topic : "perm-changed" (perm_change_notification) broadcast whenever the permission list changes in some way.
... there are four possible data strings for this notification; one notification will be broadcast for each change, and will involve a single permission.
nsIPlacesView
controllers should not be concerned with these details; controller code should not be required to decode the meaning of a selection depending on what kind of view produced the selection.
... note: nsiplacesview does not exist in idl at the moment.
...oryresultnode[] getdragableselection(); nsinavhistoryresultnode[][] getremovableselectionranges(); nsinavhistoryresult getresult(); nsinavhistorycontainerresultnode getresultnode(); nsinavhistoryresultnode[] getselectionnodes(); void selectall(); attributes attribute type description hasselection boolean whether or not there are selected items.
...the nodes are not necessarily returned in the same order in which they occur in the model, or in the same container, or from the same provider.
nsIPrefService
note: few consumers will want to create default branch objects.
... many of the branch methods do nothing on a default branch because the operations only make sense when applied to user set preferences.
... note: if nsnull is passed in for the afile parameter the default preferences file(s) [prefs.js, user.js] will be read and processed.
... note: if nsnull is passed in for the afile parameter the preference data is written out to the current preferences file (usually prefs.js.) void savepreffile( in nsifile afile ); parameters afile the file to be written.
nsIStreamConverter
netwerk/streamconv/public/nsistreamconverter.idlscriptable provides an interface to implement when you have code that converts data from one type to another.
...id asyncconvertdata(in string afromtype, in string atotype, in nsistreamlistener alistener, in nsisupports actxt); nsiinputstream convert(in nsiinputstream afromstream, in string afromtype, in string atotype, in nsisupports actxt); methods asyncconvertdata() asynchronous version: converts data arriving via the converter's nsistreamlistener.ondataavailable() method from one type to another, pushing the converted data out to the caller via alistener::ondataavailable().
... convert() synchronous version: converts a stream of one type, to a stream of another type.
... note: the returned stream may not already be converted.
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.
...note that these keys may not exist in the original string bundle.
...an exception is thrown if the key has not been overridden.
... however, no exception is thrown if the original string bundle did not have the key.
nsITelemetry
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.
...does not indicate whether telemetry will send any data.
...does not indicate whether telemetry will send any data.
... see also bug 649502 - expose histograms to js bug 585196 - telemetry infrastructure bug 668312 - report only probes defined in histograms.json bug 1069874 - add keyed histogram types bug 1426453 - documentation of nsitelemetry not up to date ...
nsIToolkitProfileService
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.
...(not the profile currently in use.) not sure what happens if you change this setting but someone said: you can change profiles by setting this attribute's value.
... ns_error_file_not_directory one of the specified directory files is not actually a directory.
...if the path does not exist, it is created and the defaults copied from the application directory.
nsITreeColumn
if the cycler attribute is not set, the column cells are regular text cells.
...if the editable attribute is not set, the column cells are not editable.
...if the primary attribute is not set, the column is not the primary column.
...if the selectable attribute is not set, the column cells are not selectable.
nsIUpdatePrompt
toolkit/mozapps/update/nsiupdateservice.idlscriptable this interface describes an object that can be used to show various update-related notifications to the user.
...if background is true (for example the download was not user initiated) and the app.update.silent preference is true the call will be a no-op.
...background optional an optional parameter that, if provided and true, presents a less-obtrusive, non-modal notification alert.
...the nsiupdate object will not be the actual update when the error occurred during an update check and will instead be an nsiupdate object with the error information for the update check.
nsIWebContentHandlerRegistrar
note: script must execute from same domain as uri or else it will throw permission error.
...reak; } } } else { //adomwindow is a popup window if (adomwindow.location.hostname == myurihostname) { htmlcontentwindow = adomwindow; break; } } } // this section here is long and daunting, but its just finding a suitable contentwindow if (!htmlcontentwindow) { throw new error('no suitable content window found, will not reigsterprotocolhandler.
...if it does not find anything with host name of mail.live.com then it aborts.
... if the host names do not match, this error will be thrown in the error console.
nsIWifiAccessPoint
this string is null if not available.
...note: this string consists of the bytes as received from the network and may contain nulls and other unprintable characters; if you need to display the ssid, use the ssid attribute instead.
...this string is null if not available.
...note: this is a conversion of the ssid into a "displayable" string.
Xptcall Porting Guide
// return a refcounted pointer to the interfaceinfo for this object // note: on some platforms this must not fail or we crash!
...i believe that the non-assembly parts of these files can be copied and reused with minimal (but not zero) platform specific tweaks.
...not all of the functionality is exercised, but it is a place to get started.
...such a test ought to be written, but this has not yet been done.
Address book sync client design
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.
... */ void onstopauthoperation(in nsresult astatus, in wstring amsg, in string acookie); /** * notify the observer that the ab sync operation has begun.
... this method is * called only once, at the beginning of a sync transaction * */ void onstartoperation(in print32 atransactionid, in pruint32 amsgsize); /** * notify the observer that progress as occurred for the ab sync operation */ void onprogress(in print32 atransactionid, in pruint32 aprogress, in pruint32 aprogressmax); /** * notify the observer with a status message for sync operation */ void onstatus(in print32 atransactionid, in wstring amsg); /** * notify the observer that the ab sync operation has been completed.
LDAP Support
it is not intended as an introduction to ldap and mozilla products.
...it should be noted that all of this information applies to both thunderbird and the seamonkey application suite.
...some notes about the relationship: there is a many to one relationship between ldap attributes and its address book counterpart.
...ent department department departmentnumber company o company company workcountry countryname _aimscreenname nscpaimscreenname webpage1 workurl webpage2 homeurl birthyear birthyear custom1 custom1 custom2 custom2 custom3 custom3 custom4 custom4 notes notes notes description prefermailformat xmozillausehtmlmail lastmodifieddate modifytimestamp custom ldap attributes thunderbird supports custom ldap attributes for various address book attributes.
MailNews Filters
for new incoming messages, the protocol specific object that handles new messages calls nsimsgfilterlist::applyfilterstohdr and passes itself in as nsimsgfilterhitnotify interface to handle filter hits.
...applyfilterstohdr will in turn call the applyfilterhit method of the passed in nsimsgfilterhitnotify interface ptr.
...the search is executed locally, not on the server, so that criteria like "in address book" still work.
...most if not all of the above pieces of code would be involved in the extension mechanism.
Thunderbird Binaries
note: while beta builds have had some testing, they should be considered preview only and should not be used in a production environment.
... please read the release notes before downloading.
... latest english trunk builds are available at: https://archive.mozilla.org/pub/thunderbird/nightly/latest-comm-central/ latest localized trunk builds are available at: https://archive.mozilla.org/pub/thunderbird/nightly/latest-comm-central-l10n/ note: please use http://ftp.stage.mozaws.net/pub/thunderbird/nightly/latest-comm-central/ because the above two links currently do not work.
...you should see a string that looks something like this: comm-central-1.9.2 branch: mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.9.2.2pre) gecko/20100308 lanikai/3.1b1pre comm-central-trunk: mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.9.3a1pre) gecko/20090826 shredder/3.1a1pre the part that you want to note is the gecko revision number (rv) and the thunderbird version string.
Thunderbird Configuration Files
all these files are plain text files you need to create in your profile folder and can be edited using a standard text editor, such as notepad on windows and gedit or kate on linux.
...this folder does not exist by default, so you need to create it before you can start adding your preferences.
...as with userchrome.css, this folder does not exist by default, so you need to create it before you can start adding your preferences.
...the file does not exist by default, so you need to create it before you can start adding your preferences.
Activity Manager examples
if the default implementation of nsiactivityprocess, nsiactivitywarning and nsiactivityevent are not sufficient for the activity initiator, activity developers can provide their own components to extend the capabilities.
...onst nsiae = components.interfaces.nsiactivityevent; const nsiam = components.interfaces.nsiactivitymanager; let gactivitymanager = components.classes["@mozilla.org/activity-manager;1"].getservice(nsiam); let process = components.classes["@mozilla.org/activity-process;1"].createinstance(nsiap); // assuming folder is an instance of nsimsgfolder interface // localization is omitted, initiator is not provided process.init("processing folder: " + folder.prettiestname, null); // note that we don't define a custom icon, default process icon // will be used process.contexttype = "account"; // group this activity by account process.contextobj = folder.server; // account in question gactivitymanager.addactivity(process); // step 2: showing some progress let percent = 50; proces...
...t_contractid); srcfolder->setasisupports(reinterpret_cast<nsisupports*>(imapfolder)); copyevent->addsubject(srcfolder); copyevent->init(ns_literal_string("message copy event"), initiator, ns_literal_string("completed successfully"), pr_now() / pr_usec_per_msec, // start time pr_now() / pr_usec_per_msec); // completion time // do not forget to increase the ref counter if needed copyevent->setundohandler(undohandler); //////////////////////////////////////////////////////////////// //// adding the event into activity manager nscomptr<nsiactivitymanager> activitymgr(do_getservice("@mozilla.org/activity-manager;1")); pruint32 id; activitymgr->addactivity(copyevent, &id); adding an activity with a custom context type this s...
...(this example seems to be outdated and not working, see bug 557467 comment 1.) //optional: define some convenience constants const nsactprocess = components.constructor("@mozilla.org/activity-process;1", "nsiactivityprocess", "init"); const nsactevent = components.constructor("@mozilla.org/activity-event;1", "nsiactivityevent", "init"); // step 1: implement nsiactivitycontextdisplayhelper to show a // customized display text for our context type function senderco...
Theme Packaging
pre-requisites making a theme for thunderbird requires knowledge of cascading stylesheets (css), probably xbl, and some graphic design and aesthetic skill (...or maybe not).
...see the install.rdf reference for more information: em:id em:version em:type em:targetapplication em:name em:internalname optional install.rdf properties em:description em:creator em:contributor em:homepageurl em:updateurl note that if your theme will be made available on the https://addons.mozilla.org website, it may not include an updateurl.
...do not add to this list without contacting benjamin smedberg.
... note that this page is included from the pages listed below.
Zombie compartments
...) compartment(https://plusone.google.com/_/+1/fastbutton?...) compartment(http://platform.twitter.com/widgets/...utton.html?...) compartment(http://cdn.at.atwola.com/_media/uac/tcode3.html) compartment(https://s-static.ak.fbcdn.net/connec..._proxy.php?...) compartment(http://ads.tw.adsonar.com/adserving/getads.jsp?...) (some of those compartment urls are long and have been truncated.) another thing to beware is each compartment is created for an origin (e.g.
... open about:memory in another tab to confirm that the relevant compartment is present.
... proactive checking of add-ons it's not uncommon for add-ons to cause zombie compartments, see bug 700547 for examples.
...(please note that you may need to close the about:addons ui before changes are made).
Declaring types
you can, optionally, leave out the field descriptor array; this creates an opaque structure whose contents are not defined.
... note: at present, there isn't a way to specify that an array's c equivalent was declared as a packed structure; that is, using #pragma pack.
... for another example see here: getcursorpos opaque structures an opaque structure is one whose content fields are not known, or are not intended to be accessed directly.
... for example: var somestructure = ctypes.structtype("somestructure"); var anotherstruct = ctypes.structtype("anotherstruct", [ {field1: opaque.ptr} ]); somestructure.define([ { ptrtoanotherstruct: anotherstruct.ptr } ]); as you see here, the two structure types here contain pointers to each other; by making one of them opaque at first, you can declare the fields on the other one, then define the fields on the first one afterward.
FunctionType
the equivalent c function type declaration would be: returntype (*) ([argtype1, ..., argtypen]); exceptions thrown typeerror abi is not a valid abi constants, or returntype or any of the argument types are not valid ctype objects.
... note: ctypes.void_t.size is undefined.
... method overview methods inherited from ctype ctype array([n]) string tosource() string tostring() functiontype cdata functiontype cdata cannot be constructed.
... exceptions thrown typeerror func is not either pointer value or javascript function.
Flash Activation: Browser Comparison - Plugins
each of the major browsers has now implemented a feature where adobe flash content does not run by default, but each of the browsers has implemented this feature and the user interface in slightly different ways.
...ctivate flash: users have the choice to allow flash just for the current session, or to remember their choice: google chrome in-page ui is displayed when the site attempts to use flash without fallback content: a user can click the plugin element to show a prompt for allowing flash: if the site provides fallback content for an object element, chrome will display that content and will not prompt the user to enable flash.
... if a flash element is not visible to the user, the user will not get a visible prompt.
...the user can click the flash object to show activation options: users have the choice to allow flash just for the current session, or to remember their choice: site authoring tips if a flash element is very small, hidden, or covered by other content, users will probably not notice that flash is required and will become confused.
Constants - Plugins
nperr_incompatible_version_error 8 versions of plug-in and communicator do not match.
... nperr_file_not_found 11 file missing or invalid.
... nperr_stream_not_seekable 13 seekable stream expected.
... npvers_has_notification 9 notification of completion.
Gecko Plugin API Reference - Plugins
npp_destroy npp_destroystream npp_getvalue np_getvalue npp_handleevent np_initialize npp_new npp_newstream npp_print npp_setvalue npp_setwindow np_shutdown npp_streamasfile npp_urlnotify npp_write npp_writeready browser side plug-in api this chapter describes methods in the plug-in api that are available from the browser.
... warning: you must only call these from the main thread; calling them from other threads is not supported and may have unpredictable results.
... npn_geturlnotify requests creation of a new stream with the contents of the specified url; gets notification of the result.
... npn_posturlnotify posts data to a url, and receives notification of the result.
Plugins
they may not be supported in the future.
... new content should not be written using flash or any other plugin technology.
... roadmap highlights since firefox 52, plugins other than flash are not loaded by firefox.
... plugin blocking by domain in order to improve security and performance for firefox users, firefox maintains a list of sites that are not able to use plugins.
Browser Toolbox - Firefox Developer Tools
note: if you want to debug a specific add-on that is restartless or sdk-based then try the add-on debugger.
... enabling the browser toolbox the browser toolbox is not enabled by default.
...altogether you will have access to the following developer tools: debugger (note: if you want to debug a specific add-on that is restartless or sdk-based then try the add-on debugger.) console style editor performance network monitor page inspector accessibility inspector you can debug chrome: and about: pages using the normal debugger, just as if they were ordinary content pages.
... note: this change is not persistent across browser restarts.
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
(this menu will not be present unless you have changed the preference as explained above.) selecting the 'browser' context in the scratchpad enter the following code in the scratchpad: // this simply defines the 'debugger' constructor in this // scratchpad; it doesn't actually start debugging anything.
...note that stack entries are '===' if // they represent the same site with the same callers.
...(if you get an error complaining that components.utils is not defined, be sure you've selected browser from the scratchpad's environment menu, as described in step 2.) save the following html text to a file, and visit the file in your browser.
...we will probably change this to be the line number within page.html, not the line number within the handler code.) the onclick handler calls dodivsandspans, which calls divsandspans, which invokes closures of factory to do all the actual allocation.
Deprecated tools - Firefox Developer Tools
not all of these have had wide adoption, and due to the cost of maintenance, seldom used panels are eventually removed.
...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.
... we do not have dedicated documentation for the canvas debugger.
Dominators view - Firefox Developer Tools
in particular, allocation stacks are currently only recorded for objects, not for arrays, strings, or internal structures.
...if one were removed, then the documentprototype would still not be garbage-collected, because it's still retained by the other two path.
...but the array is also rooted directly, so if the object were to stop referencing the array, it would still not be eligible for garbage collection.
... this means that the object does not dominate the array, and is therefore not shown in the dominators tree view.
UI Tour - Firefox Developer Tools
the select element button is one way you can select an element for inspection: note that it's actually part of the main toolbox toolbar, so it's immediately accessible from any tool, not just the inspector.
...note that before firefox 50, the box model view did not appear in the "computed view" tab, but had its own tab.
...it shows icons for the browsers that do support the properties, and notes properties that are experimental or deprecated.
... untick the checkbox for any browser you are not interested in.
AnimationEvent.initAnimationEvent() - Web APIs
note: during the standardization process, this method was removed from the specification.
...do not use this method; instead, use the standard constructor, animationevent(), to create a synthetic animationevent.
... canbubblearg a boolean flag indicating if the event can bubble (true) or not (false).
... cancelablearg a boolean flag indicating if the event associated action can be avoided (true) or not (false).
AudioListener.forwardX - Web APIs
note: the parameter is a-rate when used with a pannernode whose panningmodel is set to equalpower, or k-rate otherwise.
... 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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.forwardY - Web APIs
note: the parameter is a-rate when used with a pannernode whose panningmodel is set to equalpower, or k-rate otherwise.
... 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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.forwardZ - Web APIs
note: the parameter is a-rate when used with a pannernode whose panningmodel is set to equalpower, or k-rate otherwise.
... 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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.positionX - Web APIs
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
... 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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.positionY - Web APIs
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
... 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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.positionZ - Web APIs
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
... 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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.speedOfSound - Web APIs
the speedofsound property's default value is 343.3 m/s and is used to calculate the doppler shift appropriate for the speed the panner is travelling at (as defined by pannernode.setvelocity.) note: bear in mind that no propagation delay is automatically applied to a sound far from the listener.
... 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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.upX - Web APIs
WebAPIAudioListenerupX
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
... 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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.upY - Web APIs
WebAPIAudioListenerupY
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
... 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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.upZ - Web APIs
WebAPIAudioListenerupZ
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
... 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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioProcessingEvent - Web APIs
note: as of the august 29 2014 web audio api spec publication, this feature has been marked as deprecated, and is soon to be replaced by audioworklet.
...note the the returned audiobuffer is only valid in the scope of the onaudioprocess function.
...note the the returned audiobuffer is only valid in the scope of the onaudioprocess function.
... note: for a full working example, see our script-processor-node github repo (also view the source code.) var myscript = document.queryselector('script'); var mypre = document.queryselector('pre'); var playbutton = document.queryselector('button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessorno...
AudioWorkletProcessor.process - Web APIs
although the method is not a part of the audioworkletprocessor interface, any implementation of audioworkletprocessor must provide a process() method.
... return value a boolean value indicating whether or not to force the audioworkletnode to remain active even if the user agent's internal logic would otherwise decide that it's safe to shut down the node.
...if the combination of the return value and the state of the node causes the browser to decide to stop the node, process() will not be called again.
... note: an absence of the return statement means that the method returns undefined, and as this is a falsy value, it is like returning false.
AuthenticatorAssertionResponse.userHandle - Web APIs
note: an authenticatorassertionresponse instance is available on publickeycredential.response after calling navigator.credentials.get().
... note: this property may only be used in top-level contexts and will not be available in an <iframe> for example.
...this is not human-readable and does not contain any personally identifying information (e.g.
... username, e-mail, phone number, etc.) examples var options = { challenge: new uint8array(26), // will be another value, provided by the relying party server timeout: 60000 }; navigator.credentials.get({ publickey: options }) .then(function (assertionpkcred) { var userhandle = assertionpkcred.response.userhandle; // send response and client extensions to the server so that it can // go on with the authentication }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'userhandle' in that specification.
BaseAudioContext.createBuffer() - Web APIs
note: createbuffer() used to be able to take compressed data and give back decoded samples, but this ability was removed from the spec, because all the decoding was done on the main thread, therefore createbuffer() was blocking other code execution.
... syntax var buffer = 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.
... 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).
... note: audio resampling is very similar to image resizing: say you've got a 16 x 16 image, but you want it to fill a 32x32 area: you resize (resample) it.
Beacon API - Web APIs
beacon requests use the http post method and requests typically do not require a response.
...there is nothing the next page can do to avoid this perception of poor page load performance.
...another technique is to create a no-op loop for several seconds within the unload handler to delay the unload and submit data to a server.
... not only do these techniques represent poor coding patterns, some of them are unreliable and result in the perception of poor page load performance for the next navigation.
Bluetooth.getAvailability() - Web APIs
for a returns a boolean which is true if the deveice has a bluetooth adapter and false otherwise (unless user configured user agent not to expose a real value).
... note: user might not allow use of web bluetooth api, even if getavailability() returned true (navigator.bluetooth.requestdevice() might not resolve with a bluetoothdevice).
... 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.
BluetoothRemoteGATTCharacteristic - Web APIs
value; promise<bluetoothremotegattdescriptor> getdescriptor(bluetoothdescriptoruuid descriptor); promise<sequence<bluetoothremotegattdescriptor>> getdescriptors(optional bluetoothdescriptoruuid descriptor); promise<dataview> readvalue(); promise<void> writevalue(buffersource value); promise<void> startnotifications(); promise<void> stopnotifications(); }; bluetoothremotegattcharacteristic implements eventtarget; bluetoothremotegattcharacteristic implements characteristiceventhandlers; properties bluetoothremotegattcharacteristic.serviceread only returns the bluetoothgattservice this characteristic belongs to.
...this value gets updated when the value of the characteristic is read or updated via a notification or indication.
... bluetoothremotegattcharacteristic.startnotifications() returns a promise when navigator.bluetooth is added to the active notification context.
... bluetoothremotegattcharacteristic.stopnotifications() returns a promise when navigator.bluetooth is removed from the active notification context.
CSSPrimitiveValue - Web APIs
conversions are allowed between absolute values (from millimeters to centimeters, from degrees to radians, and so on) but not between relative values.
... (for example, a pixel value cannot be converted to a centimeter value.) percentage values can't be converted since they are relative to the parent value (or another property value).
... css_unknown the value is not a recognized css2 value.
...if the property attached with this value can not accept the specified unit or the float value, the value will be unchanged and a domexception will be raised.
Cache.put() - Web APIs
WebAPICacheput
fetch(url).then(function(response) { if (!response.ok) { throw new typeerror('bad response status'); } return cache.put(url, response); }) note: put() will overwrite any key/value pair previously stored in the cache that matches the request.
... note: cache.add/cache.addall do not cache responses with response.status values that are not in the 200 range, whereas cache.put lets you store any request/response pair.
... note: the promise will reject with a typeerror if the url scheme is not http or https.
... if not, open the v1 cache using open(), put the default network request in the cache using cache.put() and return a clone of the default network request using return response.clone().
CacheStorage.match() - Web APIs
note: caches.match() is a convenience method.
... ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching.
... in other words, if the url matches you will get a match regardless of whether the response object has a vary header or not.
... if not, open the v1 cache using open(), put the default network request in the cache using cache.put() and return a clone of the default network request using return response.clone().
CanvasRenderingContext2D.drawImage() - Web APIs
if not specified, the entire rectangle from the coordinates specified by sx and sy to the bottom-right corner of the image is used.
...if not specified, the image is not scaled in width when drawn.
...if not specified, the image is not scaled in height when drawn.
... ns_error_not_available the image is not loaded yet.
ChildNode.after() - Web APIs
WebAPIChildNodeafter
exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy.
...sole.log(parent.outerhtml); // "<div><p></p>text</div>" inserting an element and text var parent = document.createelement("div"); var child = document.createelement("p"); parent.appendchild(child); var span = document.createelement("span"); child.after(span, "text"); console.log(parent.outerhtml); // "<div><p></p><span></span>text</div>" childnode.after() is unscopable the after() method is not scoped into the with statement.
... with(node) { after("foo"); } // referenceerror: after is not defined polyfill you can polyfill the after() method in internet explorer 9 and higher with the following code: // from: https://github.com/jserz/js_piece/blob/master/dom/childnode/after()/after().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('after')) { return; } object.defineproperty(item, 'after', { configurable: true, enumerable: true, writable: true, value: function after() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfrag.append...
...argitem : document.createtextnode(string(argitem))); }); this.parentnode.insertbefore(docfrag, this.nextsibling); } }); }); })([element.prototype, characterdata.prototype, documenttype.prototype]); another polyfill // from: https://github.com/fabiovergani/js-polyfill_element.prototype.after/blob/master/after.js (function(x){ var o=x.prototype,p='after'; if(!o[p]){ o[p]=function(){ var e, m=arguments, l=m.length, i=0, t=this, p=t.parentnode, n=node, s=string, d=document; if(p!==null){ while(i<l){ e=m[i]; if(e instanceof n){ t=t.nextsibling; if(t!==null){ p.insertbefore(e,t); }else{ p.appendchild(e); }; }else{ ...
Clients.openWindow() - Web APIs
in firefox, the method is allowed to show popups only when called as the result of a notification click event.
... examples // send notification to os if applicable if (self.notification.permission === 'granted') { const notificationobject = { body: 'click here to view your messages.', data: { url: self.location.origin + '/some/path' }, // data: { url: 'http://example.com' }, }; self.registration.shownotification('you\'ve got messages!', notificationobject); } // notification click event listener self.addeventl...
...istener('notificationclick', e => { // close the notification popout e.notification.close(); // get all the window clients e.waituntil(clients.matchall({ type: 'window' }).then(clientsarr => { // if a window tab matching the targeted url already exists, focus that; const hadwindowtofocus = clientsarr.some(windowclient => windowclient.url === e.notification.data.url ?
... if (!hadwindowtofocus) clients.openwindow(e.notification.data.url).then(windowclient => windowclient ?
Clipboard.read() - Web APIs
WebAPIClipboardread
note: the asynchronous clipboard and permissions apis are still in the process of being integrated into most browsers, so they often deviate from the official rules for permissions and the like.
...the promise is rejected if permission to access the clipboard is not granted.
...if it's not a png image, an error message is presented.
...unable to access it."); } else { const blob = data.items[i].gettype("image/png"); imgelem.src = url.createobjecturl(blob); } } }); } }); note: at this time, while firefox does implement read(), it does not recognize the "clipboard-read" permission, so attempting to use the permissions api to manage access to the api will not work.
CloseEvent.initCloseEvent() - Web APIs
do not use this method anymore as it is deprecated.
... canbubble whether or not the event can bubble.
... cancelable whether or not the event's default action can be prevented.
... wasclean whether or not the connection was cleanly closed.
Console.profileEnd() - Web APIs
calling this api immediately after console.profile() can cause it to not work.
... if console.profileend() is passed a profile name and it does not match the name of a profile being recorded, no changes will be made.
... if console.profileend() is not passed a profile name, the most recently started profile is stopped.
... note: this feature is available in web workers.
Crypto.getRandomValues() - Web APIs
to guarantee enough performance, implementations are not using a truly random number generator, but they are using a pseudo-random number generator seeded with a value with enough entropy.
...note that typedarray is modified in-place, and no copy is made.
... usage notes don't use getrandomvalues() to generate encryption keys.
...there are a few reasons for this; for example, getrandomvalues() is not guaranteed to be running in a secure context.
CustomEvent.initCustomEvent() - Web APIs
if the event has already been dispatched, this method does nothing.
... do not use this method anymore, as it is deprecated.
... note: rather than using the feature, instead use specific event constructors, like customevent().
... canbubble is a boolean indicating whether the event bubbles up through the dom or not.
DataTransfer.mozClearDataAt() - Web APIs
if the format argument is not provided, then the data associated with all formats is removed.
... if the format is not found, then this method has no effect.
... note: this method is gecko-specific.
... function dragend_handler(event) { var dt = event.datatransfer; // remove a text/html item dt.mozcleardataat("text/html", 1); } specifications this method is not defined in any web standard.
DataTransfer.mozCursor - Web APIs
note: if any value other than default is set, auto is assumed.
... note: this property is currently only implemented on windows.
... note: this property is gecko-specific.
... function drop_handler(event) { var dragdata = event.datatransfer; console.log("mozcursor = " + dragdata.mozcursor); } specifications this property is not defined in any web standard.
DataTransfer.mozGetDataAt() - Web APIs
this method returns null if the specified item does not exist or if the index is not in the range from zero to the number of items minus one.
... note: this method is gecko-specific.
...if the specified item does not exist, null is returned.
...; i++) { output(" item " + i + ":\n"); var types = dt.moztypesat(i); for (var t = 0; t < types.length; t++) { output(" " + types[t] + ": "); try { var data = dt.mozgetdataat(types[t], i); output("(" + (typeof data) + ") : <" + data + " >\n"); } catch (ex) { output("<>\n"); dump(ex); } } } } specifications this method is not defined in any web standard.
DataTransfer.mozSourceNode - Web APIs
for external drags or if the calling function cannot reach the node, null is returned.
... note: this property is gecko-specific.
...returns null for external drags or if the node cannot be accessed.
... function dragend_handler(event) { var dragdata = event.datatransfer; var node = dragdata.mozsourcenode; if (node != null) console.log("mozsourcenode = " + dragdata.mozsourcenode); else console.log("mozsourcenode is null"); } specifications this property is not defined in any web standard.
DataTransfer.mozTypesAt() - Web APIs
if the index is not in the range from 0 to the number of items minus one, an empty string list is returned.
... note: this method is gecko-specific.
...if the index is not in the range from 0 to the number of items minus one, an empty string list is returned.
...; i++) { output(" item " + i + ":\n"); var types = dt.moztypesat(i); for (var t = 0; t < types.length; t++) { output(" " + types[t] + ": "); try { var data = dt.mozgetdataat(types[t], i); output("(" + (typeof data) + ") : <" + data + " >\n"); } catch (ex) { output("<>\n"); dump(ex); } } } } specifications this method is not defined in any web standard.
Document.adoptNode() - Web APIs
document.adoptnode() transfers a node from another document into the method's document.
... syntax const importednode = document.adoptnode(externalnode); parameters externalnode the node from another document to be adopted.
... note: importednode's node.parentnode is null, since it has not yet been inserted into the document tree!
... example const iframe = document.queryselector('iframe'); const iframeimages = iframe.contentdocument.queryselectorall('img'); const newparent = document.getelementbyid('images'); iframeimages.foreach(function(imgel) { newparent.appendchild(document.adoptnode(imgel)); }); notes before they can be inserted into the current document, nodes from external documents should either be: cloned using document.importnode(); or adopted using document.adoptnode().
Document.createTouch() - Web APIs
note: before gecko 25.0, this method was defined on the documenttouch mixin.
... syntax var touch = documenttouch.createtouch(view, target, identifier, pagex, pagey, screenx, screeny); parameters note: all parameters are optional.
... note: previous versions of this method included the following additional parameters but those parameters are not included in either of the standards listed below.
... consequently, these parameters should be considered deprecated and not used.
Document.fullscreen - Web APIs
the obsolete document interface's fullscreen read-only property reports whether or not the document is currently displaying content in full-screen mode.
... although this property is read-only, it will not throw if it is modified (even in strict mode); the setter is a no-operation and it will be ignored.
... note: since this property is deprecated, you can determine if full-screen mode is active on the document by checking to see if document.fullscreenelement is not null.
... example this simple function reports whether or not full-screen mode is currently active, using the obsolete fullscreen property.
Document.fullscreenEnabled - Web APIs
the read-only fullscreenenabled property on the document interface indicates whether or not full-screen mode is available.
... although this property is read-only, it will not throw if it is modified (even in strict mode); the setter is a no-operation and it will be ignored.
... example in this example, before attempting to request full-screen mode for a <video> element, the value of fullscreenenabled is checked, in order to avoid making the attempt when not available.
... function requestfullscreen() { if (document.fullscreenenabled) { videoelement.requestfullscreen(); } else { console.log('your browser cannot use fullscreen right now'); } } specifications specification status comment fullscreen apithe definition of 'document.fullscreenenabled' in that specification.
Document.visibilityState - Web APIs
'hidden' the page content is not visible to the user.
... 'prerender' the page content is being prerendered and is not visible to the user (considered hidden for purposes of document.hidden).
... the document may start in this state, but will never transition to it from another value.
... note: this was removed from the standard.
DocumentOrShadowRoot.getSelection() - Web APIs
example function foo() { var selobj = document.getselection(); alert(selobj); var selrange = selobj.getrangeat(0); // do stuff with the range } notes string representation of the selection object in javascript, when an object is passed to a function expecting a string (like window.alert()), the object's tostring() method is called and the returned value is passed to the function.
...however, attempting to use a javascript string property or method such as length or substr directly on a selection object results in an error if it does not have that property or method and may return unexpected results if it does.
... it is worth noting that currently getselection() doesn't work on the content of <input> elements in firefox.
... notice also the difference between selection and focus.
Element: auxclick event - Web APIs
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.
...due to timing differences between operating systems, this too is not a preventable default behavior of auxclick.
...andom(number) { return math.floor(math.random() * number); } function randomcolor() { return `rgb(${random(255)}, ${random(255)}, ${random(255)})`; } button.onclick = function() { button.style.backgroundcolor = randomcolor(); }; button.onauxclick = function(e) { e.preventdefault(); button.style.color = randomcolor(); } button.oncontextmenu = function(e) { e.preventdefault(); } notice that in addition to capturing the auxclick event using onauxclick, the contextmenu event is also captured, and preventdefault() called on that event, in order to prevent the context menu from popping up after the color change is applied.
... html <button><h1>click me!</h1></button> css html { height: 100%; overflow: hidden; } body { height: inherit; display: flex; justify-content: center; align-items: center; margin: 0; } button { border: 0; background-color: white; font-size: 8vw; display: block; width: 100%; height: 100%; } h1 { letter-spacing: 0.5rem; } result note: if you are using a three-button mouse, you'll notice that the onauxclick handler is run when any of the non-left mouse buttons are clicked (usually including any "special" buttons on gaming mice).
Element.clientTop - Web APIs
WebAPIElementclientTop
this is because the offsettop indicates the location of the top of the border (not the margin) while the client area starts immediately below the border, (client area includes padding.) therefore, the clienttop value will always equal the integer portion of the .getcomputedstyle() value for "border-top-width".
... note: this property will round the value to an integer.
...this property is not supported in firefox 2 and earlier.
... padding-bottom left top right bottom margin-top margin-bottom border-top border-bottom notes clienttop was first introduced in the ms ie dhtml object model.
Element.getElementsByClassName() - Web APIs
usage notes as always, the returned collection is live, meaning that it always reflects the current state of the dom tree rooted at the element on which the function was called.
...however the following code will not work as one might expect because "matches" will change as soon as any "colorbox" class is removed.
... var matches = element.getelementsbyclassname('colorbox'); for (var i=0; i<matches.length; i++) { matches[i].classlist.remove('colorbox'); matches.item(i).classlist.add('hueframe'); } instead, use another method, such as: var matches = element.getelementsbyclassname('colorbox'); while (matches.length > 0) { matches.item(0).classlist.add('hueframe'); matches[0].classlist.remove('colorbox'); } this code finds descendant elements with the "colorbox" class, adds the class "hueframe", by calling item(0), then removes "colorbox" (using array notation).
... another element (if any are left) will then become item(0).
Element.insertAdjacentHTML() - Web APIs
it does not reparse the element it is being used on, and thus it does not corrupt the existing elements inside that element.
... visualization of position names <!-- beforebegin --> <p> <!-- afterbegin --> foo <!-- beforeend --> </p> <!-- afterend --> note: the beforebegin and afterend positions work only if the node is in the dom tree and has a parent element.
... example // <div id="one">one</div> var d1 = document.getelementbyid('one'); d1.insertadjacenthtml('afterend', '<div id="two">two</div>'); // at this point, the new structure is: // <div id="one">one</div><div id="two">two</div> notes security considerations when inserting html into a page by using insertadjacenthtml(), be careful not to use user input that hasn't been escaped.
... it is not recommended you use insertadjacenthtml() when inserting plain text; instead, use the node.textcontent property or the element.insertadjacenttext() method.
Element.msZoomTo() - Web APIs
WebAPIElementmsZoomTo
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.
...if no value is specified, defaults to the current zoom level (no additional zoom occurs).this argument is ignored if the element is not zoomable.
... return value this method does not return a value.
Element.namespaceURI - Web APIs
the element.namespaceuri read-only property returns the namespace uri of the element, or null if the element is not in a namespace.
... if (element.localname == "browser" && element.namespaceuri == "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul") { // this is a xul browser } notes this is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope.
... the dom does not handle or enforce namespace validation per se.
...also note that the namespace prefix, once it is associated with a particular element, cannot be changed.
Element.removeAttribute() - Web APIs
if the specified attribute does not exist, removeattribute() returns without generating an error.
... usage notes you should use removeattribute() instead of setting the attribute value to null either directly or using setattribute().
... many attributes will not behave as expected if you set them to null.
... dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - example // given: <div id="div1" align="left" width="200px"> document.getelementbyid("div1").removeattribute("align"); // now: <div id="div1" width="200px"> specifications specification status comment domthe defi...
Element: scroll event - Web APIs
bubbles no cancelable no interface event event handler property onscroll note: in ios uiwebviews, scroll events are not fired while scrolling is taking place; they are only fired after the scrolling has completed.
...safari and wkwebviews are not affected by this bug.
... note, however, that input events and animation frames are fired at about the same rate, and therefore the optimization below is often unnecessary.
..._known_scroll_position = 0; let ticking = false; function dosomething(scroll_pos) { // do something with the scroll position } window.addeventlistener('scroll', function(e) { last_known_scroll_position = window.scrolly; if (!ticking) { window.requestanimationframe(function() { dosomething(last_known_scroll_position); ticking = false; }); ticking = true; } }); note: you can find more examples on the resize event page.
Element.toggleAttribute() - Web APIs
the toggleattribute() method of the element interface toggles a boolean attribute (removing it if it is present and adding it if it is not present) on the given element.
... force optional a boolean value to determine whether the attribute should be added or removed, no matter whether the attribute is present or not at the moment.
... exceptions invalidcharactererror the specified attribute name contains one or more characters which are not valid in attribute names.
... html <input value="text"> <button>toggleattribute("readonly")</button> javascript var button = document.queryselector("button"); var input = document.queryselector("input"); button.addeventlistener("click", function(){ input.toggleattribute("readonly"); }); result dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasatt...
Event.bubbles - Web APIs
WebAPIEventbubbles
the bubbles read-only property of the event interface indicates whether the event bubbles up through the dom or not.
... note: see event bubbling and capture for more information on bubbling.
...passes the event along if does not passiton(e); } // already bubbling dooutput(e); } note: only certain events can bubble.
...you can use this property to check if an event is allowed to bubble or not.
Event.cancelable - Web APIs
WebAPIEventcancelable
if the event is not cancelable, then its cancelable property will be false and the event listener cannot stop the event from occurring.
... example for example, browser vendors are proposing that the wheel event can only be canceled the first time the listener is called — any following wheel events cannot be canceled.
... event.preventdefault(); } else { // the event cannot be canceled, so it is not safe // to call preventdefault() on it.
... console.warn(`the following event couldn't be canceled:`); console.dir(event); } } document.addeventlistener('wheel', preventscrollwheel); notes whether an event can be canceled or not is something that's determined when that event is initialized.
Event.composedPath() - Web APIs
this does not include nodes in shadow trees if the shadow root was created with its shadowroot.mode closed.
...ext="i have an open shadow root"></open-shadow> <closed-shadow text="i have a closed shadow root"></closed-shadow> then include a click event listener on the <html> element: document.queryselector('html').addeventlistener('click',function(e) { console.log(e.composed); console.log(e.composedpath()); }); when you click on the <open-shadow> element and then the <closed-shadow> element, you'll notice two things.
...second, you'll notice a difference in the value of composedpath for the two elements.
...tml, htmldocument https://mdn.github.io/web-components-examples/composed-composed-path/, window ] whereas the <closed-shadow> element's composed path is a follows: array [ closed-shadow, body, html, htmldocument https://mdn.github.io/web-components-examples/composed-composed-path/, window ] in the second case, the event listeners only propagate as far as the <closed-shadow> element itself, but not to the nodes inside the shadow boundary.
Event.defaultPrevented - Web APIs
the defaultprevented read-only property of the event interface returns a boolean indicating whether or not the call to event.preventdefault() canceled the event.
... note: you should use this instead of the non-standard, deprecated getpreventdefault() method (see bug 691151).
... syntax var defaultwasprevented = event.defaultprevented; value a boolean, where true indicates that the default user agent action was prevented, and false indicates that it was not.
...ml <p><a id="link1" href="#link1">visit link 1</a></p> <p><a id="link2" href="#link2">try to visit link 2</a> (you can't)</p> <p id="log"></p> javascript function stoplink(event) { event.preventdefault(); } function logclick(event) { const log = document.getelementbyid('log'); if (event.target.tagname === 'a') { if (event.defaultprevented) { log.innertext = 'sorry, but you cannot visit this link!\n' + log.innertext; } else { log.innertext = 'visiting link...\n' + log.innertext; } } } const a = document.getelementbyid('link2'); a.addeventlistener('click', stoplink); document.addeventlistener('click', logclick); result specifications specification status comment domthe definition of 'event.defaultprevented()' in that spe...
Event.msConvertURL() - 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.
... return value this method does not return a value.
... example var bloblist = []; document.getelementbyid("pastezone").addeventlistener('paste', handlepaste, false); function handlepaste(evt) { var filelist = window.clipboarddata.files; // note that window.datatransfer.files is not applicable.
Event.preventDefault() - Web APIs
the event interface's preventdefault() method tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
... as noted below, calling preventdefault() for a non-cancelable event, such as one dispatched via eventtarget.dispatchevent(), without specifying cancelable: true has no effect.
...ion, which looks at the pressed key and decides whether to allow it: function checkname(evt) { var charcode = evt.charcode; if (charcode != 0) { if (charcode < 97 || charcode > 122) { evt.preventdefault(); displaywarning( "please use lowercase letters only." + "\n" + "charcode: " + charcode + "\n" ); } } } the displaywarning() function presents a notification of a problem.
... it's not an elegant function but does the job for the purposes of this example: var warningtimeout; var warningbox = document.createelement("div"); warningbox.classname = "warning"; function displaywarning(msg) { warningbox.innerhtml = msg; if (document.body.contains(warningbox)) { window.cleartimeout(warningtimeout); } else { // insert warningbox after mytextbox mytextbox.parentnode.insertbefore(warningbox, mytextbox.nextsibling); } warningtimeout = window.settimeout(function() { warningbox.parentnode.removechild(warningbox); warningtimeout = -1; }, 2000); } result notes calling preventdefault() during any stage of event flow cancels the event, meaning that any default action normally taken by the implementation as a result of the event will no...
Event.returnValue - Web APIs
WebAPIEventreturnValue
the event property returnvalue indicates whether the default action for this event has been prevented or not.
... note: while returnvalue has been adopted into the dom standard, it is present primarily to support existing code.
... syntax event.returnvalue = bool; var bool = event.returnvalue; value a boolean value which is true if the event has not been canceled; otherwise, if the event has been canceled or the default has been prevented, the value is false.
... usage notes returnvalue was introduced into the dom by internet explorer 6, and due to that browser's ubiquity became so commonly used that other browsers eventually implemented it as well.
FetchEvent() - Web APIs
isreload read only a boolean that signifies whether the page was reloaded or not when the event was dispatched.
... true if yes, and false if not.
... typically, pressing the refresh button in a browser is a reload, while clicking a link and pressing the back button is not.
... if not present, it defaults to false.
File.getAsBinary() - Web APIs
WebAPIFilegetAsBinary
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.
... note: this method is obsolete; you should use the filereader method readasbinarystring() or readasarraybuffer() instead.
...s[i]; // if file type could be detected if (file !== null) { if (accept.binary.indexof(file.type) > -1) { // file is a binary, which we accept var data = file.getasbinary(); } else if (accept.text.indexof(file.type) > -1) { // file is of type text, which we accept var data = file.getastext(); // modify data with string methods } } } specification not part of any specification.
FileReader - Web APIs
important note: filereader is used to read file content from the user's (remote) system in secure ways only.
... it cannot be used to simply read a file by pathname from a file system.
... note: this feature is available in web workers.
... loadend fired when a read has completed, successfully or not.
FileReaderSync - Web APIs
properties this interface does not have any properties.
...if not present, the method will apply a detection algorithm for it.
...not for use in new websites.deprecated.
... not for use in new websites.
FileSystem - Web APIs
this interface will not grant you access to the users filesystem.
...ariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemchrome full support 7alternate name full support 7alternate name alternate name uses the non-standard name: domfilesystemedge full support ≤18prefixed notes full support ≤18prefixed notes prefixed implemented with the vendor prefix: webkitnotes edge only supports this api in drag-and-drop scenarios using the the datatransferitem.webkitgetasentry() method.
... it's not available for use in file or folder picker panels (such as when you use an <input> element with the htmlinputelement.webkitdirectory attribute.firefox full support 50ie no support noopera full support 15prefixed full support 15prefixed prefixed implemented with the vendor prefix: webkitsafari full support 11.1webview android full support ≤37alternate name full support ≤37alternate name alternate name uses the non-standard name: domfilesystemchrome android ...
... 14safari ios full support 11.3samsung internet android full support 1.0legend full support full support no support no supportsee implementation notes.see implementation notes.uses a non-standard name.uses a non-standard name.requires a vendor prefix or different name for use.requires a vendor prefix or different name for use.
FileSystemEntry.remove() - Web APIs
fileerror.invalid_state_err the file system's cached state is inconsistent with its state on disk, so the file could not be deleted for safety reasons.
... fileerror.not_found_err the file or directory doesn't exist.
...not for use in new websites.deprecated.
... not for use in new websites.
FileSystemEntry - Web APIs
because this is a non-standard api, whose specification is not currently on a standards track, it's important to keep in mind that not all browsers implement it, and those that do may implement only small portions of it.
...if it's not a file, this value is false.
...not for use in new websites.deprecated.
... not for use in new websites.uses a non-standard name.uses a non-standard name.requires a vendor prefix or different name for use.requires a vendor prefix or different name for use.
FileSystemFileEntry.createWriter() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcreatewriter deprecatednon-standardchrome full support 8edge full support 79firefox no support 50 — 52notes no support 50 — 52notes notes while the createwriter() method existed, it immediately called errorcallback with the ns_error_dom_security_err error.ie no support noopera no support nosafari no support nowebview android ...
... full support ≤37chrome android full support 18firefox android no support 50 — 52notes no support 50 — 52notes notes while the createwriter() method existed, it immediately called errorcallback with the ns_error_dom_security_err error.opera android no support nosafari ios no support nosamsung internet android full support yeslegend full support full support no support no supportnon-standard.
...not for use in new websites.deprecated.
... not for use in new websites.see implementation notes.see implementation notes.
FileSystemFileEntry - Web APIs
full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitcreatewriter deprecatednon-standardchrome full support 8edge full support 79firefox no support 50 — 52notes no support 50 — 52notes notes while the createwriter() method existed, it immediately called errorcallback with the ns_error_dom_security_err error.ie no support noopera no support nosafari no support nowebview android ...
... full support ≤37chrome android full support 18firefox android no support 50 — 52notes no support 50 — 52notes notes while the createwriter() method existed, it immediately called errorcallback with the ns_error_dom_security_err error.opera android no support nosafari ios no support nosamsung internet android full support yesfilechrome full support 8edge full support 79firefox full support 50ie ...
...not for use in new websites.deprecated.
... not for use in new websites.see implementation notes.see implementation notes.uses a non-standard name.uses a non-standard name.requires a vendor prefix or different name for use.requires a vendor prefix or different name for use.
GainNode() - Web APIs
WebAPIGainNodeGainNode
note: you should typically call audiocontext.creategain() to create a gain node.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgainnode() constructorchrome full support 55notes full support 55notes notes before chrome 59, the default values were not supported.edge full support ≤79firefox full support 53ie no support noopera full support 42safar...
... webview android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.chrome android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ?
... samsung internet android full support 6.0notes full support 6.0notes notes before samsung internet 7.0, the default values were not supported.legend full support full support no support no support compatibility unknown compatibility unknownsee implementation notes.see implementation notes.
Using the Geolocation API - Web APIs
you can test for the presence of geolocation thusly: if('geolocation' in navigator) { /* geolocation is available */ } else { /* geolocation is not available */ } getting the current position to obtain the user's current location, you can call the getcurrentposition() method.
... note: by default, getcurrentposition() tries to answer as fast as possible with a low accuracy result.
... note: you can use watchposition() without an initial getcurrentposition() call.
...longitude = 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 ...
HTMLAnchorElement - Web APIs
this interface corresponds to <a> element; not to be confused with <link>, which is represented by htmllinkelement) <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2p...
...if the name is not a valid filename of the underlying os, browser will adapt it.
... htmlhyperlinkelementutils.host is a usvstring representing the hostname and port (if it's not the default port) in the referenced url.
... note: currently the w3c html 5.2 spec states that rev is no longer obsolete, whereas the whatwg living standard still has it labeled obsolete.
HTMLCanvasElement.toBlob() - Web APIs
if type is not specified, the image type is image/png.
... 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.
... var canvas = document.getelementbyid('canvas'); canvas.toblob(function(blob) { var newimg = document.createelement('img'), url = url.createobjecturl(blob); newimg.onload = function() { // no longer need to read the blob so it's revoked url.revokeobjecturl(url); }; newimg.src = url; document.body.appendchild(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.
...ck'; a.download = iconname + '.ico'; a.href = window.url.createobjecturl(b); } } canvas.toblob(blobcallback('passthisstring'), 'image/vnd.microsoft.icon', '-moz-parse-options:format=bmp;bpp=32'); save toblob to disk with os.file (chrome/add-on context only) this technique saves it to the desktop and is only useful in firefox chrome context or add-on code as os apis are not present on web sites.
HTMLCollection.item - Web APIs
note: because the contents of an htmlcollection are live, changes to the underlying dom can and will cause the position of individual nodes in the collection to change, so the index value will not necessarily remain constant for a given node.
... usage notes the item() method returns a numbered element from an htmlcollection.
... in javascript, it is easier to treat the htmlcollection as an array and to index it using array notation.
... example var c = document.images; // this is an htmlcollection var img0 = c.item(0); // you can use the item() method this way var img1 = c[1]; // but this notation is easier and more common ...
HTMLCollection - Web APIs
note: this interface is called htmlcollection for historical reasons (before the modern dom, collections implementing this interface could only have html elements as their items).
... an alternative to accessing collection[name] (which instead returns undefined when name does not exist).
...as valid characters, which would necessitate using bracket notation for property access.
... currently htmlcollections does not recognize purely numeric ids, which would cause conflict with the array-style access, though html5 does permit these.
HTMLElement.innerText - Web APIs
note: innertext is easily confused with node.textcontent, but there are important differences between the two.
... basically, innertext is aware of the rendered appearance of text, while textcontent is not.
...if the element itself is not being rendered (e.g detached from the document or is hidden from view), the returned value is the same as the node.textcontent property.
...note how innertext is aware of things like <br> elements, and ignores hidden elements.
HTMLElement - Web APIs
htmlelement.iscontenteditable read only returns a boolean that indicates whether or not the content of the element can be edited.
... htmlelement.hidden is a boolean indicating if the element is hidden or not.
... invalid fired when an element does not satisfy its constraints during constraint validation.
...unlike the input event, the change event is not necessarily fired for each alteration to an element's value.
HTMLImageElement.complete - Web APIs
the read-only htmlimageelement interface's complete attribute is a boolean value which indicates whether or not the image has completely loaded.
... it's worth noting that due to the image potentially being received asynchronously, the value of complete may change while your script is running.
...efoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcompletechrome full support 1edge full support 12firefox full support yesie full support 8notes full support 8notes notes ie reports false for broken images.opera full support yessafari full support yeswebview android full support yeschrome android full support yesfi...
... safari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown compatibility unknownsee implementation notes.see implementation notes.
HTMLKeygenElement - Web APIs
note: this page describes the keygen element interface as specified, not as currently implemented by gecko.
... validationmessage read only is a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any).
... this is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints.
...if this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.
HTMLMediaElement.currentTime - Web APIs
if the media is not yet playing, the value of currenttime indicates the time position within the media at which playback will begin once the play() method is called.
... for media without a known duration—such as media being streamed live—it's possible that the browser may not be able to obtain parts of the media that have expired from the media buffer.
... also, media whose timeline doesn't begin at 0 seconds cannot be seeked to a time before its timeline's earliest time.
... example var video = document.createelement('video'); console.log(video.currenttime); usage notes reduced time precision to offer protection against timing attacks and fingerprinting, browsers may round or otherwise adjust the value returned by currenttime.
HTMLObjectElement - Web APIs
htmlobjectelement.declare is a boolean that reflects the declare html attribute, indicating that this is a declaration, not an instantiation, of the object.
... htmlobjectelement.validationmessage read only returns a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any).
... this is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints.
...if this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.
HTMLOrForeignElement.dataset - Web APIs
note that the dataset property itself can be read, but not directly written.
...note also that an html data-attribute and its corresponding dom dataset.property do not share the same name, but they are always similar: in html, the name of a custom data attribute begins with data-.
... it must contain only letters, numbers, and the following characters: dash (-), dot (.), colon (:), underscore (_)—but not any ascii capital letters (a to z).
... camelcase to dash-style conversion the opposite transformation, which maps a key to an attribute name, uses the following rules: restriction: before the transformation, a dash must not be immediately followed by an ascii lowercase letter a to z; the prefix data- is added; any ascii uppercase letter a to z is transformed into a dash, followed by its lowercase counterpart; other characters are left unchanged.
HTMLOutputElement - Web APIs
htmloutputelement.validationmessageread only a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any).
... this is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints.
...if the element is not rendered, then the user agent may report the error for the running script instead of notifying the user.
...if this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.
HTMLTrackElement - Web APIs
htmltrackelement.default a boolean reflecting the default attribute, indicating that the track is to be enabled if the user's preferences do not indicate that another track would be more appropriate.
... htmltrackelement.readystate read only returns an unsigned short that show the readiness state of the track: constant value description none 0 indicates that the text track's cues have not been obtained.
...some or all of the cues are likely missing and will not be obtained.
... usage notes loading of the track's text resource the webvtt or ttml data describing the actual cues for the text track isn't loaded if the track's mode is initially in the disabled state.
File drag and drop - Web APIs
note: html drag and drop defines two different apis to support dragging and dropping files.
...this example illustrates the use of both apis (and does not use any gecko specific interfaces).
...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.
... note that in this example, any drag item that is not a file is ignored.
Headers.set() - Web APIs
WebAPIHeadersset
the set() method of the headers interface sets a new value for an existing header inside a headers object, or adds the header if it does not already exist.
...if the given name is not the name of an http header, this method throws a typeerror.
... example creating an empty headers object is simple: var myheaders = new headers(); // currently empty you could add a header to this using headers.append, then set a new value for this header using set(): myheaders.append('content-type', 'image/jpeg'); myheaders.set('content-type', 'text/html'); if the specified header does not already exist, set() will create it and set its value to the specified value.
... if the specified header does already exist and does accept multiple values, set() will overwrite the existing value with the new one: myheaders.set('accept-encoding', 'deflate'); myheaders.set('accept-encoding', 'gzip'); myheaders.get('accept-encoding'); // returns 'gzip' you'd need headers.append to append the new value onto the values, not overwrite it.
History.pushState() - Web APIs
WebAPIHistorypushState
note that the browser won't attempt to load this url after a call to pushstate(), but it might attempt to load the url later, for instance after the user restarts the browser.
... the new url does not need to be absolute; if it's relative, it's resolved relative to the current url.
... description in a sense, calling pushstate() is similar to setting window.location = "#foo", in that both will also create and activate another history entry associated with the current document.
... note that pushstate() never causes a hashchange event to be fired, even if the new url differs from the old url only in its hash.
IDBCursor.continue() - Web APIs
note: this feature is available in web workers.
... dataerror the key parameter may have any of the following conditions: the key is not a valid key.
...the cursor does not require us to select the data based on a key; we can just grab all of it.
... also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo.
IDBCursor.direction - Web APIs
note: this feature is available in web workers.
...within each iteration we log the direction of the cursor, something like this: prev note: we can't change the direction of travel of the cursor using the direction property, as it is read-only.
... the cursor does not require us to select the data based on a key; we can just grab all of it.
... also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo.
IDBCursor.source - Web APIs
WebAPIIDBCursorsource
this function never returns null or throws an exception, even if the cursor is currently being iterated, has iterated past its end, or its transaction is not active.
... note: this feature is available in web workers.
...within each iteration we log the source of the cursor, which will log our idbobjectstore object to the console, something like this: idbobjectstore {autoincrement: false, transaction: idbtransaction, indexnames: domstringlist, keypath: "albumtitle", name: "rushalbumlist"…} the cursor does not require us to select the data based on a key; we can just grab all of it.
... also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo.
IDBDatabase.onerror - Web APIs
note: consider using idbopendbrequest.onsuccess instead (see idbrequest.onsuccess, where it is inherited from).
... note: this feature is available in web workers.
... dbopenrequest.onupgradeneeded = function(event) { var db = this.result; db.onerror = function(event) { note.innerhtml += '<li>error opening database.</li>'; }; db.onabort = function(event) { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes"...
..., { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); note.innerhtml += '<li>object store created.</li>'; }; specifications specification status comment indexed database api 2.0the definition of 'onerror' in that specification.
IDBDatabaseSync - Web APIs
if a null path is specified, then the object store does not have a key path, and uses out-of-line keys.
... autoincrement if true, the object store uses a key generator; if false, it does not use one.
... exceptions this method can raise an idbdatabaseexception with the following code: not_found_err if an object store with the given name (based on case-sensitive comparison) already exists in the connected database.
... returns void exceptions this method can raise an idbdatabaseexception with the following code: not_found_err if the object store with the given name (based on case-sensitive comparison) does not exist in the connected database.
IDBFactory.cmp() - Web APIs
WebAPIIDBFactorycmp
note: this feature is available in web workers.
... note: do not use this method for comparing arbitrary javascript values, because many javascript values are either not valid indexeddb keys (booleans and objects, for example) or are treated as equivalent indexeddb keys (for example, since indexeddb ignores arrays with non-numeric properties and treats them as empty arrays, so any non-numeric arrays are treated as equivalent).
... this throws an exception if either of the values is not a valid key.
...low lists the possible values and their meanings: returned value description -1 1st key is less than the 2nd key 0 1st key is equal to the 2nd key 1 1st key is greater than the 2nd key exceptions this method may raise a domexception of the following types: attribute description dataerror one of the supplied keys was not a valid key.
IDBIndex.name - Web APIs
WebAPIIDBIndexname
note: this feature is available in web workers.
... invalidstateerror the index, or its object store, has been deleted; or the current transaction is not an upgrade transaction.
... transactioninactiveerror the current transaction is not active.
...we then open a basic cursor on the index using idbindex.opencursor() — this works the same as opening a cursor directly on an idbobjectstore using opencursor() except that the returned records are sorted based on the index, not the primary key.
IDBIndex.openCursor() - Web APIs
if the key range is not specified or is null, then the range includes all the records.
... note: this feature is available in web workers.
...if nothing is passed, this will default to a key range that selects all the records in this object store.
...we then open a basic cursor on the index using opencursor() — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key.
IDBIndex.unique - Web APIs
WebAPIIDBIndexunique
this method takes an optional parameter, unique, which if set to true means that the index will not be able to accept duplicate entries.
... note: this feature is available in web workers.
... syntax var isunique = idbindex.unique; value a boolean: value effect true the current index does not allow duplicate values for a key.
...we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key.
IDBKeyRange.bound() - Web APIs
WebAPIIDBKeyRangebound
note: this feature is available in web workers.
... exceptions this method may raise a domexception of the following type: exception description dataerror the following conditions raise an exception: the lower or upper parameters were not passed a valid key.
...if we used idbkeyrange.bound("a", "f", true, true);, then the range would not include "a" and "f", only the values between them.
... note: for a more complete example allowing you to experiment with key range, have a look at the idbkeyrange directory in the indexeddb-examples repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("a", "f"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; ...
IDBKeyRange.lowerBound() - Web APIs
note: this feature is available in web workers.
... exceptions this method may raise a domexception of the following type: exception description dataerror the value parameter passed was not a valid key.
...if we used idbkeyrange.lowerbound("f", true);, then the range would not include "f"; only the values after it.
... note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.lowerbound("f"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification ...
IDBKeyRange.lowerOpen - Web APIs
note: this feature is available in web workers.
... syntax var loweropen = mykeyrange.loweropen value a boolean: value indication true the lower-bound value is not included in the key range.
...here we declare keyrangevalue = idbkeyrange.upperbound("f", "w", true, true); — a range that includes everything between "f" and "w" but not including them — since both the upper and lower bounds have been declared as open (true).
... note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.loweropen); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = f...
IDBKeyRange.upperOpen - Web APIs
note: this feature is available in web workers.
... syntax var upperopen = mykeyrange.upperopen value a boolean: value indication true the upper-bound value is not included in the key range.
...here we declare keyrangevalue = idbkeyrange.upperbound("f", "w", true, true); — a range that includes everything between "f" and "w" but not including them — since both the upper and lower bounds have been declared as open (true).
... note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.upperopen); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = f...
IDBMutableFile - 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.
... note: this interface used to be called filehandle , but it was changed to this (bug 1006485.) as idbmutablefile objects are bound to a fake file system built on top of indexeddb, such an object is created using the idbdatabase.createmutablefile method.
... specifications not part of any specification at present.
IDBObjectStore.clear() - Web APIs
note: this feature is available in web workers.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...is used a lot below db = dbopenrequest.result; // clear all the data form the object store cleardata(); }; function cleardata() { // open a read/write db transaction, ready for clearing the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // make a request to clear all the data out of the object store var objectstorerequest = o...
...bjectstore.clear(); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the definition of 'clear()' in that specification.
IDBObjectStore.indexNames - Web APIs
note: this feature is available in web workers.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... // this is used a lot below db = this.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error.
... duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); console.log(objectstore.indexnames); // make a request to add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the definition of 'indexnames' in that specification.
IDBObjectStore.keyPath - Web APIs
note: this feature is available in web workers.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error.
... duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); console.log(objectstore.keypath); // make a request to add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the definition of 'keypath' in that specification.
IDBObjectStore.transaction - Web APIs
note: this feature is available in web workers.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error.
... duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); console.log(objectstore.transaction); // make a request to add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the definition of 'transaction' in that specification.
IDBOpenDBRequest.onblocked - Web APIs
this event is triggered when the upgradeneeded should be triggered because of a version change but the database is still in use (that is, not closed) somewhere, even after the versionchange event was sent.
... note: this feature is available in web workers.
...}; example var db; // let us open our database var request = indexeddb.open("todolist", 4); // these two event handlers act on the database being opened // successfully, or not request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...either one has not been created // before, or a new version number has been submitted via the // window.indexeddb.open line above //it is only implemented 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" }); ...
IDBRequest.error - Web APIs
WebAPIIDBRequesterror
note: this feature is available in web workers.
...for example, if the the request failed and the result is not available, the invalidstateerror exception is thrown.
...for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the do-do list with the specified title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objec...
...tstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; objectstoretitlerequest.onerror = function() { // if an error occurs with the request, log what it is console.log("there has been an error with retrieving your data: " + objectstoretitlerequest.error); }; specifications specification status comment indexed database api 2.0the definition of 'error' in that specification.
IDBRequest.result - Web APIs
WebAPIIDBRequestresult
if the request failed and the result is not available, an invalidstateerror exception is thrown.
... note: this feature is available in web workers.
...for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequ...
...est.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment indexed database api 2.0the definition of 'result' in that specification.
IDBRequest.transaction - Web APIs
this property can be null for requests not made within transactions, such as for requests returned from idbfactory.open — in this case you're just connecting to a database, so there is no transaction to return.
... note: this feature is available in web workers.
... example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request.
...for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back // into the database var updatetitlerequest = objectstore.put(data...
IDBRequest - Web APIs
the request object does not initially contain any information about the result of the operation, but once information becomes available, an event is fired on the request, and the information becomes available through the properties of the idbrequest instance.
... note: this feature is available in web workers.
...if the the request failed and the result is not available, an invalidstateerror exception is thrown.
...for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being // opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database in...
IDBVersionChangeEvent.newVersion - Web APIs
note: this feature is available in web workers.
...for a full working example, see our to-do notifications app (view example live.) var note = document.queryselector("ul"); // in the following line, you should include the prefixes of // implementations you want to test.
... window.indexeddb = window.indexeddb || window.mozindexeddb || window.webkitindexeddb || window.msindexeddb; // don't use "var indexeddb = ..." if you're not in a function.
...msidbtransaction; window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange || window.msidbkeyrange; // (mozilla has never prefixed these objects, // so we don't need window.mozidb*) // let us open version 4 of our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBVersionChangeEvent - Web APIs
note: this feature is available in web workers.
...for a full working example, see our to-do notifications app (view example live.) var note = document.queryselector("ul"); // in the following line, you should include the prefixes of implementations you want to test.
... window.indexeddb = window.indexeddb || window.mozindexeddb || window.webkitindexeddb || window.msindexeddb; // don't use "var indexeddb = ..." if you're not in a function.
...webkitidbtransaction || window.msidbtransaction; window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange || window.msidbkeyrange; // (mozilla has never prefixed these objects, so we don't need window.mozidb*) // let us open version 4 of our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IIRFilterNode() - Web APIs
unlike other nodes in the web audio api, the options passed into the iir filter upon creation are not optional.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetiirfilternode() constructorchrome full support 55notes full support 55notes notes before version 59, the default values were not supported.edge full support ≤79firefox full support 53ie no support noopera full support 42safa...
... webview android full support 55notes full support 55notes notes before version 59, the default values were not supported.chrome android full support 55notes full support 55notes notes before version 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ?
... samsung internet android full support 6.0notes full support 6.0notes notes before samsung internet 7.0, the default values were not supported.legend full support full support no support no support compatibility unknown compatibility unknownsee implementation notes.see implementation notes.
compareVersion - Web APIs
note that the registry pathname is not the location of the software on the computer; it is the location of information about the software inside the client version registry.
... returns if the versions are the same or if software installation is not enabled, this method returns 0.
...in particular, this method returns one of the following values: -5 component not present or not registered.
...if registryname is not found in the client version registry or if registryname does not have version, registryname is assumed to have a version of 0.0.0.0.
InstallTrigger - 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.
... note: this article needs to be updated somewhat.
... enabled indicates whether or not software installation is enabled for this client machine.
IntersectionObserver - Web APIs
the configuration cannot be changed once the intersectionobserver is created, so a given observer object is only useful for watching for specific changes in degree of visibility; however, you can watch multiple target elements with the same observer.
...the value returned by this property may not be the same as the one specified when calling the constructor as it may be changed to match internal requirements.
...notifications for a target are generated when any of the thresholds are crossed for that target.
... examples var intersectionobserver = new intersectionobserver(function(entries) { // if intersectionratio is 0, the target is out of view // and we do not need to do anything.
KeyboardEvent.charCode - Web APIs
do not use this property, as it is deprecated.
... example html <p>type anything into the input box below to log a <code>charcode</code>.</p> <input type="text" /> <p id="log"></p> javascript let input = document.queryselector('input'); let log = document.queryselector('#log'); input.addeventlistener('keypress', function(e) { log.innertext = `key pressed: ${string.fromcharcode(e.charcode)}\ncharcode: ${e.charcode}`; }); result notes in a keypress event, the unicode value of the key pressed is stored in either the keycode or charcode property, but never both.
... characters entered through an ime do not register through keycode or charcode.
...i'm not sure if other ime's work this way.
KeyboardEvent.initKeyEvent() - 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.
... do not use this method anymore, use the keyboardevent() constructor instead.
... bubbles is a boolean indicating whether the event should bubble up through the event chain or not (see bubbles).
LargestContentfulPaint - Web APIs
may not be available if the element is a cross-origin image loaded without the timing-allow-origin header.
... note that in this example data is only sent to the server when the user leaves the tab.
...(note: `rendertime` may not be available on // image elements loaded cross-origin without the `timing-allow-origin` header.) lcp = lastentry.rendertime || 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.
LocalFileSystemSync - Web APIs
exceptions this method can raise an fileexception with the following code: exception description security_error the application does not have permission to access the file system interface.
... for example, you cannot run from file://.
... not_found_err the url was structurally correct, but refers to a resource that does not exist.
... security_err the application does not have permission to access the file system interface.
LockedFile.getMetadata() - 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.
...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.
MSGestureEvent - Web APIs
if the event has already being dispatched, this method does nothing.
... gesture event types msgesturestart msgestureend msgesturetap msgesturehold msgesturechange msinertiastart specifications not part of any specification.
... nochrome android no support nofirefox android no support noopera android no support nosafari ios no support nosamsung internet android no support notranslationx non-standardchrome no support noedge no support 12 — 79firefox no support noie full support 10opera no support nosafari no support nowe...
... nochrome android no support nofirefox android no support noopera android no support nosafari ios no support nosamsung internet android no support notranslationy non-standardchrome no support noedge no support 12 — 79firefox no support noie full support 10opera no support nosafari no support nowe...
MediaCapabilities.decodingInfo() - Web APIs
return value a promise fulfilling with a mediacapabilitiesinfo interface containing three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaconfiguration passed to the decodinginfo() method is invalid, either because the type is not video or audio, the contenttype is not a valid codec mime type, the media decoding configuration is not a valid value for the media decoding type, or any other error in the media configuration passed to the method, including omitting values required in the media decoding configuration.
...'' : 'not ') + 'supported, ' + (result.smooth ?
... '' : 'not ') + 'smooth, and ' + (result.powerefficient ?
... '' : 'not ') + 'power efficient.') }); specifications specification status comment media capabilitiesthe definition of 'decodinginfo()' in that specification.
MediaCapabilities.encodingInfo() - Web APIs
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.
...'' : 'not ') + 'supported, ' + (result.smooth ?
... '' : 'not ') + 'smooth, and ' + (result.powerefficient ?
... '' : 'not ') + 'power efficient.') }); specifications specification status comment media capabilitiesthe definition of 'encodinginfo()' in that specification.
MediaDeviceInfo.deviceId - Web APIs
for private browsing, a different identifier is used that is not persisted across sessions.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdeviceidchrome full support 55notes full support 55notes notes for earlier versions, this interface is available through the 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 support nowebview android full support 55notes full support 55notes notes for earlier versions, this interface is available through the adapter.js polyfillchrome android full support 55notes full support 55notes notes for earlier versions, this interface is available through the adapter.js polyfillfirefox android full support 39opera android n...
...o support nonotes no support nonotes notes this property can be used in opera by using the adapter.js polyfill.safari ios no support nosamsung internet android full support 6.0notes full support 6.0notes notes for earlier versions, this interface is available through the adapter.js polyfilllegend full support full support no support no supportsee implementation notes.see implementation notes.
MediaRecorder.onerror - Web APIs
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.
...am) { let recorder = null; let bufferlist = []; try { recorder = new mediarecorder(stream); } catch(err) { return err.name; /* return the error name */ } recorder.ondataavailable = function(event) { bufferlist.push(event.data); }; recorder.onerror = function(event) { let error = event.error; switch(error.name) { case invalidstateerror: shownotification("you can't record the video right " + "now.
... try again later."); break; case securityerror: shownotification("recording the specified source " + "is not allowed due to security " + "restrictions."); break; default: shownotification("a problem occurred while trying " + "to record the video."); break; } }; /* this would be a good place to create a worker to handle writing the buffers to disk periodically */ recorder.start(100); /* 100ms time slices per buffer */ return recorder; } specifications specification status comment mediastream recordingthe definition of 'mediarecorder.onerror' in that specification.
MediaStreamTrack.enabled - Web APIs
the enabled property on the mediastreamtrack interface is a boolean value which is true if the track is allowed to render the source stream or false if it is not.
... note: if the track has been disconnected, the value of this property can be changed, but has no effect.
... note: when implementing a mute/unmute feature, you should use the enabled property.
... usage notes if the mediastreamtrack represents the video input from a camera, disabling the track by setting enabled to false also updates device activity indicators to show that the camera is not currently recording or streaming.
Recording a media element - Web APIs
note that the autoplay attribute is used so that as soon as the stream starts to arrive from the camera, it immediately gets displayed, and the muted attribute is specified to ensure that the sound from the user's microphone isn't output to their speakers, causing an ugly feedback loop.
...notice that the playback panel doesn't have autoplay set (so the playback doesn't start as soon as media arrives), and it has controls set, which tells it to show the user controls to play, pause, and so forth.
...not very pretty but it gets the job done for our purposes.
... result when put all together with the rest of the html and the css not shown above, it looks and works like this: you can take a look at all the code, including the parts hidden above because they aren't critical to the explanation of how the apis are being used.
MediaTrackConstraints.displaySurface - Web APIs
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().
...this value does not affect the list of display sources in the browser's user interface.
... usage notes you can check the setting selected by the user agent after the display media has been created by getdisplaymedia() by calling getsettings() on the display media's video mediastreamtrack, then checking the value of the returned mediatracksettings object's displaysurface object.
...later code can use this flag to determine whether or not to perform special processing, such as to remove or replace the backdrop, or to "cut" the individual display areas out of the received frames of video.
MediaTrackConstraints.logicalSurface - Web APIs
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().
... usage notes you can check the setting selected by the user agent after the display media has been created by getdisplaymedia() by calling getsettings() on the display media's video mediastreamtrack, then checking the value of the returned mediatracksettings object's logicalsurface object.
... for example, if your app needs to know if the selected display surface is a logical one: let islogicalsurface = displaystream.getvideotracks()[0].getsettings().logicalsurface; following this code, islogicalsurface is true if the display surface contained in the stream is a logical surface; that is, one which may not be entirely onscreen, or may even be entirely offscreen.
MediaTrackSupportedConstraints.autoGainControl - Web APIs
if the constraint isn't supported, it's not included in the list, so this value will never be false.
... 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.
... 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.
MediaTrackSupportedConstraints.noiseSuppression - Web APIs
if the constraint isn't supported, it's not included in the list, so this value will never be false.
... 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.
... 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.
MouseEvent.button - Web APIs
WebAPIMouseEventbutton
as such, it is not reliable for events such as mouseenter, mouseleave, mouseover, mouseout or mousemove.
... users may change the configuration of buttons on their pointing device so that if an event's button property is zero, it may not have been caused by the button that is physically left–most on the pointing device; however, it should behave as if the left button was clicked in the standard button layout.
... note: do not confuse this property with the mouseevent.buttons property, which indicates which buttons are pressed for all mouse events types.
...nt.button return value a number representing a given button: 0: main button pressed, usually the left button or the un-initialized state 1: auxiliary button pressed, usually the wheel button or the middle button (if present) 2: secondary button pressed, usually the right button 3: fourth button, typically the browser back button 4: fifth button, typically the browser forward button as noted above, buttons may be configured differently to the standard "left to right" layout.
msFirstPaint - 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.
... put another way, msfirstpaint utilizes the browser to measure when the first content completes being painted in the window.
... 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.
msRealTime - 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.
... msrealtime is a read/write property which specifies whether or not to enable low-latency playback on the media element.
... msrealtime should not be used in non-real-time or non-communication scenarios, such as audio and/or video playback, as this can affects playback startup latency of audio and video playback.
MutationEvent - Web APIs
note: mutation events (w3c dom level 3 events) have been deprecated in favor of mutation observers (w3c dom4).
...moreover, removing the listeners does not reverse the damage.
... 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 domattributenamechanged are not supported in firefox (as of version 11), and probably in other browsers as well.
MutationObserverInit.characterData - Web APIs
the mutationobserverinit dictionary's optional characterdata property is used to specify whether or not to monitor the node or nodes being observed for changes to their textual contents.
... note that this doesn't monitor content of an htmlelement, even if it only contains text inside, as it only monitors text nodes themselves.
... syntax var options = { characterdata: true | false } value a boolean value indicating whether or not to call the observer's callback function when textual nodes' values change.
... you can expand the capabilities of attribute mutation monitoring using other options: characterdataoldvalue lets you specify whether or not you want the previous value of changed text nodes to be provided using the mutationrecord's oldvalue property.
Navigator.mozIsLocallyAvailable() - Web APIs
the navigator.mozislocallyavailable() method allows add-ons to determine whether or not a given resource is available.
... note: security exceptions can occur if the requested uri is not from the same origin.
... ifoffline allows you to specify whether or not the offline resources cache should be checked; specify true to consider the offline resources cache.
... example var available = navigator.mozislocallyavailable("my-image-file.png", true); if (available) { /* the offline resource is present */ } else { console.log("certain needed resources are not available offline"); } specifications not part of any specifications.
Online and offline events - Web APIs
according to the specification: the navigator.online attribute must return false if the user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail)...
...(note: using window.ononline or window.onoffline will not work for compatibility reasons.) by specifying ononline="..." or onoffline="..." attributes on the <body> tag in the html markup.
... example there's a simple test case that you can run to verify that the events are working (does not work in chrome due to attaching the event listener to document.body).
...ans-serif; color: #fff; padding: 0.5em; } #log { padding: 2.5em 0.5em 0.5em; font: 1em sans-serif; } .online { background: green; } .offline { background: red; } and the corresponding htmlxxx when mochitests for this are created, point to those instead and update this example -nickolay <div id="status"></div> <div id="log"></div> <p>this is a test</p> here's the live result notes if the api isn't implemented in the browser, you can use other signals to detect if you are offline including using service workers and responses from xmlhttprequest.
NavigatorPlugins.plugins - Web APIs
this privacy change does not disable any plugins; it just hides some plugin names from enumeration.
... 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.
... function getflashversion() { var flash = navigator.plugins.nameditem('shockwave flash'); if (typeof flash != 'object') { // flash is not present return undefined; } if(flash.version){ return flash.version; } else { //no version property (e.g.
...ntbyid('plugintable'); for(var i = 0; i < pluginslength; i++) { let newrow = table.insertrow(); newrow.insertcell().textcontent = navigator.plugins[i].name; newrow.insertcell().textcontent = navigator.plugins[i].filename; newrow.insertcell().textcontent = navigator.plugins[i].description; newrow.insertcell().textcontent = navigator.plugins[i].version?navigator.plugins[i].version:""; } notes the plugin object exposes a small interface for getting information about the various plugins installed in your browser.
Network Information API - Web APIs
note: this feature is available in web workers.
...this example would be called soon after page load to check for a connection type where preloading a video may not be desirable.
... let preloadvideo = true; var connection = navigator.connection || navigator.mozconnection || navigator.webkitconnection; if (connection) { if (connection.effectivetype === 'slow-2g') { preloadvideo = false; } } interfaces networkinformation provides information about the connection a device is using to communicate with the network and provides a means for scripts to be notified if the connection type changes.
... the networkinformation interfaces cannot be instantiated.
Node.nodeType - Web APIs
WebAPINodenodeType
deprecated node type constants the following constants have been deprecated and should not be used anymore.
... node.notation_node 12 an xml <!notation …> node.
...ocument_type_node; // true document.createdocumentfragment().nodetype === node.document_fragment_node; // true var p = document.createelement("p"); p.textcontent = "once upon a time…"; p.nodetype === node.element_node; // true p.firstchild.nodetype === node.text_node; // true comments this example checks if the first node inside the document element is a comment, and displays a message if not.
... living standard deprecated attribute_node, entity_reference_node and notation_node types.
NodeFilter - Web APIs
a nodefilter knows nothing about the document or traversing nodes; it only knows how to evaluate a single node against the provided filter.
... note: the browser doesn't provide any object implementing this interface.
... nodefilter.acceptnode() returns an unsigned short that will be used to tell if a given node must be accepted or not by the nodeiterator or treewalker iteration algorithm.
...this is treated as "skip this node but not its children".
NodeList - Web APIs
WebAPINodeList
although nodelist is not an array, it is possible to iterate over it with foreach().
... however, some older browsers have not implemented nodelist.foreach() nor array.from().
... for example, node.childnodes is live: const parent = document.getelementbyid('parent'); let child_nodes = parent.childnodes; console.log(child_nodes.length); // let's assume "2" parent.appendchild(document.createelement('div')); console.log(child_nodes.length); // outputs "3" static nodelists in other cases, the nodelist is static, where any changes in the dom does not affect the content of the collection.
...also, for..in is not guaranteed to visit the properties in any particular order.
OfflineAudioCompletionEvent.OfflineAudioCompletionEvent() - Web APIs
note: you wouldn't generally use the constructor manually.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetofflineaudiocompletionevent() constructorchrome full support 57notes full support 57notes notes before chrome 59, the default values were not supported.edge full support ≤79firefox full support 53ie no support noopera full support 42safar...
... webview android full support 57notes full support 57notes notes before version 59, the default values were not supported.chrome android full support 57notes full support 57notes notes before chrome 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ?
... samsung internet android full support 6.0notes full support 6.0notes notes before samsung internet 7.0, the default values were not supported.legend full support full support no support no support compatibility unknown compatibility unknownsee implementation notes.see implementation notes.
OfflineAudioContext.suspend() - Web APIs
note that the maximum precision of suspension is the size of the render quantum and the specified suspension time will be rounded down to the nearest render quantum boundary.
... for this reason, it is not allowed to schedule multiple suspends at the same quantized frame.
... also scheduling should be done while the context is not running to ensure the precise suspension.
... invalidstateerror if the quantized frame number is one of the following: a negative number is less than or equal to the current time is greater than or equal to the total render duration is scheduled by another suspend for the same time specifications specification status comment web audio apithe definition of 'suspend()' in that specification.
OfflineAudioContext - Web APIs
note: the resume() method is still available — it is now defined on the baseaudiocontext interface (see baseaudiocontext.resume()) and thus can be accessed by both the audiocontext and offlineaudiocontext interfaces.
... at this point we create another audio context, create an audiobuffersourcenode inside it, and set its buffer to be equal to the promise audiobuffer.
... note: for a working example, see our offline-audio-context-promise github repo (see the source code too.) // define online and offline audio context var audioctx = new audiocontext(); var offlinectx = new offlineaudiocontext(2,44100*40,44100); source = offlinectx.createbuffersource(); // use xhr to load an audio track, and // decodeaudiodata to decode it and offlineaudiocontext to render it function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; sourc...
...rendering().then(function(renderedbuffer) { console.log('rendering completed successfully'); var song = audioctx.createbuffersource(); song.buffer = renderedbuffer; song.connect(audioctx.destination); play.onclick = function() { song.start(); } }).catch(function(err) { console.log('rendering failed: ' + err); // note: the promise should reject when startrendering is called a second time on an offlineaudiocontext }); }); } request.send(); } // run getdata to start the process off getdata(); specifications specification status comment web audio apithe definition of 'offlineaudiocontext' in that specification.
OscillatorNode - Web APIs
its basic property defaults (see audionode for definitions) are: number of inputs 0 number of outputs 1 channel count mode max channel count 2 (not used in the default count mode) channel interpretation speakers constructor oscillatornode() creates a new instance of an oscillatornode object, optionally providing an object specifying default values for the node's properties.
... properties inherits properties from its parent, audioscheduledsourcenode, and adds the following properties: oscillatornode.frequency an a-rate audioparam representing the frequency of oscillation in hertz (though the audioparam returned is read-only, the value it represents is not).
... the default value is 440 hz (a standard middle-a note).
... oscillatornode.detune an a-rate audioparam representing detuning of oscillation in cents (though the audioparam returned is read-only, the value it represents is not).
PaymentCurrencyAmount.value - Web APIs
important note: the number given in this string is always specified using the period (".") as the decimal point, rather than the comma (","), even if the user's locale normally uses the comma.
... you must convert the entered text to this form or it will not be valid.
...there must not be any leading or trailing whitespace in the string.
...formatted price you can ensure that the value entered as a price is formatted correctly prior to submission by matching it against a simple regular expression: function checkpriceformat(price) { let validregex = /^-?[0-9]+(\.[0-9]+)?$/; return validregex.test(price); } this function, checkpriceformat(), will return true if the specified price string is formatted properly, or false if it's not.
PaymentRequest.shippingType - Web APIs
the shippingtype read-only property of the paymentrequest interface returns one of "shipping", "delivery", "pickup", or null if one was not provided by the constructor.
... 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).
...no support noopera no support nosafari full support 11.1webview android no support nochrome android full support 55firefox android 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).
... nosafari ios full support 11.3samsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PerformanceEntry.duration - Web APIs
note: this feature is available in web workers.
... note: if the performance entry has an entrytype of "resource" (i.e.
...performance.mark not supported"); return; } // create some performance entries via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) { var pro...
...perties = ["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] + "() = " + json.stringify(js)); } else { log("..." + methods[i] + " = not supported"); } } } specifications specification status comment performance timeline level 2the definition of 'duration' in ...
PerformanceEntry.startTime - Web APIs
note: this feature is available in web workers.
... note: if the performance entry has an entrytype of "resource" (i.e.
...performance.mark not supported"); return; } // create some performance entries via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) { var properties = ["name", "entrytype", "starttime", "duration"...
...]; var methods = ["tojson"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in obj; if (supported) log("..." + properties[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported = typeof obj[methods[i]] == "function"; if (supported) { var js = obj[methods[i]](); log("..." + methods[i] + "() = " + json.stringify(js)); } else { log("..." + methods[i] + " = not supported"); } } } specifications specification status comment performance timeline level 2the definition of 'starttime' in that specification.
PerformanceResourceTiming.secureConnectionStart - Web APIs
if a secure connection is not used, the property returns zero.
... note: this feature is available in web workers.
...if a secure connection is not used, this property returns zero.
..." + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'secureconnectionstart' in that specification.
PerformanceResourceTiming.workerStart - Web APIs
the workerstart read-only property of the performanceresourcetiming interface returns a domhighrestimestamp immediately before dispatching the fetchevent if a service worker thread is already running, or immediately before starting the service worker thread if it is not already running.
... if the resource is not intercepted by a service worker the property will always return 0.
... note: this feature is available in web workers.
..." + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 2the definition of 'workerstart' in that specification.
Using Performance Timeline - Web APIs
the standard also includes interfaces that allow an application to be notified when specific performance events occur.
...performance.mark not supported"); return; } // create some performance entries via the mark() and measure() methods performance.mark("begin"); do_work(50000); performance.mark("end"); do_work(50000); performance.measure("measure1", "begin", "end"); // use getentries() to iterate all entries var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("all entry[" + i + "]"); ...
..." + properties[j] + " = not supported"); } } } } this interface also includes a tojson() method that returns the serialization of the performanceentry object.
... function perfentry_tojson() { // create a few performance entries performance.mark("mark-1"); performance.mark("mark-2"); performance.measure("meas-1", "mark-1", "mark-2"); var pelist = performance.getentries(); var pe = pelist[0]; if (pe.tojson === undefined) { log ("performanceentry.tojson() is not supported"); return; } // print the performanceentry object var json = pe.tojson(); var s = json.stringify(json); log("performanceentry.tojson = " + s); } performance observers the performance observer interfaces allow an application to register an observer for specific performance event types, and when one of those event types is recorded, the application is notified of the event via the observer's ca...
Performance Timeline - Web APIs
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.
... performance observers the performance observer interfaces allow an application to register an observer for specific performance event types, and when one of those event types is recorded, the application is notified of the event via the observer's callback function that was specified when the observer was created.
...however, note there is one key difference with these methods; the performance observer entry list versions are used to retrieve observed performance entries within the observer callback.
... performance observers were added to the level 2 version of the standard and were not widely implemented.
Using the Permissions API - Web APIs
let's face it, permissions on the web are a necessary evil, and they are not much fun to deal with as developers.
... historically, different apis handle their own permissions inconsistently — for example the notifications api allows for explicit checking of permission status and requesting permission, whereas the geolocation api doesn't (which causes problems if the user denied the initial permission request, as we'll see below).
... the only two apis currently recognized by the permissions api in chrome are geolocation and notification, with firefox also recognizing push and webmidi.
... responding to permission state changes you'll notice that there is an onchange event handler in the code above, attached to the permissionstatus object — this allows us to respond to any changes in the permission status for the api we are interested in.
PointerEvent - Web APIs
note: it's important to note that in many cases, both pointer and mouse events get sent (in order to let non-pointer-specific code still interact with the user).
... 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.
... 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.
PublicKeyCredential.getClientExtensionResults() - Web APIs
note: extensions are optional and different browsers may recognize different extensions.
... all extensions are optional for the client to process them: if a browser does not know of a given extension, that will not cause any failure.
... note: this method may only be used in top-level contexts and will not be available in an <iframe> for example.
...firefox does not seem to support any extension.
PublicKeyCredentialRequestOptions.extensions - Web APIs
note: an analogous option exists for the creation operation (navigators.credentials.create()), see publickeycredentialcreationoptions.extensions.
...firefox does not seem to support any extension.
... note: extensions are optional and different browsers may recognize different extensions.
... all extensions are optional for the client to process them: if a browser does not know a given extension, that will not cause any failure, the extension simply will not be processed.
PushEvent.PushEvent() - Web APIs
note that the this constructor is exposed only to a service worker context.
... full support 17firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support service workers and the push api.ie no support noopera full support 37safari no support nowebview android ...
... no support nochrome android full support 42firefox android full support 44 full support 44 full support 48notes notes push enabled by default.opera android full support 37safari ios no support nosamsung internet android full support 4.0legend full support full support no support no supportexperimental.
...expect behavior to change in the future.see implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
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.
... note: this interface replaces functionality previously offered by the obsolete pushregistrationmanager interface.
...a new push subscription is created if the current service worker does not have an existing subscription.
... example 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.
PushSubscription.getKey() - Web APIs
subbtn.disabled = false; if (!subscription) { console.log('not yet subscribed to push') // we aren't subscribed to push, so set ui // to allow the user to enable push return; } // set your ui to show they have subscribed for // push messages subbtn.textcontent = 'unsubscribe from push messaging'; ispushenabled = true; // initialize status, which includes setting ui elements for subscribed status // and updating subscribers list vi...
... specifications specification status comment push api working draft this is the push api spec, but note that getkey() is not currently specified in here.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgetkey()chrome full support 42edge full support 16firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support service workers and the push api.ie no support noopera full support 29safari no support nowebview android ...
...a android full support 29safari ios no support nosamsung internet android full support 4.0legend full support full support no support no supportsee implementation notes.see implementation notes.
RTCDataChannel - Web APIs
these labels are not required to be unique.maxpacketlifetime read only the read-only rtcdatachannel property maxpacketlifetime returns the amount of time, in milliseconds, the browser is allowed to take to attempt to transmit a message, as set when the data channel was created, or null.maxretransmits read only the read-only rtcdatachannel property maxretransmits returns the maximum number of times the browser sho...
...smit a message before giving up, as set when the data channel was created, or null, which indicates that there is no maximum.negotiated read only the read-only rtcdatachannel property negotiated indicates whether the rtcdatachannel's connection was negotiated by the web app (true) or by the webrtc layer (false).ordered read only the read-only rtcdatachannel property ordered indicates whether or not the data channel guarantees in-order delivery of messages; the default is true, which indicates that the data channel is indeed ordered.protocol read only the read-only rtcdatachannel property protocol returns a domstring containing the name of the subprotocol in use.
... if no protocol was specified when the data channel was created, then this property's value is "" (the empty string).readystate read only the read-only rtcdatachannel property readystate returns an enum of type rtcdatachannelstate which indicates the state of the data channel's underlying data connection.reliable read only the read-only rtcdatachannel property reliable indicates whether or not the data channel is reliable.stream read only the deprecated (and never part of the official specification) read-only rtcdatachannel property stream returns an id number (between 0 and 65,535) which uniquely identifies the rtcdatachannel.event handlersalso inherits event handlers from: eventtargetonbufferedamountlow the rtcdatachannel.onbufferedamountlow property is an eventhandler which spec...
...for example, after rtcdatachannel.close() was called but the underlying data transport might not have been closed yet.onerror the rtcdatachannel.onerror property is an eventhandler which specifies a function to be called when the error event is received.
RTCDtlsTransport - Web APIs
some non-browser legacy endpoints, however, may not support bundle.
... when not using bundle when the connection is created without using bundle, each rtp or rtcp component of each rtcrtptransceiver has its own rtcdtlstransport; that is, every rtcrtpsender and rtcrtpreceiver, has its own transport, and all rtcdatachannel objects share a transport dedicated to sctp.
... 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.
...new": case "connecting": results.connectionpending++; break; case "connected": results.connected++; break; case "closed": results.closed++; break; case "failed": results.failed++; break; default: results.unknown++; break; } } }); return results; } note that in this code, the new and connecting states are being treated as a single connectionpending status in the returned object.
RTCIceCandidate.address - Web APIs
address is null by default if not otherwise specified.
... 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 user expects.
... usage notes consider this sdp attribute line (a-line) which describes an ice candidate: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the fifth field, "192.168.0.56" is the ip address in this candidate's a-line string.
RTCIceCandidate - Web APIs
note: for backward compatibility, the constructor also accepts as input a string containing the value of the candidate property instead of a rtcicecandidateinit object, since the candidate includes all of the information that rtcicecandidateinit does and more.
... relatedaddress read only if the candidate is derived from another candidate, relatedaddress is a domstring containing that host candidate's ip address.
... relatedport read only for a candidate that is derived from another, such as a relay or reflexive candidate, the relatedport is a number indicating the port number of the candidate from which this candidate is derived.
... sdpmlineindex read only if not null, sdpmlineindex indicates the zero-based index number of the media description (as defined in rfc 4566) in the sdp with which the candidate is associated.
RTCInboundRtpStreamStats.packetsDuplicated - Web APIs
these packets are not counted by the packetsdiscarded property.
...these duplicate packets are not included in the packetsdiscarded property.
... usage notes duplicate packets are detected when a packet has the same rtp sequence number as another packet that has previously been processed.
...the resulting value will be positive, although it will not match the count as computed in rfc 3660.
RTCInboundRtpStreamStats - Web APIs
these packets are not counted by packetsdiscarded.
... packetsfaileddecryption an integer totaling the number of rtp packets that could not be decrypted.
... these packets are not counted by packetsdiscarded.
... plicount an integer specifying the number of times the receiver has notified the sender that some amount of encoded video data for one or more frames has been lost, using picture loss indication (pli) packets.
RTCOfferAnswerOptions.voiceActivityDetection - Web APIs
the voiceactivitydetection property of the rtcofferansweroptions dictionary is used to specify whether or not to use automatic voice detection for the audio on an rtcpeerconnection.
... the default value, true, indicates that voice detection should be used and that if possible, the user agent should automatically disable or mute outgoing audio when the audio source is not sensing a human voice.
... syntax var options = { voiceactivitydetection: trueorfalse }; value a boolean value indicating whether or not the connection should use voice detection once running.
... the default value, true, indicates that the user agent should monitor the audio coming from the microphone or other audio source and automatically cease transmitting data or mute when the user isn't speaking into the microphone, a value of false indicates that the audio should continue to be transmitted regardless of whether or not speech is detected.
RTCPeerConnection.addIceCandidate() - Web APIs
the end-of-candidates notification is transmitted to the remote peer using a candidate with an a-line value of end-of-candidates.
...the promise does not receive any input parameters.
... one or more of the values in the candidate string are invalid or could not be parsed.
...43 192.168.1.9 53421 typ host", sdpmid: "0", ...} // // pass the whole thing to addicecandidate: pc.addicecandidate(message.ice).catch(e => { console.log("failure during addicecandidate(): " + e.name); }); } else { // handle other things you might be signaling, like sdp } } the last candidate to be signaled this way by the remote peer will be a special candidate denoting end-of-candidates.
RTCPeerConnection.getIdentityAssertion() - Web APIs
this has an effect only if the signalingstate is not "closed".
...if the assertion cannot be generated, an idpassertionerror will be sent to the object.
... it is not expected for the application dealing with the rtcpeerconnection: this is automatically done; an explicit call only allows to anticipate the need.
... example var pc = new peerconnection(); pc.getidentityassertion(); // not mandatory, but we know that we will need it in the future.
RTCPeerConnection.iceConnectionState - Web APIs
"checking" the ice agent has been given one or more remote candidates and is checking pairs of local and remote candidates against one another to try to find a compatible match, but has not yet found a pair which will allow the peer connection to be made.
...it's possible that gathering is still underway, and it's also possible that the ice agent is still checking candidates against one another looking for a better connection to use.
... "completed" the ice agent has finished gathering candidates, has checked all pairs against one another, and has found a connection for all components.
... "failed" the ice candidate has checked all candidates pairs against one another and has failed to find compatible matches for all components of the connection.
RTCPeerConnection: icecandidate event - Web APIs
this ensures that the remote peer is given the end-of-candidates notification as well.
...only candidates for which the event's candidate property is null are not forwarded across the signaling connection.
... the end-of-candidates indication is described in section 9.3 of the trickle ice draft specification (note that the section number is subject to change as the specification goes through repeated drafts).
... this signal exists for backward compatibility purposes and does not need to be delivered onward to the remote peer (which is why the code snippet above checks to see if event.candidate is null prior to sending the candidate along.
RTCPeerConnection.setConfiguration() - Web APIs
the most common use case for this method (and even then, probably not a very common use case) is to replace the set of ice servers to be used.
... you cannot change the identity information for a connection once it's already been set.
...the changes are not additive; instead, the new values completely replace the existing ones.
... exceptions invalidaccesserror one or more of the urls specified in configuration.iceservers is a turn server, but complete login information is not provided (that is, either the rtciceserver.username or rtciceserver.credentials is missing).
RTCPeerConnection.setLocalDescription() - Web APIs
because descriptions will be exchanged until the two peers agree on a configuration, the description submitted by calling setlocaldescription() does not immediately take effect.
... return value a promise which is fulfilled once the value of rtcpeerconnection.localdescription is successfully changed or rejected if the change cannot be applied (for example, if the specified description is incompatible with one or both of the peers on the connection).
... the process of changing descriptions actually involves intermediary steps handled by the webrtc layer to ensure that an active connection can be changed without losing the connection if the change does not succeed.
... deprecated exceptions when using the deprecated callback-based version of setlocaldescription(), the following exceptions may occur: invalidstateerror the connection's signalingstate is "closed", indicating that the connection is not currently open, so negotiation cannot take place.
RTCRtpStreamStats - Web APIs
note: this interface was called rtcrtpstreamstats until a specification update in the spring of 2017.
...this is not the same as the value of mediastreamtrack.id.
... nackcount the number of times the receiver notified the sender that one or more rtp packets has been lost by sending a negative acknowledgement (nack, also called "generic nack") packet to the sender.
... slicount the number of times the receiver notified the sender that one or more consecutive (in scan order) encoded video macroblocks have been lost or corrupted; this notification is sent by the receiver to the sender using a slice loss indication (sli) packet.
RTCRtpTransceiver.currentDirection - Web APIs
does not offer to receive rtp data and will not do so.
... "recvonly" does not offer to send rtp data, and will not do so.
... "inactive" does not offer to send rtp data, and will not do so.
... does not offer to receive rtp data and will not do so.
RTCRtpTransceiver.stop() - Web APIs
note: until recently, the stopped property was provided to return true if the connection is stopped.
... this method does nothing if the transceiver is already stopped.
... usage notes when you call stop() on a transceiver, the sender immediately stops sending media and each of its rtp streams are closed using the rtcp "bye" message.
... note: stopping the transceiver causes a negotiationneeded event to be sent to the transceiver's rtcpeerconnection, so the connection can adapt to the change.
RTCRtpTransceiverDirection - Web APIs
does not offer to receive rtp data and will not do so.
... "recvonly" does not offer to send rtp data, and will not do so.
... "inactive" does not offer to send rtp data, and will not do so.
... does not offer to receive rtp data and will not do so.
RTCTrackEvent - Web APIs
this event is sent by the webrtc layer to the web site or application, so you will not typically need to instantiate an rtctrackevent yourself.
...you will probably not need to create new track events yourself, since they're typically created by the webrtc infrastructure and sent to the connection's ontrack event handler.
... you can add a track event listener to be notified when the new track is available so that you can, for example, attach its media to a <video> element, using either rtcpeerconnection.addeventlistener() or the ontrack event handler property.
... note: it may be helpful to keep in mind that you receive the track event when a new inbound track has been added to your connection, and you call addtrack() to add a track to the far end of the connection, thereby triggering a track event on the remote peer.
ReadableStream.ReadableStream() - Web APIs
pull(controller) optional this method, also defined by the developer, will be called repeatedly when the stream's internal queue of chunks is not full, up until it reaches its high water mark.
...if it is not included, the passed controller will be a readablestreamdefaultcontroller.
... note: you could define your own custom queuingstrategy, or use an instance of bytelengthqueuingstrategy or countqueuingstrategy for this object value.
... when a button is pressed, the generation is stopped, the stream is closed using readablestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream.
ReadableStream.cancel() - Web APIs
the supplied reason parameter will be given to the underlying source, which may or may not use it.
...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().
... exceptions typeerror the stream you are trying to cancel is not a readablestream, or it is locked.
ReadableStream.getReader() - Web APIs
undefined (or not specified at all — this is the default), which results in a readablestreamdefaultreader being created that can read individual chunks from a stream.
... exceptions rangeerror the provided mode value is not "byob" or undefined.
... typeerror the stream you are trying to create a reader for is not a readablestream.
...each chunk is read sequentially and output to the ui, until the stream has finished being read, at which point we return out of the recursive function and print the entire stream to another part of the ui.
ReadableStreamDefaultReader.read() - Web APIs
exceptions typeerror the source object is not a readablestreamdefaultreader, or the stream has no owner.
... examples example 1 - simple example this example shows the basic api usage, but doesn't try to deal with complications like stream chunks not ending on line boundaries for example.
...each chunk is read sequentially and output to the ui as an array of utf-8 bytes, until the stream has finished being read, at which point we return out of the recursive function and print the entire stream to another part of the ui.
...it deals with stream chunks not ending on line boundaries and converting from uint8array to strings.
Request() - Web APIs
WebAPIRequestRequest
note the following behavioural updates to retain security while making the constructor less likely to throw exceptions: if this object exists on another origin to the constructor call, the request.referrer is stripped out.
...note that a request using the get or head method cannot have a body.
...}); note that you could also pass the init object into the fetch call to get the same effect, e.g.: fetch(myrequest,myinit).then(function(response) { ...
...', headers: { 'content-type': 'image/jpeg' }, mode: 'cors', cache: 'default' }; var myrequest = new request('flowers.jpg', myinit); you may also pass a request object to the request() constructor to create a copy of the request (this is similar to calling the clone() method.) var copy = new request(myrequest); note: this last usage is probably only useful in serviceworkers.
Request.cache - Web APIs
WebAPIRequestcache
if the server indicates that the resource has not changed, it will be returned from the cache.
... no-store — the browser fetches the resource from the remote server without first looking in the cache, and will not update the cache with the downloaded resource.
...if the server indicates that the resource has not changed, it will be returned from the cache.
...cached redirects will be followed if the request's redirect property is "follow" and the redirects do not violate the "same-origin" mode.
Request.mode - Web APIs
WebAPIRequestmode
the associated mode, available values of which are: same-origin — if a request is made to another origin with this mode set, the result is simply an error.
...if any serviceworkers intercept these requests, they may not add or override any headers except for those that are simple headers.
... in addition, javascript may not access any properties of the resulting response.
... this ensures that serviceworkers do not affect the semantics of the web and prevents security and privacy issues arising from leaking data across domains.
Response - Web APIs
WebAPIResponse
you can create a new response object using the response.response() constructor, but you are more likely to encounter a response object being returned as the result of another api operation—for example, a service worker fetchevent.respondwith, or a simple windoworworkerglobalscope.fetch().
... response.ok read only a boolean indicating whether the response was successful (status in the range 200–299) or not.
... response.redirected read only indicates whether or not the response is the result of a redirect (that is, its url list has more than one entry).
... you'll notice that since we are requesting an image, we need to run body.blob (response implements body) to give the response its correct mime type.
SVGAnimationElement: repeatEvent event - Web APIs
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.
....createelement('li'); listitem.textcontent = 'beginevent fired'; list.appendchild(listitem); }) animateelem.addeventlistener('repeatevent', (e) => { let listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.detail; } listitem.textcontent = msg; list.appendchild(listitem); }) event handler property equivalent note that you can also create an event listener for the repeat event using the onrepeat event handler property: animateelem.onrepeat = () => { console.log('repeatevent fired'); } specifications specification status comment scalable vector graphics (svg) 2the definition of 'repeatevent' in that specification.
SVGDocument - Web APIs
svg document interface when an "svg" element is embedded inline as a component of a document from another namespace, such as when an "svg" element is embedded inline within an xhtml document, then an svgdocument object will not exist; instead, the root object in the document object hierarchy will be a document object of a different type, such as an htmldocument object.
... normative document svg 1.1 (2nd edition) properties name type description domain domstring the domain name of the server that served the document, or a null string if the server cannot be identified by a domain name.
...the value is an empty string if the user navigated to the page directly (not through a link, but, for example, via a bookmark).
... methods the svgdocument interface does not provide any specific methods.
SVGPathElement - Web APIs
="/docs/web/api/svgpathelement" target="_top"><rect x="-99" y="65" width="140" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="-29" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgpathelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} note: in svg 2 the getpathsegatlength() and createsvgpathseg* methods were removed and the pathlength property and the gettotallength() and getpointatlength() methods were moved to svggeometryelement.
... note: in svg 2 this property was moved to the svggeometryelement interface, from which this interface inherits it.
... note: in svg 2 this method was moved to the svggeometryelement interface, from which this interface inherits it.
... note: in svg 2 this method was moved to the svggeometryelement interface, from which this interface inherits it.
SVGTextContentElement - Web APIs
note that this method only accounts for the widths of the glyphs in the substring and any extra spacing inserted by the css 'letter-spacing' and 'word-spacing' properties.
... note: in svg 1.1 this method returned an svgpoint.
... note: in svg 1.1 this method returned an svgpoint.
...because the relationship between characters and glyphs is not one-to-one, only the first character of the relevant typographic character is returned svgtextcontentelement.selectsubstring() selects text within the element.
Screen Wake Lock API - Web APIs
a request may be rejected for a number of reasons, including system settings (such as power save mode or low battery level) or if the document is not active or visible.
...it can be released by the system, again if the battery power is too low or the document is not active or visible.
... 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.
...a presentation app might hold the lock only while a presentation is active, but not when presentation is being edited.
ScriptProcessorNode - Web APIs
note: as of the august 29 2014 web audio api spec publication, this feature has been marked as deprecated, and was replaced by audioworklet (see audioworkletnode).
... if the buffer size is not defined, which is recommended, the browser will pick one that its heuristic deems appropriate.
... number of inputs 1 number of outputs 1 channel count mode "max" channel count 2 (not used in the default count mode) channel interpretation "speakers" properties inherits properties from its parent, audionode.
... note: for a full working example, see our script-processor-node github repo (also view the source code.) var myscript = document.queryselector('script'); var mypre = document.queryselector('pre'); var playbutton = document.queryselector('button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode wit...
SourceBuffer.changeType() - Web APIs
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.
... 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.
SpeechRecognitionError.error - Web APIs
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.
... language-not-supported the language was not supported.
SpeechRecognitionErrorEvent.error - Web APIs
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.
... language-not-supported the language was not supported.
Using the Storage Access API - Web APIs
the storage access api should be used by embedded cross-origin documents to verify whether they have access to their first-party storage and, if not, to request access.
... usage notes the storage access api is designed to allow embedded content to request access to storage that would otherwise be blocked when a user’s browser is set to block all third-party cookies.
...since it does not know whether it currently has access to storage, it should first call document.hasstorageaccess().
...}); note that access requests are automatically denied unless the embedded content is currently processing a user gesture such as a tap or click — so this code needs to be run inside some kind of user gesture-based event handler, for example: btn.addeventlistener('click', () => { // run code here }); ...
Streams API - Web APIs
note: you can find a lot more details about the theory and practice of streams in our articles — streams api concepts, using readable streams, and using writable streams.
...default controllers are for streams that are not byte streams.
... 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.
...the examples are as follows: simple stream pump: this example shows how to consume a readablestream and pass its data to another.
SubtleCrypto.importKey() - Web APIs
typeerror raised when trying to use an invalid format or if the keydata is not suited for that format.
... the pkcs #8 format is defined in rfc 5208., using the asn.1 notation: privatekeyinfo ::= sequence { version version, privatekeyalgorithm privatekeyalgorithmidentifier, privatekey privatekey, attributes [0] implicit attributes optional } the importkey() method expects to receive this object as an arraybuffer containing the der-encoded form of the privatekeyinfo.
... subjectpublickey is defined in rfc 5280, section 4.1 using the asn.1 notation: subjectpublickeyinfo ::= sequence { algorithm algorithmidentifier, subjectpublickey bit string } just like pkcs #8, the importkey() method expects to receive this object as an arraybuffer containing the der-encoded form of the subjectpublickeyinfo.
... a json web key looks something like this (this is an ec private key): { "crv": "p-384", "d": "wouctu7nw4e8_7n5c1-xbjb4xqsb_lizhymsy8mggxuny6q8ncoh9xsiviwlffk_", "ext": true, "key_ops": ["sign"], "kty": "ec", "x": "szrrxmyi8vwfjg1dpunbfcc9jzvjzefh7ulki1ukxaltd7rgwrcffxqygpcwu6aq", "y": "hhuag3ovdzer0uuqnd4pxhqtxp5idgdyhjhl-wlkjngjqaw0rngy5v29-av-ysew" }; examples note: you can try the working examples on github.
SubtleCrypto.sign() - Web APIs
WebAPISubtleCryptosign
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.
... the fourth algorithm — hmac — uses the same algorithm and key for signing and for verification: this means that the verification key must be kept secret, which in turn means that this algorithm is not suitable for many signature use cases.
... it's different from rsassa-pkcs1-v1_5 in that it incorporates a random salt in the signature operation, so the same message signed with the same key will not result in the same signature each time.
... examples note: you can try the working examples out on github.
SubtleCrypto.unwrapKey() - Web APIs
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.
... examples note: you can try the working examples on github.
...note that when using aes-gcm we have to pass the iv value into unwrapkey(), and this must be the same as the iv that was used in the corresponding wrapkey() operation.
SubtleCrypto.wrapKey() - Web APIs
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.
... one advantage of using aes-kw over another aes mode such as aes-gcm is that aes-kw does not require an initialization vector.
... examples note: you can try the working examples out on github.
TextEncoder - Web APIs
note: there is a polyfill implementation to support non-utf-8 text encodings on github.
...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 they serve to aesthetically illustrate how the polyfill works.
...tcode=0, i = 0; i !== len; ) { point = str.charcodeat(i), i += 1; if (point >= 0xd800 && point <= 0xdbff) { if (i === len) { resarr[respos += 1] = 0xef/*0b11101111*/; resarr[respos += 1] = 0xbf/*0b10111111*/; resarr[respos += 1] = 0xbd/*0b10111101*/; break; } // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae nextcode = str.charcodeat(i); if (nextcode >= 0xdc00 && nextcode <= 0xdfff) { point = (point - 0xd800) * 0x400 + nextcode - 0xdc00 + 0x10000; i += 1; if (point > 0xffff) { resarr[respos += 1] = (0x1e/*0b11110*/<<3) | (point>>>18); ...
Multi-touch interaction - Web APIs
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 move_handler(ev) { // note: if the user makes more than one "simultaneous" touches, most browsers // fire at least one touchmove event and some will fire several touchmoves.
Using Touch Events - Web APIs
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.
...another potential factor is time; for 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.
... // touchstart handler function process_touchstart(ev) { // use the event's data to call out to the appropriate gesture handlers switch (ev.touches.length) { case 1: handle_one_touch(ev); break; case 2: handle_two_touches(ev); break; case 3: handle_three_touches(ev); break; default: gesture_not_supported(ev); break; } } access the attributes of a touch point.
Touch events - Web APIs
note: the text below uses the term "finger" when describing the contact with the surface, but it could, of course, also be a stylus or other contact method.
... create a canvas <canvas id="canvas" width="600" height="600" style="border:solid black 1px;"> your browser does not support canvas element.
... 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.
...this behavior is not well defined in the touch events spec and results in different behavior for different browsers (i.e., ios will prevent zooming but still allow panning with both fingers; android will allow zooming but not panning; opera and firefox currently prevent all panning and zooming.) currently, it's not recommended to depend on any particular behavior in this case, but rather to depend on meta viewport to...
TrackDefault - Web APIs
the trackdefault interface provides a sourcebuffer with kind, label, and language information for tracks that do not contain this information in the initialization segments of a media chunk.
... trackdefault.language read only returns the default language to use when an initialization segment does not contain language information for a new track.
... trackdefault.label read only returns the default label to use when an initialization segment does not contain label information for a new track.
... trackdefault.kinds read only returns the default kinds used when an initialization segment does not contain kind information for a new track.
Transferable - Web APIs
this interface does not define any method or property; it is merely a tag indicating objects that can be used in specific conditions, such as being transfered to a worker using the worker.postmessage() method.
... note: the transferable interface technically no longer exists.
... properties the transferable interface does not implement or inherit specific properties.
... methods the transferable interface does not implement or inherit specific properties.
UIEvent.initUIEvent() - Web APIs
do not use this method anymore as it is deprecated.
... canbubble is a boolean deciding whether the event should bubble up through the event chain or not.
...not for use in new websites.deprecated.
... not for use in new websites.
URLUtilsReadOnly.hash - Web APIs
the hash is not percent encoded.
...e 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.
... nosafari no support nowebview android no support nochrome android no support nofirefox android full support 38 full support 38 no support 4 — 38notes notes before firefox 38, firefox returned the hash percent encoded.
...expect behavior to change in the future.see implementation notes.see implementation notes.
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.
... input:invalid { border: red solid 3px; } note, in this case, we get a patternmismatch not a validitystate.toolong or validitystate.tooshort if the values are too long or too short because it is the pattern that is dictating the length of the value.
... note: the email input type requires, at minimum, a match of x@y and the url type requires, at minimum, a match to x:, with no pattern attribute present.
... when invalid, the validitystate.typemismatch will be true, if there is no pattern attribute (or if the pattern attribute is not valid for that input type).
ValidityState.typeMismatch - Web APIs
the read-only typemismatch 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 type attribute.
...if the value of the email input is not an empty string, a single valid e-mail address, or one or more comma separated email address if the multiple attribute is present, there is a typemismatch.
...if the value of the url input is not an empty string, a single valid url, or one or more comma separated urls if the multiple attribute is present, there is a typemismatch.
...for example, if the number input value is not a floating point number, the badinput is true.
VideoTrack - Web APIs
properties selected a boolean value which controls whether or not the video track is active.
... only a single video track can be active at any given time, so setting this property to true for one track while another track is active will make that other track inactive.
...returns null if the track was not created by a sourcebuffer or the sourcebuffer has been removed from the mediasource.sourcebuffers attribute of its parent media source.
... usage notes to get a videotrack for a given media element, use the element's videotracks property, which returns a videotracklist object from which you can get the individual tracks contained in the media: var el = document.queryselector("video"); var tracks = el.videotracks; you can then access the media's individual tracks using either array syntax or functions such as foreach().
WebGLRenderingContext.bindBuffer() - Web APIs
when using a webgl 2 context, the following values are available additionally: gl.copy_read_buffer: buffer for copying from one buffer object to another.
... gl.copy_write_buffer: buffer for copying from one buffer object to another.
...an attempt to bind the buffer to another target will throw an invalid_operation error and the current buffer binding will remain the same.
... a webglbuffer which has been marked for deletion with deletebuffer cannot be (re-)bound.
WebGLRenderingContext.checkFramebufferStatus() - Web APIs
gl.framebuffer_incomplete_attachment: the attachment types are mismatched or not all framebuffer attachment points are framebuffer attachment complete.
... 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 the ovr_multiview2 extension, the following value can be returned additionally: ext.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.
WebGLRenderingContext.colorMask() - Web APIs
syntax void gl.colormask(red, green, blue, alpha); parameters red a glboolean specifying whether or not the red color component can be written into the frame buffer.
... green a glboolean specifying whether or not the green color component can be written into the frame buffer.
... blue a glboolean specifying whether or not the blue color component can be written into the frame buffer.
... alpha a glboolean specifying whether or not the alpha (transparency) component can be written into the frame buffer.
WebGLRenderingContext.framebufferTexture2D() - Web APIs
exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer.
... attachment is not one of the accepted attachment points.
... textarget is not one of the accepted texture targets.
... a gl.invalid_value error is thrown if level is not 0.
Using WebGL extensions - Web APIs
note: in webgl, unlike in other gl apis, extensions are only available if explicitly requested.
...for instance: var ext = ( gl.getextension('oes_vertex_array_object') || gl.getextension('moz_oes_vertex_array_object') || gl.getextension('webkit_oes_vertex_array_object') ); note that, vendor prefix have been discouraged more and more and thus most browser implement experimental extensions behind a feature flag rather than vendor prefix.
...for example: var float_texture_ext = gl.getextension('oes_texture_float'); the return value is null if the extension is not supported, or an extension object otherwise.
... 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().
WebSocket.close() - Web APIs
WebAPIWebSocketclose
if the connection is already closed, this method does nothing.
...if this parameter is not specified, a default value of 1005 is assumed.
...this string must be no longer than 123 bytes of utf-8 text (not characters).
... note: in gecko, this method didn't support any parameters prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5).
Writing a WebSocket server in C# - Web APIs
note that this will block until the first 3 bytes of a message are available.
...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.
... note that the mask bit is set in our message.
..., bytes[offset + 2], bytes[offset + 3] }; offset += 4; for (int i = 0; i < msglen; ++i) decoded[i] = (byte)(bytes[offset + i] ^ masks[i % 4]); string text = encoding.utf8.getstring(decoded); console.writeline("{0}", text); } else console.writeline("mask bit not set"); console.writeline(); } } } } client.html <!doctype html> <style> textarea { vertical-align: bottom; } #output { overflow: auto; } #output > p { overflow-wrap: break-word; } #output span { color: blue; } #output span.error { color: red; } </style> <h2>websocket test</h2> <textarea cols=60 rows=6></textarea> <button>send</button>...
Keyframe Formats - Web APIs
element.animate([ { opacity: 1 }, { opacity: 0.1, offset: 0.7 }, { opacity: 0 } ], 2000); note: offset values, if provided, must be between 0.0 and 1.0 (inclusive) and arranged in ascending order.
... it is not necessary to specify an offset for every keyframe.
... element.animate({ opacity: [ 0, 1 ], // [ from, to ] color: [ "#fff", "#000" ] // [ from, to ] }, 2000); using this format, the number of elements in each array does not need to be equal.
...it's just for reference here, this will have no effect on animation since "float" is not an animatable css property.
Window.close() - Web APIs
WebAPIWindowclose
if the window was not opened by a script, an error similar to this one appears in the console: scripts may not close windows that were not opened by script.
... note also that close() has no effect when called on window objects returned by htmliframe​element​.content​window.
...pened window var openedwindow; function openwindow() { openedwindow = window.open('moreinfo.htm'); } function closeopenedwindow() { openedwindow.close(); } closing the current window in the past, when you called the window object's close() method directly, rather than calling close() on a window instance, the browser closed the frontmost window, whether your script created that window or not.
...(firefox 46.0.1: scripts can not close windows, they had not opened) function closecurrentwindow() { window.close(); } specification specification status comment html living standardthe definition of 'window.close()' in that specification.
Window.content - Web APIs
WebAPIWindowcontent
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.
... note: since firefox 57 (initially nightly-only), both the content and _content variants are only available to chrome (privileged) code, and not available to the web anymore.
... note: some examples use _content instead of content.
Window.find() - Web APIs
WebAPIWindowfind
note: support for window.find() might change in future versions of gecko.
...this is not implemented; see bug 481513.
..." + window.find(text)); } html <p>apples, bananas, and oranges.</p> <button type="button" onclick='findstring("apples")'>search for apples</button> <button type="button" onclick='findstring("banana")'>search for banana</button> <button type="button" onclick='findstring("orange")'>search for orange</button> result notes in some browsers, window.find() selects (highlights) the found content on the site.
... specification this is not part of any specification.
Window.onpaint - Web APIs
WebAPIWindowonpaint
not working in gecko-based applications currently, see notes section!
... notes onpaint doesn't work currently, and it is questionable whether this event is going to work at all, see bug 239074.
...this event occurs after the load event for a window, and reoccurs each time the window needs to be re-rendered, such as when another window obscures it and is then cleared away.
... specification this is not part of any specification.
Window.pageYOffset - Web APIs
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.
...this number is subpixel precise, so it may not be an integer.
... a value of 0.0 indicates that the window is not scrolled vertically, and that the top of the document is located at the top edge of the window's content area.
...note that the frame's contents have been scrolled to show the section named "overview", and that the value of the pageyoffset property is shown with the corresponding value.
Window: popstate event - Web APIs
note that just calling history.pushstate() or history.replacestate() won't trigger a popstate event.
... note: when writing functions that process popstate event it is important to take into account that properties like window.location will already reflect the state change (if it affected the current url), but document might still not.
... if new-entry's document is already fully loaded and ready—that is, its readystate is complete—and the document is not already visible, it's made visible and the pageshow event is fired at the document with the pagetransitionevent's persisted attribute set to true.
...title 1", "?page=1"); history.pushstate({page: 2}, "title 2", "?page=2"); history.replacestate({page: 3}, "title 3", "?page=3"); history.back(); // logs "location: http://example.com/example.html?page=1, state: {"page":1}" history.back(); // logs "location: http://example.com/example.html, state: null" history.go(2); // logs "location: http://example.com/example.html?page=3, state: {"page":3}" note that even though the original history entry (for http://example.com/example.html) has no state object associated with it, a popstate event is still fired when we activate that entry after the second call to history.back().
Window.print() - Web APIs
WebAPIWindowprint
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetprintchrome full support 1notes full support 1notes notes starting with chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.edge full support 12firefox full support 1ie full support 5opera ...
... full support 6notes full support 6notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari full support 1.1webview android full support 1notes full support 1notes notes starting with webview 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.chrome android full support 18notes full support 18notes notes starting with chrome 46, this method is blocked...
... inside an <iframe> unless its sandbox attribute has the value allow-modals.firefox android no support nonotes no support nonotes notes see bug 1247609.opera android full support 10.1notes full support 10.1notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari ios full support 1samsung internet android full support 1.0notes full support 1.0notes notes starting with samsung internet 5.0, this meth...
...od is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.legend full support full support no support no supportsee implementation notes.see implementation notes.
Window.releaseEvents() - Web APIs
example window.releaseevents(event.keypress) notes note that you can pass a list of events to this method using the following syntax: window.releaseevents(event.keypress | event.keydown | event.keyup).
... specification this is not part of any specification.
...not for use in new websites.deprecated.
... not for use in new websites.
Window.self - Web APIs
WebAPIWindowself
it can be used with dot notation on a window object (that is, window.self) or standalone (self).
... the advantage of the standalone notation is that a similar notation exists for non-window contexts, such as in web workers.
... by using self, you can refer to the global scope in a way that will work not only in a window context (self will resolve to window.self) but also in a worker context (self will then resolve to workerglobalscope.self).
... if (window.parent.frames[0] != window.self) { // this window is not the first frame in the list } furthermore, when executing in the active document of a browsing context, window is a reference to the current global object and thus all of the following are equivalent: var w1 = window; var w2 = self; var w3 = window.window; var w4 = window.self; // w1, w2, w3, w4 all strictly equal, but only w2 will function in workers specifications specification status comment html living standardthe definition of 'window.self' in that specification.
init() - Web APIs
warning: this method must not be called from javascript.
... [noscript] void init( in nsiprincipal principal, in nsiscriptcontext scriptcontext, in nsiglobalobject globalobject, in nsiuri baseuri, [optional] in nsiloadgroup loadgroup ); parameters principal the principal to use for the request; this must not be null.
... scriptcontext the script context to use for the request; this must not be null.
...this may be null, but if it is, the request cannot create a document.
XRPose.emulatedPosition - Web APIs
the emulatedposition read-only attribute of the xrpose interface is a boolean value indicating whether or not both the the position component of the pose's transform is directly taken from the xr device, or it's simulated or computed based on other sources.
... usage notes there are two basic categories of xr tracking systems.
... the same notion applies not just to the user's head, but to any object.
...if its position is computed as an offset from another object (such as by basing it off the model representing the user's body), then this value is true.
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
in other words, when you have an object in 3d space and need to position another object relative to that one, you can call getoffsetreferencespace(), passing into it the position and orientation you want the second object to have relative to the position and orientation of the object on which you call getoffsetreferencespace().
... then, when drawing the scene, you can use the offset reference space to not only position objects relative to one another, but to apply the needed transforms to render objects properly based upon the viewer's position.
... this is another good use case for getoffsetreferencespace().
...note also that we set oncontextmenu up to be ignored by calling preventdefault() on those events.
XRReferenceSpace: reset event - Web APIs
bubbles yes cancelable no interface xrreferencespaceevent event handler property onreset usage notes the reset event indicates that the coordinate system has been reset or reconfigured by changing the reference space's origin, moving and rotating it as indicated by the event's transform property.
... for a bounded-floor reference space, the coordinate system can be reset if the user exits the boundaries of the reference space and enters a new one (such as by crossing from one level to another in a game, where each level is its own map with its own coordinate system).
... the tracking system has temporarily lost the user, then regained them, but not until after they had moved enough to leave the immediate vicinity of the last-known position.
... note: a reset event will not occur if the reference space is able to regain tracking of its previous origin, since that means the origin has not been forced to be relocated.
XRReferenceSpace - Web APIs
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.
... xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object.
... xrreferencespace usage notes creating an xrreferencespace there are two situations in which you need to obtain an xrreferencespace.
...*/ }); the other situation in which you may need to acquire a new reference space is if you need to move the origin to a new position; this is commonly done, for example, when your project allows the user to move through the environment using input devices such as the keyboard, mouse, touchpad, or game controls that are not connected through the xr device.
XRRigidTransform() - Web APIs
if this parameter is left out or is not compatible with dompointinit, the position used is assumed to be {x: 0, y: 0, z: 0, w: 1}.
...the specified orientation gets normalized if it's not already.
... exceptions typeerror the value of the w coordinate in the specified position is not 1.0.
...after creating an xrrigidtransform from the viewer's initial position and orientation, we pass the new transform into getoffsetreferencespace() to create another reference space, now offset so that its origin is located at the same place in space as the coordinates given by viewerposition, with the orientation also revised in the same fashion.
XRSession.updateRenderState() - Web APIs
this property must not be specified for immersive sessions, so the value is null by default for immersive sessions.
...these are true exceptions, since this method does not return a promise.
... invalidstateerror this may occur for one of the following reasons: the xrsession has already ended, so you cannot change its render state.
... the inlineverticalfieldofview property was set, but the session is immersive and therefore does not allow this property to be used.
XRSessionMode - Web APIs
important: the immersive-ar mode is defined by the webxr augmented reality module, which is not yet stable and should not be used other than for testing and experimentation.
... immersive-vr indicates that the rendered session will be displayed using an immersive xr device in vr mode; it is not intended to be overlaid or integrated into the surrounding environment.
...inline sessions can be presented in either mono or stereo mode, and may or may not have viewer tracking available.
... 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.
XRSystem: isSessionSupported() - Web APIs
securityerror the document's origin does not have permission to use the xr-spatial-tracking feature policy.
... examples in this example, we see issessionsupported() used to detect whether or not the device supports vr mode by checking to see if an immersive-vr session is supported.
... if no session is already underway, we request the vr session and, if successful, set up the session in a method called onsessionstarted(), not shown.
...rted('immersive-vr') .then((issupported) => { if (issupported) { userbutton.addeventlistener('click', onbuttonclicked); userbutton.innerhtml = 'enter xr'; userbutton.disabled = false; } }); } function onbuttonclicked() { if (!xrsession) { navigator.xr.requestsession('immersive-vr') .then((session) => { xrsession = session; // onsessionstarted() not shown for reasons of brevity and clarity.
XRViewerPose - Web APIs
usage notes the xrviewerpose object is used to describe the state of a viewer of a webxr scene as it's tracked by the user's xr hardware.
... the viewer may be the virtual representation of the user, or it may represent another device or interface which may serve as the source of a position and orientation that make up a view upon the scene.
... for example, every player in a mmorpg might have an instance of xrviewerpose to provide a way to calculate what they can see; if the game provides a mechanism that tells the player if another player sees them, or that they see another player, this information becomes crucial.
... to render a scene using the xrviewerpose representing the user's head, one would iterate over the views in the views array, rendering them one after another.
msCachingEnabled - 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.
...if false, it is not written to disk.
...if false, it is not written to disk.
mssitemodejumplistitemremoved - 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.
... syntax event property object.oncandidatewindowhide = handler; addeventlistener method object.addeventlistener("mssitemodejumplistitemremoved", handler, usecapture) general info synchronous no bubbles no cancelable no note this event is raised once for every item that has been removed since the last time mssitemodeshowjumplist was called.
... this event is not triggered if mssitemodeclearjumplist has been called.
Using the aria-valuemax attribute - Accessibility
value string representation of a number possible effects on user agents and assistive technology if the aria-valuemax is indeterminate, or if aria-valuemin is not less than or equal to the value of aria-valuemax, this creates an error condition that will be handled by the assistive technology.
... 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.
... <div role="slider" aria-valuenow="4" aria-valuemin="1" aria-valuemax="10"> working examples: progressbar example slider example spinbutton example notes used with aria roles progressbar scrollbar slider spinbutton related aria techniques aria-valuemin aria-valuenow aria-valuetext compatibility tbd: add support information for common ua and at product combinations additional resources wai-aria specification for the aria-valuemax attribute ...
Using the aria-valuemin attribute - Accessibility
value string representation of a number possible effects on user agents and assistive technology if aria-valuemin is not less than or equal to the value of aria-valuemax, this creates an error condition that will be handled by the assistive technology.
... 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.
... <div role="slider" aria-valuenow="4" aria-valuemin="1" aria-valuemax="10"> working examples: progressbar example slider example spinbutton example notes used with aria roles progressbar scrollbar slider spinbutton related aria techniques aria-valuemax aria-valuenow aria-valuetext compatibility tbd: add support information for common ua and at product combinations additional resources wai-aria specification for the aria-valuemin attribute ...
Using the aria-valuetext attribute - Accessibility
authors should only set the aria-valuetext attribute when the rendered value cannot be accurately represented as a number.
... 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.
... <div role="slider" aria-valuenow="1" aria-valuemin="1" aria-valuemax="7" aria-valuetext="sunday"> working examples: notes used with aria roles progressbar scrollbar slider spinbutton related aria techniques aria-valuenow compatibility tbd: add support information for common ua and at product combinations additional resources wai-aria specification for the aria-valuetext attribute ...
Using the article role - Accessibility
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.
... 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 <article role="article"> <header> <h2>blog post</h2> </header> <section 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 slider role - Accessibility
by 10 on a range from 0 to 100) 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.
...p="1" aria-valuemin="1" aria-valuemax="100" aria-valuenow="50" oninput="outputupdate(value)"> <output for="fader" id="volume">50</output> the following code snippet allows you to return the output as it is updated by user input: function outputupdate(vol) { document.queryselector('#volume').value = vol; } example 2: text values sometimes, a slider is used to choose a value that is not, semantically, a number.
...luenow and aria-valuetext attributes: var daynames = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]; var updateslider = function (newvalue) { var handle = document.getelementbyid("day-handle"); handle.setattribute("aria-valuenow", newvalue.tostring()); handle.setattribute("aria-valuetext", daynames[newvalue]); }; working examples: slider example notes aria attributes used aria-valuemin aria-valuemax aria-valuenow aria-valuetext aria-orientation related aria techniques compatibility tbd: add support information for common ua and at product combinations additional resources wai-aria specification for the slider role ...
ARIA: contentinfo role - Accessibility
contentinfo landmarks present in content embedded via <iframe> elements do not count towards this limit.
... mega-footers do not nest additional <footer> elements or contentinfo landmarks inside of the document's footer.
...because of this, you do not need to describe what the landmark is in its label.
...note that a footer element nested within an article, aside, main, nav, or section is not considered contentinfo.
ARIA: img role - Accessibility
you shouldn't count on the alt text of individual elements images for conveying context to assistive technologies; most screenreaders will consider the element with role="img" set on it to be to be like a black box, and not access the individual elements inside it.
...this is obvious to fix in the case of images (you can use the alt attribute), but in the case of mixed or other certain types of content it is not so obvious, and role="img" can come into play.
... for example, if you use emojis in your text, the meaning might be obvious to a sighted user, but someone using a screenreader might get confused because the emojis might have either no text representation at all, or the alternative text might be confusing and not match the context it is being used in.
... another example where this might be suitable is when using ascii emoji combinations, like the legendary "table flip": <div role="img" aria-label="table flip"> <p> (╯°□°)╯︵ ┻━┻ </p> </div> associated wai-aria roles, states, and properties aria-label an accessible name is required.
ARIA: switch role - Accessibility
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.
...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.
...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.
ARIA: checkbox role - Accessibility
instead use the native html checkbox of <input type="checkbox">, which natively provides all the functionality required: <input type="checkbox" id="chk1-label"> <label for="chk1-label">remember my preferences</label> description the native html checkbox form control can only have two checked states ("checked" or "not checked"), with an indeterminate state settable via javascript.
...this attribute has one of three possible values: true the checkbox is checked false the checkbox is not checked mixed the checkbox is partially checked, or indeterminate tabindex="0" used to make it focusable so the assistive technology user can tab to it and start reading right away.
... 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.
Accessibility: What users can do to browse more safely - Accessibility
they can be addressed by the design and speed of the display and computer" hardware and operating systems on many computers offer control that is not afforded to developers.
...examples include: transitionrun transitionstart transitionend transitioncancel edge 75 and above (desktop, in windows 10) according to eric bailey, in his april 30, 2019 article revisiting prefers-reduced-motion, the reduced motion media query, "while microsoft edge does not have support for prefers-reduced-motion, it will become chrome under the hood soon." safari 10.1 and above (desktop) do not enable auto-play (does not work for gifs) ios safari 10.3 and above (mobile and tablet) select the "reduce motion option" in os accessibility settings for apple (image source: developers.google.com from thomas steiner's article "move ya!
...this will not work on animated gifs; the source of the animation is self-contained within a gif and is not affected by these settings.
...this will not work on animated gifs; the source of the animation is self-contained within a gif and is not affected by these settings..
Robust - Accessibility
note: to read the w3c definitions for robust and its guidelines and success criteria, see principle 4: robust — content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies.
... guideline 4.1 — compatible: maximize compatibility with current and future user agents, including assistive technologies this guideline focuses on making content as compatible as possible, not only with current user agents (e.g.
...not only by sighted mouse users, but also by screenreader users, keyboard-only users, etc.
... understanding status messages note: also see the wcag description for guideline 4.1: compatible: maximize compatibility with current and future user agents, including assistive technologies.
-moz-float-edge - CSS: Cascading Style Sheets
/* keyword values */ -moz-float-edge: border-box; -moz-float-edge: content-box; -moz-float-edge: margin-box; -moz-float-edge: padding-box; /* global values */ -moz-float-edge: inherit; -moz-float-edge: initial; -moz-float-edge: unset; syntax values border-box the height and width properties include the content, padding and border but not the margin.
... content-box the height and width properties include the content, but not the padding, border or margin.
... padding-box the height and width properties include the content and padding but not the border or margin.
...d valueas specifiedanimation typediscrete formal syntax border-box | content-box | margin-box | padding-box examples html <div class="box"> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> </div> css .box { display: block; height: 5px; margin: 0.5em auto 0.5em auto; color: gray; -moz-float-edge: margin-box; box-sizing: border-box; } result specifications not part of any standard.
-moz-user-focus - CSS: Cascading Style Sheets
/* keyword values */ -moz-user-focus: normal; -moz-user-focus: ignore; /* global values */ -moz-user-focus: inherit; -moz-user-focus: initial; -moz-user-focus: unset; by setting its value to ignore, you can disable focusing the element, which means that the user will not be able to activate the element.
... initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete note: this property doesn't work for xul <xul:textbox> elements, because the textbox itself never takes focus.
... syntax values ignore the element does not accept the keyboard focus and will be skipped in the tab order.
... formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax ignore | normal | select-after | select-before | select-menu | select-same | select-all | none examples html <input class="ignored" value="the user cannot focus on this element."> css .ignored { -moz-user-focus: ignore; } specifications not part of any standard.
-webkit-mask-box-image - CSS: Cascading Style Sheets
may include a partial image if the mask image does not divide evenly into the border box.
... formal definition value not found in db!
... formal syntax syntax not found in db!
... examples setting an image .exampleone { -webkit-mask-box-image: url('mask.png'); } offsetting and filling an image .exampletwo { -webkit-mask-box-image: url('logo.png') 100 100 0 0 round round; } specifications not part of any standard.
-webkit-text-security - CSS: Cascading Style Sheets
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!
... 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-focusring - CSS: Cascading Style Sheets
if :-moz-focusring matches, then :focus also matches, but the converse is not always true: it depends on whether the user agent has focus ring drawing enabled and how the element was focused.
... this feature is not defined in any specification yet, though it was discussed in the working group and it was decided to add it to selectors 4 or 5.
... note: developers tend to use :-moz-focusring to differentiate between the focus state when the user focuses an element via a mouse click versus keyboard tabbing.
... syntax :-moz-focusring examples html <input /> css input { margin: 5px; } :-moz-focusring { color: red; outline: 2px dotted green; } result specifications not part of any standard.
:-moz-last-node - CSS: Cascading Style Sheets
it differs from :last-child because it does not match a last-child element with (non-whitespace) text after it.
... note: any whitespace at the end of an element is ignored for the determination of :-moz-last-node.
... syntax :-moz-last-node examples css span:-moz-last-node { background-color: lime; } html <p> <span>this does not match.</span> <span>this matches!</span> </p> <p> <span>this doesn't match because it's followed by text.</span> blahblah.
... </p> result specifications not part of any standard.
:-moz-loading - CSS: Cascading Style Sheets
the :-moz-loading css pseudo-class is a mozilla extension that matches elements that can't be displayed because they have not started loading, such as images that haven't started to arrive yet.
... note that images that are in the process of loading are not matched by this pseudo-class.
... note: this selector is mainly intended to be used by theme developers.
... syntax :-moz-loading examples setting a background for images that are loading :-moz-loading { background-color: #aaa; background-image: url(loading-animation.gif) center no-repeat; } specifications not part of any standard.
:-moz-locale-dir(ltr) - CSS: Cascading Style Sheets
note: this selector is mainly used by extensions and themes to adapt the user interface based on the user's locale.
... 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 firefox due to an issue with the selector not working propertly with html content.
... html <p>if you're using a left-to-right interface, this should be red.</p> css p:-moz-locale-dir(ltr) { color: red; } result specifications not part of any standard.
:-moz-locale-dir(rtl) - CSS: Cascading Style Sheets
note: this selector is mainly used by extensions and themes to adapt the user interface based on the user's locale.
... 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 in firefox due to an issue with using this selector in html.
... html <p>if you're using a right-to-left interface, this should be red.</p> css p:-moz-locale-dir(rtl) { color: red; } result specifications not part of any standard.
:-moz-ui-invalid - CSS: Cascading Style Sheets
this pseudo-class is applied according to the following rules: if the control does not have focus, and the value is invalid, apply this pseudo-class.
... if the control has focus, and the value was valid (including empty) when it gained focus, do not apply the pseudo-class.
... the result is that if the control was valid when the user started interacting with it, the validity styling is changed only when the user shifts focus to another control.
... syntax syntax not found in db!
:-moz-ui-valid - CSS: Cascading Style Sheets
this pseudo-class is applied according to the following rules: if the control does not have focus, and the value is valid, apply this pseudo-class.
... the result is that if the control was valid when the user started interacting with it, the validity styling is changed only when the user shifts focus to another control.
... syntax syntax not found in db!
... specifications not part of any standard.
:focus-visible - CSS: Cascading Style Sheets
note that firefox supports similar functionality through an older, prefixed pseudo-class — :-moz-focusring.
...note the difference in behavior from elements styled with :focus.
... <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...
...tips for designing useful and usable focus indicators cognition it may not be obvious as to why the focus indicator is appearing and disappearing if a person is using mixed forms of input.
:has() - CSS: Cascading Style Sheets
WebCSS:has
/* selects any <a>, as long as it has an <img> element directly inside it */ /* note that this is not supported in any browser yet */ let test = document.queryselector('a:has(> img)'); syntax :has( <relative-selector-list> )where <relative-selector-list> = <relative-selector>#where <relative-selector> = <combinator>?
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet:has()chrome no support nonotes no support nonotes notes see bug 669058edge no support nonotes no support nonotes notes see bug 669058firefox no support nonotes no support nonotes notes see bug 418039i...
... no support noopera no support nosafari no support nowebview android no support nochrome android no support nofirefox android no support nonotes no support nonotes notes see bug 418039opera android no support nosafari ios no support nosamsung internet android no support nolegend no support no supportsee imple...
...mentation notes.see implementation notes.
:host() - CSS: Cascading Style Sheets
WebCSS:host()
note: this has no effect when used outside a shadow dom.
...to change preferences in firefox, visit about:config.ie no support noopera full support 41safari full support 10notes full support 10notes notes certain css selectors do not work (:host > .local-child) and styling slotted content (::slotted) is buggy.webview android full support 54chrome android full support 54firefox android full support ...
...to change preferences in firefox, visit about:config.opera android full support 41safari ios full support 10notes full support 10notes notes certain css selectors do not work (:host > .local-child) and styling slotted content (::slotted) is buggy.samsung internet android full support 6.0legend full support full support no support ...
... no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
:host-context() - CSS: Cascading Style Sheets
another typical use would be to allow inner elements to react to classes or attributes on any anscestor elements - for example, applying a different text color when a .dark-theme class is applied to <body>.
... note: this has no effect when used outside a shadow dom.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet:host-context()chrome full support 54edge full support 79firefox no support nonotes no support nonotes notes see bug 1082060.ie no support noopera full support 41safari no support nowebview android full support 54chrome android full suppor...
...t 54firefox android no support nonotes no support nonotes notes see bug 1082060.opera android full support 41safari ios no support nosamsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.
:hover - CSS: Cascading Style Sheets
WebCSS:hover
the :hover css pseudo-class matches when the user interacts with an element with a pointing device, but does not necessarily activate it.
... note: the :hover pseudo-class is problematic on touchscreens.
... depending on the browser, the :hover pseudo-class might never match, match only for a moment after touching an element, or continue to match even after the user has stopped touching and until the user touches another element.
... note: for an analogous effect, but based on the :checked pseudo-class (applied to hidden radioboxes), see this demo, taken from the :checked reference page.
:link - CSS: Cascading Style Sheets
WebCSS:link
the :link css pseudo-class represents an element that has not yet been visited.
... /* selects any <a> that has not been visited yet */ a:link { color: red; } styles defined by the :link pseudo-class will be overridden by any subsequent link-related pseudo-class (:active, :hover, or :visited) that has at least equal specificity.
... note: use :any-link to select an element independent of whether it has been visited or not.
...(after that, you'll need to clear your browser history to see them again.) however, the background-color values are likely to remain, as most browsers do not set that property on visited links by default.
:optional - CSS: Cascading Style Sheets
WebCSS:optional
the :optional css pseudo-class represents any <input>, <select>, or <textarea> element that does not have the required attribute set on it.
... /* selects any optional <input> */ input:optional { border: 1px dashed black; } this pseudo-class is useful for styling fields that are not required to submit a form.
... note: the :required pseudo-class selects required form fields.
... required inputs should also be indicated visually, using a treatment that does not rely solely on color to convey meaning.
:read-only - CSS: Cascading Style Sheets
the :read-only css pseudo-class represents an element (such as input or textarea) that is not editable by the user.
...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; } you can find the full source code at readonly-confirmation.html; this renders like so: styling read-only non-form controls this selector doesn't just select <input>/<textarea> elements — it will select any element that cannot be edited by the user.
... <p contenteditable>this paragraph is editable; it is read-write.</p> <p>this paragraph is not editable; it is read-only.</p> p { font-size: 150%; padding: 5px; border-radius: 5px; } p:read-only { background-color: red; color: white; } p:read-write { background-color: lime; } specifications specification status comment html living standardthe definition of ':read-only' in that specification.
... working draft defines the pseudo-class, but not the associated semantics.
:valid - CSS: Cascading Style Sheets
WebCSS:valid
note: we've used ::before to add these labels, as we were already using ::after for the "required" labels.
... you can try it below: notice how the required text inputs are invalid when empty, but valid when they have something filled in.
... the email input on the other hand is valid when empty, as it is not required, but invalid when it contains something that is not a proper email address.
...people who have certain types of color blindness will be unable to determine the input's state unless it is accompanied by an additional indicator that does not rely on color to convey meaning.
-webkit-transition - CSS: Cascading Style Sheets
it was never supported in browsers not based on webkit or blink.
... note: you should not use this media feature; it was never specified, has never been widely implemented, and has been removed from all browsers.
... 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.
@namespace - CSS: Cascading Style Sheets
when a default namespace is defined, all universal and type selectors (but not attribute selectors, see note below) apply only to elements in that namespace.
... note: in xml, unless a prefix is defined directly on an attribute (e.g., xlink:href), that attribute has no namespace.
... in other words, attributes do not inherit the namespace of the element they're on.
... to match this behaviour, the default namespace in css does not apply to attribute selectors.
Coordinate systems - CSS: Cascading Style Sheets
note that this is unlike most mathematical models, where the origin is at the bottom-left corner, with positive y-coordinate values being above the origin.
...scrolling is not a factor.
...note that within the <div> with the id "log", we have a paragraph for each coordinate system, with span used for each of the elements to receive and display the coordinates in each model.
...note also the effect of scrolling the example horizontally upon the values returned and how the value of clientx doesn't change.
CSS Animations tips and tricks - CSS: Cascading Style Sheets
however, there are things you might want to do that aren't obvious, or clever ways to do things that you might not come up with right away.
...some css that's not important (the style of the "run" button itself) isn't shown here, for brevity.
... note that because of this, the box doesn't start with any animation effects in place, so it won't be animating.
...this means you should not rely on animation-direction: alternate.
Styling Columns - CSS: Cascading Style Sheets
sadly, not at present.
...this means your columns will not run into each other.
...rules are only drawn between columns and not on the outer edges.
... note that the rule itself does not take up any space: a wide rule will not push the columns apart to make space for the rule.
Cross-browser Flexbox mixins - CSS: Cascading Style Sheets
+, 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.
...if an element is not a flex item, flex has no effect.
... note: space-* values not supported in older syntaxes.
...note that this property has no effect when the flexbox has only a single line.
Stacking context example 1 - CSS: Cascading Style Sheets
in this last example you can see that div #2 and div #4 are not siblings, because they belong to different parents in the html elements' hierarchy.
...it happens that, since div #1 and div #3 are not assigned any z-index value, they do not create a stacking context.
... in terms of stacking contexts, div #1 and div #3 are simply assimilated into the root element, and the resulting hierarchy is the following: root stacking context div #2 (z-index 1) div #4 (z-index 2) note: div #1 and div #3 are not translucent.
...and this example shows what happens when a parent element does not create a stacking context.
Browser compatibility and Scroll Snap - CSS: Cascading Style Sheets
if you do not do this your scroll snapping will no longer work in firefox 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 want to test using feature queries for support of the new spec then we'd suggest testing for scroll-snap-align as this property did not exist in the old implementation.
... however, these properties shouldn't cause any problems to non-supporting browsers due to the way that browsers simply ignore css that they do not understand.
Using the :target pseudo-class in selectors - CSS: Cascading Style Sheets
when a url points at a specific piece of a document, it can be difficult for the user to notice.
... 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.
...note that the document may jump to a new scroll position, since target elements are placed on the top of the browser window if possible.
... note: this reprinted article was originally part of the devedge site.
Basic Shapes - CSS: Cascading Style Sheets
this type uses functional notation: the type of shape is followed by brackets, inside of which are additional values used to describe the shape.
... .shape { shape-outside: circle(50%) border-box; } what is worth noting is that the margin-box will clip the shape, therefore shapes created in reference to other shapes which extend past the margin box will have the shape clipped to the margin box.
... inset() the inset() type defines a rectangle, which may not seem very useful as simply floating an item will give you a rectangular shape around it.
... another useful resource is clippy - a tool for creating shapes for clip-path, as the values for basic shapes are the same as those used for clip-path.
Using CSS transitions - CSS: Cascading Style Sheets
note: the set of properties that can be animated is changing as the specification develops.
...the specification recommends not animating from and to auto.
... you can control the individual components of the transition with the following sub-properties: (note that these transitions loop infinitely only for the purpose of our examples; css transitions only visualize a property change from start to finish.
...the addeventlistener() method to monitor for this event: el.addeventlistener("transitionend", updatetransition, true); you detect the beginning of a transition using transitionrun (fires before any delay) and transitionstart (fires after any delay), in the same kind of fashion: el.addeventlistener("transitionrun", signalstart, true); el.addeventlistener("transitionstart", signalstart, true); note: the transitionend event doesn't fire if the transition is aborted before the transition is completed because either the element is made display: none or the animating property's value is changed.
Introducing the CSS Cascade - CSS: Cascading Style Sheets
WebCSSCascade
finally, note that @import and @charset obey specific algorithms and aren't affected by the cascade algorithm.
...although some constraints on user-agent stylesheets are set by the html specification, browsers still have a lot of latitude: that means that significant differences exist from one browser to another.
... then it sorts these rules according to their importance, that is, whether or not they are followed by !important, and by their origin.
...therefore, it is the last one that is then selected: margin-left: 3px note that the declaration defined in the user css, though having a greater specificity, is not chosen as the cascade algorithm is applied before the specificity algorithm.
Comments - CSS: Cascading Style Sheets
WebCSSComments
a css comment is used to add explanatory notes to the code or to prevent the browser from interpreting specific parts of the style sheet.
... /* comment */ examples /* a one-line comment */ /* a comment which stretches over several lines */ /* the comment below is used to disable specific styling */ /* span { color: blue; font-size: 1.5em; } */ notes the /* */ comment syntax is used for both single and multiline comments.
...however, when using the <style> element, you may use <!-- --> to hide css from older browsers, although this is not recommended.
... as with most programming languages that use the /* */ comment syntax, comments cannot be nested.
Column layouts - CSS: Cascading Style Sheets
you do not need to target individual column boxes for styling.
...these new flex lines will distribute space along that line only — the items in the new line will not line up with items in the line above, as you'll see in the example below.
...it is designed for controlling layout as a row or a column, but not both at the same time.
... when you are happy for wrapped items to share out space along their line only and not line up with items in other lines.
align-content - CSS: Cascading Style Sheets
syntax /* basic positional alignment */ /* align-content does not take left and right values */ align-content: center; /* pack items around the center */ align-content: start; /* pack items from the start */ align-content: end; /* pack items from the end */ align-content: flex-start; /* pack flex items from the start */ align-content: flex-end; /* pack flex items from the end */ /* normal alignment */ align-content: normal; /* baseline align...
...for items that are not children of a flex container, this value is treated like start.
...for items that are not children of a flex container, this value is treated like end.
... stretch if the combined size of the items along the cross 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 cross axis.
background-repeat - CSS: Cascading Style Sheets
a background image can be repeated along the horizontal and vertical axes, or not repeated at all.
... round as the allowed space increases in size, the repeated images will stretch (leaving no gaps) until there is room (space left >= half of the image width) for another one to be added.
...example: an image with an original width of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added.
... no-repeat the image is not repeated (and hence the background image painting area will not necessarily be entirely covered).
border-image - CSS: Cascading Style Sheets
note: you should specify a separate border-style in case the border image fails to load.
... indeed, this is required according to the specification, although not all browsers implement this requirement.
... note: if the computed value of border-image-source is none, or if the image cannot be displayed, the border-style will be displayed instead.
... accessibility concerns assistive technology cannot parse border images.
border-left-style - CSS: Cascading Style Sheets
note: the specification doesn't define how borders of different styles connect in the corners.
... 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.
...upport 5.5opera full support 9.2safari full support 1webview android full support 2.3chrome android full support 18firefox android full support 14notes full support 14notes 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 firefox 50.opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full supportsee implementation notes.see implementation notes.
border-right-style - CSS: Cascading Style Sheets
note: the specification doesn't define how borders of different styles connect in the corners.
... 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.
...port 5.5opera full support 9.2safari full support 1webview android full support ≤37chrome android full support 18firefox android full support 14notes full support 14notes 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 firefox 50.opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full supportsee implementation notes.see implementation notes.
border - CSS: Cascading Style Sheets
WebCSSborder
the order of the values does not matter.
... note: the border will be invisible if its style is not defined.
...importantly, border cannot be used to specify a custom value for border-image, but instead sets it to its initial value, i.e., none.
... though it cannot be set to a custom value using the shorthand, border now resets border-image to its initial value (none).
box-align - CSS: Cascading Style Sheets
WebCSSbox-align
notes the edge of the box designated the start for alignment purposes depends on the box's orientation: horizontal top vertical left the edge opposite to the start is designated the end.
...; /* webkit */ } div.example > p { /* make children narrower than their parent, so there is room for the box-align */ width: 200px; } </style> </head> <body> <div class="example"> <p>i will be second from the bottom of div.example, centered horizontally.</p> <p>i will be on the bottom of div.example, centered horizontally.</p> </div> </body> </html> specifications not part of any standard.
...not for use in new websites.deprecated.
... not for use in new websites.requires a vendor prefix or different name for use.requires a vendor prefix or different name for use.
box-direction - CSS: Cascading Style Sheets
notes the edge of the box designated the start for layout purposes depends on the box's orientation: horizontal left vertical top the edge opposite to the start is designated the end.
...nts with a css display value of box or inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | reverse | inherit examples setting box direction .example { /* bottom-to-top layout */ -moz-box-direction: reverse; /* mozilla */ -webkit-box-direction: reverse; /* webkit */ box-direction: reverse; /* as specified */ } specifications not part of any standard.
...not for use in new websites.deprecated.
... not for use in new websites.user must explicitly enable this feature.user must explicitly enable this feature.requires a vendor prefix or different name for use.requires a vendor prefix or different name for use.
break-inside - CSS: Cascading Style Sheets
once forced breaks have been applied, soft breaks may be added if needed, but not on element boundaries that resolve in a corresponding avoid value.
... values auto allows, but does not force, any break (page, column, or region) to be be inserted within the principal box.
... by default, it is possible for you to get a break between the image and its caption, which is not what we want.
... notes on compatibility prior to firefox 65, the older property of page-break-inside will work in firefox to prevent breaks in columns, as well as pages.
caret-color - CSS: Cascading Style Sheets
the caret is typically a thin vertical line that flashes to help make it more noticeable.
... note that the insertion caret is only one type of caret.
...on the other hand, the mouse cursor image shown when hovering over text where the cursor property is auto, or when hovering over an element where the cursor property is text or vertical-text, though it sometimes looks like a caret, is not a caret (it’s a cursor).
... note: while user agents may use currentcolor (which is usually animatable) for the auto value, auto is not interpolated in transitions and animations.
clear - CSS: Cascading Style Sheets
WebCSSclear
vertical margins between two floated elements on the other hand will not collapse.
...this affects the position of later floats, since later floats cannot be positioned higher than earlier ones.
... if an element contains only floated elements, its height collapses to nothing.
... #container::after { content: ""; display: block; clear: both; } syntax /* keyword values */ clear: none; clear: left; clear: right; clear: both; clear: inline-start; clear: inline-end; /* global values */ clear: inherit; clear: initial; clear: unset; values none is a keyword indicating that the element is not moved down to clear past floating elements.
color-adjust - CSS: Cascading Style Sheets
the appearance of the content should not be changed except by the user's request.
... usage notes there are a number of reasons a browser might wish to deviate from the specified appearance, such as: the content uses text and background colors that will be too similar on the output device for legibility purposes.
...not only can the user override the behavior, but each user agent is allowed to decide for itself how to handle color-adjust in any given situation.
...for whatever reason, this is the desired appearance in any rendering environment, including on paper, so we also use color-adjust: exact to tell the browser not to make color or style adjustments to the box when rendering it.
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
a bfc ensures that everything inside your box stays inside it, and things from outside the box cannot intrude into it.
...our html page creates a new formatting context (floats and margins cannot extend out from the boundaries) and our content lays out in normal flow, using block and inline layout, unless we change the value of display to use some other formatting context.
... 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.
font-family - CSS: Cascading Style Sheets
font selection does not simply stop at the first font in the list that is on the user's system.
... rather, font selection is done one character at a time, so that if an available font does not have a glyph for a needed character, the latter fonts are tried.
...generic family names are keywords and must not be quoted.
...lucida bright, lucida fax, palatino, "palatino linotype", palladio, "urw palladio", serif.
font-variant-ligatures - CSS: Cascading Style Sheets
note that the keyword normal activates these ligatures.
...note that the keyword normal usually deactivates these ligatures.
...note that the keyword normal usually deactivates these ligatures.
...note that the keyword normal usually activates these ligatures too.
grid-auto-columns - CSS: Cascading Style Sheets
if a grid item is positioned into a column that is not explicitly sized by grid-template-columns, implicit grid tracks are created to hold it.
... when appearing outside a minmax() notation, it implies an automatic minimum (i.e.
... minmax(min, max) is a functional notation that defines a size range greater than or equal to min and less than or equal to max.
... note: auto track sizes (and only auto track sizes) can be streched by the align-content and justify-content properties.
grid-auto-rows - CSS: Cascading Style Sheets
if a grid item is positioned into a row that is not explicitly sized by grid-template-rows, implicit grid tracks are created to hold it.
... when appearing outside a minmax() notation, it implies an automatic minimum (i.e.
... minmax(min, max) is a functional notation that defines a size range greater than or equal to min and less than or equal to max.
... note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties.
ident - CSS: Cascading Style Sheets
WebCSSident
the <ident> css data type denotes an arbitrary string used as an identifier.
...it consists of one or more characters, where characters can be any of the following: any alphabetical character (a to z, or a to z), any decimal digit (0 to 9), a hyphen (-), an underscore (_), an escaped character (preceded by a backslash, \), a unicode character (in the format of a backslash, \, followed by one to six hexadecimal digits, representing its unicode code point) note that id1, id1, id1 and id1 are all different identifiers as they are case-sensitive.
...s and numbers ground-level a mix of alphanumeric characters and a dash -test a dash followed by alphanumeric characters --toto a custom-property like identifier _internal an underscore followed by alphanumeric characters \22 toto a unicode character followed by a sequence of alphanumeric characters bili\.bob a correctly escaped period invalid identifiers 34rem it must not start with a decimal digit.
... -12rad it must not start with a dash followed by a decimal digit.
Inheritance - CSS: Cascading Style Sheets
css properties can be categorized in two types: inherited properties, which by default are set to the computed value of the parent element non-inherited properties, which by default are set to initial value of the property refer to any css property definition to see whether a specific property inherits by default ("inherited: yes") or not ("inherited: no").
...it does not get the initial value of the property (which is the color that is used for the root element when the page specifies no color).
...the words "emphasized text" will not have a border (since the initial value of border-style is none).
... notes the inherit keyword allows authors to explicitly specify inheritance.
mask-border-width - CSS: Cascading Style Sheets
must not be negative.
...must not be negative.
...if the image does not have the required intrinsic dimension, the corresponding border-width is used instead.
... 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.
mask-repeat - CSS: Cascading Style Sheets
a mask image can be repeated along the horizontal axis, the vertical axis, both axes, or not repeated at all.
... round as the allowed space increases in size, the repeated images will stretch (leaving no gaps) until there is room for another one to be added.
...example: an image with an original width of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added.
... no-repeat the image is not repeated (and hence the mask painting area will not necessarily be entirely covered).
overflow-x - CSS: Cascading Style Sheets
this may be nothing, a scroll bar, or the overflow content.
... values visible content is not clipped and may be rendered outside the padding box's left and right edges.
...the box is not a scroll container, and does not start a new formatting context.
...browsers display scrollbars whether or not any content is actually clipped.
overflow-y - CSS: Cascading Style Sheets
this may be nothing, a scroll bar, or the overflow content.
... values visible content is not clipped and may be rendered outside the padding box's top and bottom edges.
...the box is not a scroll container, and does not start a new formatting context.
...browsers display scrollbars whether or not any content is actually clipped.
overflow - CSS: Cascading Style Sheets
WebCSSoverflow
values visible content is not clipped and may be rendered outside the padding box.
...the box is not a scroll container, and does not start a new formatting context.
...browsers always display scrollbars whether or not any content is actually clipped, preventing scrollbars from appearing or disappearing as content changes.
...er visible nor clipoverflow-y: as specified, except with visible/clip computing to auto/hidden respectively if one of overflow-x or overflow-y is neither visible nor clipanimation typediscrete formal syntax [ visible | hidden | clip | scroll | auto ]{1,2} examples setting different overflow values for text p { width: 12em; height: 6em; border: dotted; overflow: visible; /* content is not clipped */ } visible (default) sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.
overscroll-behavior - CSS: Cascading Style Sheets
you may also have noticed that when you have a dialog box with scrolling content on top of a page of scrolling content, once the dialog box's scroll boundary is reached, the underlying page will then start to scroll — this is called scroll chaining.
... in some cases these behaviors are not desirable.
...underlying elements will not scroll.
... both of these areas scroll; normally if you scrolled the chat window until you hit a scroll boundary, the underlying contacts window would start to scroll too, which is not desirable.
<position> - CSS: Cascading Style Sheets
the <position> (or <bg-position>) css data type denotes a two-dimensional coordinate used to set a location relative to an element box.
... note: the final position described by the <position> value does not need to be inside the element's box.
...| [ [ left | right ] [ <length> | <percentage> ] ] && [ [ top | bottom ] [ <length> | <percentage> ] ] ] note: the background-position property also accepts a three-value syntax.
... this is not allowed in other properties that use <position>.
ruby-position - CSS: Cascading Style Sheets
formal definition initial valueoverapplies toruby annotations containersinheritedyescomputed valueas specifiedanimation typediscrete formal syntax over | under | inter-character examples ruby positioned over the text html <ruby> <rb>超電磁砲</rb> <rp>(</rp><rt>レールガン</rt><rp>)</rp> </ruby> css ruby { ruby-position:over; } result ruby positioned under the text html <ruby> <rb>超電磁砲</rb> <rp>(</rp><rt>...
...foxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetruby-position experimentalchrome no support noedge no support 12 — 79firefox full support 38ie no support nonotes no support nonotes notes internet explorer 9 and later support an old draft values: inline (equivalent of having display: inline on the ruby), and above (synonym of the modern over).opera no support nosafari no support nonotes no support ...
... nonotes notes safari implements a non-standard, prefixed, version of ruby-position, -webkit-ruby-position: it has two properties: before and after (both equivalent, for ltr and rtl scripts to the standard over value used with ruby-align: start).webview android no support nochrome android no support nofirefox android full support 38opera android no support nosafari ios no support nonotes no support nonotes notes safari implements a non-standard, prefixed, version of ruby-position, -webkit-ruby-position: i...
...expect behavior to change in the future.see implementation notes.see implementation notes.
<shape> - CSS: Cascading Style Sheets
WebCSSshape
note: <shape> and rect() work in conjunction with clip, which has been deprecated in favor of clip-path.
...port 1samsung internet android full support 1.0rect() deprecatedchrome full support 1edge full support 12firefox full support 1ie full support 5.5notes full support 5.5notes notes for internet explorer versions 5.5 through 7, the rect() function uses spaces (instead of commas) to separate parameters.
...not for use in new websites.deprecated.
... not for use in new websites.see implementation notes.see implementation notes.
text-decoration-skip-ink - CSS: Cascading Style Sheets
text-decoration-skip-ink is not part of the text-decoration shorthand.
... auto the default — the browser may interrupt underlines and overlines so that they do not touch or closely approach a glyph.
... all the browser must interrupt underlines and overlines so that they do not touch or closely approach a glyph.
... this can be helpful with certain chinese, japanese, or korean (cjk) fonts, where the auto behavior might not create interruptions.
text-emphasis - CSS: Cascading Style Sheets
the text-decoration property does not inherit, and the decoration specified is applied across the whole element.
... the size of the emphasis symbol, like ruby symbols, is about 50% of the size of the font, and text-emphasis may affect line height when the current leading is not enough for the marks.
... constituent properties this property is a shorthand for the following css properties: text-emphasis-color text-emphasis-style syntax /* initial value */ text-emphasis: none; /* no emphasis marks */ /* <string> value */ text-emphasis: 'x'; text-emphasis: '点'; text-emphasis: '\25b2'; text-emphasis: '*' #555; text-emphasis: 'foo'; /* should not use.
...authors should not specify more than one character in <string>.
<transform-function> - CSS: Cascading Style Sheets
this is represented by the vector notation (x, y).
...thus, each coordinate changes based on the values in the matrix: ac bd xy = ax+cy bx+dy it is even possible to apply several transformations in a row: a1 c1 b1 d1 a2 c2 b2 d2 = a1 a2 + c1 b2 a1 c2 + c1 d2 b1 a2 + d1 b2 b1 c2 + d1 d2 with this notation, it is possible to describe, and therefore compose, most common transformations: rotations, scaling, or skewing.
... however, one major transformation is not linear, and therefore must be special-cased when using this notation: translation.
... note: though trickier than cartesian coordinates, homogeneous coordinates in projective geometry lead to 3×3 transformation matrices, and can simply express translations as linear functions.
user-select - CSS: Cascading Style Sheets
-select: all; /* webkit-specific values */ -webkit-user-select: none; -webkit-user-select: text; -webkit-user-select: all; /* doesn't work in safari; use only "none" or "text", or else it will allow typing in the <html> container */ /* microsoft-specific values */ -ms-user-select: none; -ms-user-select: text; -ms-user-select: element; note: user-select is not an inherited property, though the initial auto value makes it behave like it is inherited most of the time.
... syntax none the text of the element and its sub-elements is not selectable.
... note that the selection object can contain these elements.
... note: css ui 4 renames user-select: element to contain.
DOM onevent handlers - Developer guides
the web platform provides several ways to be notified of dom events.
... when an event occurs that applies to an element, each of its event handlers is called to allow them to handle the event, one after another.
...note that the event parameter actually contains the error message as a string.
... when the event handler is invoked tbd (non-capturing listener) terminology the term event handler may refer to: any function or object that is registered to be notified of events or more specifically, to the mechanism of registering event listeners via on… attributes in html or properties in web apis, such as <button onclick="alert(this)"> or window.onload = function() { … }.
Mutation events - Developer guides
mutation events provide a mechanism for a web page or an extension to get notified about changes made to the dom.
...moreover, removing the listeners does not reverse the damage.
... 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 domattributenamechanged are not supported in firefox (as of version 11), and probably in other browsers as well.
Event developer guide - Developer guides
WebGuideEvents
there are many other sources of events defined by web browsers for which pages are not yet available in this guide.
... note: this event developer guide needs substantial work.
...such events are commonly called synthetic events, as opposed to the events fired by the browser itself.dom on-event handlersthe web platform provides several ways to get notified of dom events.
...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.
<article>: The Article Contents element - HTML: Hypertext Markup Language
WebHTMLElementarticle
a given document can have multiple articles in it; for example, on a blog that shows the text of each article one after another as the reader scrolls, each post would be contained in an <article> element, possibly with one or more <section>s within.
...note that an <article> element must not be a descendant of an <address> element.
... usage notes each <article> should be identified, typically by including a heading (<h1>-<h6> element) as a child of the <article> element.
...note that the pubdate attribute of <time> is no longer a part of the w3c html5 standard.
<br>: The Line Break element - HTML: Hypertext Markup Language
WebHTMLElementbr
note: do not use <br> to create margins between paragraphs; wrap them in <p> elements and use the css margin property to control their size.
...evelyn avenue<br> mountain view, ca<br> 94041<br> usa<br> the result looks like so: accessibility concerns creating separate paragraphs of text using <br> is not only bad practice, it is problematic for people who navigate with the aid of screen reading technology.
... screen readers may announce the presence of the element, but not any content contained within <br>s.
... tag omission must have a start tag, and must not have an end tag.
<command>: The HTML Command element - HTML: Hypertext Markup Language
WebHTMLElementcommand
the <command> element is included in the w3c specification, but not in the whatwg specification, and browser support is nonexistent.
... permitted parent elements <colgroup> only, though it can be implicitly defined as its start tag is not mandatory.
... the <colgroup> must not have a <span> as child.
... disabled indicates that the command is not available.
<content>: The Shadow DOM Content Placeholder element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementcontent
note: though present in early draft of the specifications and implemented in several browsers, this element has been removed in later versions of the spec, and should not be used.
... note: for this code to work, the browser you display it in must support web components.
...not for use in new websites.deprecated.
... not for use in new websites.user must explicitly enable this feature.user must explicitly enable this feature.
<dialog>: The Dialog element - HTML: Hypertext Markup Language
WebHTMLElementdialog
the tabindex attribute must not be used on the <dialog> element.
...when the open attribute is not set, the dialog shouldn't be shown to the user.
... usage notes <form> elements can close a dialog if they have the attribute method="dialog".
...vdialog'); 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 click...
<em>: The Emphasis element - HTML: Hypertext Markup Language
WebHTMLElementem
usage notes the <em> element is for words that have a stressed emphasis compared to surrounding text, which is often limited to a word or words of a sentence and affects the meaning of the sentence itself.
...however, it should not be used simply to apply italic styling; use the css font-style property for that purpose.
...it is merely indicated that the object in question is not a queen named mary, but a ship named queen mary.
... another example for <i> could be: "the word the is an article".
<footer> - HTML: Hypertext Markup Language
WebHTMLElementfooter
note that a <footer> element must not be a descendant of an <address>, <header> or another <footer> element.
... usage notes enclose information about the author in an <address> element that can be included into the <footer> element.
... the <footer> element is not sectioning content and therefore doesn't introduce a new section in the outline.
...</footer> accessibility concerns the voiceover screen reader has an issue where the footer landmark role is not announced in the landmark rotor.
<frame> - HTML: Hypertext Markup Language
WebHTMLElementframe
<frame> is an html element which defines a particular area in which another html document can be displayed.
... using the <frame> element is not encouraged because of certain disadvantages such as performance problems and lack of accessibility for users with screen readers.
...if this attribute is not used, the browser adds a scrollbar when necessary.
... there are two choices: "yes" for forcing a scrollbar even when it is not necessary and "no" for forcing no scrollbar even when it is necessary.
<head>: The Document Metadata (Header) element - HTML: Hypertext Markup Language
WebHTMLElementhead
note: <head> primarily holds information for machine processing, not human-readability.
... the end tag may be omitted if the first thing following the <head> element is not a space character or a comment.
... example <!doctype html> <html> <head> <title>document title</title> </head> </html> notes html5-compliant browsers automatically create a <head> element if its tags are omitted in the markup.
... this auto-creation is not guaranteed in ancient browsers.
<i>: The Idiomatic Text element - HTML: Hypertext Markup Language
WebHTMLElementi
usage notes use the <i> element for text that is set off from the normal prose for readability reasons.
...among the use cases for the <i> element are spans of text representing a different quality or mode of text, such as: alternative voice or mood taxonomic designations (such as the genus and species "homo sapiens") idiomatic terms from another language (such as "et cetera"); these should include the lang attribute to identify the language technical terms transliterations thoughts (such as "she wondered,what is this writer talking about, anyway?") ship or vessel names in western writing systems (such as "they searched the docks for the empress of the galaxy, the ship to which they were assigned.") in earlier versions of the html specification, the <i> element was merely a pres...
... be sure the text in question is not actually more appropriately marked up with another element.
... examples this example demonstrates using the <i> element to mark text that is in another language.
<ins> - HTML: Hypertext Markup Language
WebHTMLElementins
if the value cannot be parsed as a date with an optional time string, the element does not have an associated time stamp.
... examples <ins>this text has been inserted</ins> result accessibility concerns the presence of the <ins> element is not announced by most screen reading technology in its default configuration.
...because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been inserted would adversely affect understanding.
... short note on making your mark (more accessible) | the paciello group tweaking text level styles | adrian roselli specifications specification status comment html living standardthe definition of '<ins>' in that specification.
<li> - HTML: Hypertext Markup Language
WebHTMLElementli
tag omission the end tag can be omitted if the list item is immediately followed by another <li> element, or if there is no more content in its parent element.
...though not a conforming usage, the obsolete <dir> can also be a parent.
... note: this attribute was deprecated in html4, but reintroduced in html5.
... note: this attribute has been deprecated; use the css list-style-type property instead.
<meter>: The HTML Meter element - HTML: Hypertext Markup Language
WebHTMLElementmeter
if specified, but not within the range given by the min attribute and max attribute, the value is equal to the nearest end of the range.
... note: unless the value attribute is between 0 and 1 (inclusive), the min and max attributes should define the range so that the value attribute's value is within it.
...if this attribute is not set, the <button> is associated with its ancestor <form> element, if any.
... examples simple example html <p>heat the oven to <meter min="200" max="500" value="350">350 degrees</meter>.</p> result on google chrome, the resulting meter looks like this: high and low range example note that in this example the min attribute is omitted.
<ol>: The Ordered List element - HTML: Hypertext Markup Language
WebHTMLElementol
note: unless the type of the list number matters (like legal or technical documents where items are referenced by their number/letter), use the css list-style-type property instead.
... usage notes typically, ordered list items display with a preceding marker, such as a number or letter.
... examples simple example <ol> <li>fee</li> <li>fi</li> <li>fo</li> <li>fum</li> </ol> the above html will output: using roman numeral type <ol type="i"> <li>introduction</li> <li>list of greivances</li> <li>conclusion</li> </ol> the above html will output: using the start attribute <p>finishing places of contestants not in the winners’ circle:</p> <ol start="4"> <li>speedwalk stu</li> <li>saunterin’ sam</li> <li>slowpoke rodriguez</li> </ol> the above html will output: nesting lists <ol> <li>first item</li> <li>second item <!-- closing </li> tag not here!
... --> <ol> <li>second item first subitem</li> <li>second item second subitem</li> <li>second item third subitem</li> </ol> </li> <!-- here's the closing </li> tag --> <li>third item</li> </ol> the above html will output: unordered list inside ordered list <ol> <li>first item</li> <li>second item <!-- closing </li> tag not here!
<option>: The HTML Option element - HTML: Hypertext Markup Language
WebHTMLElementoption
the end tag is optional if this element is immediately followed by another <option> element or an <optgroup>, or if the parent element has no more content.
... disabled if this boolean attribute is set, this option is not checkable.
...if this attribute is not set, the element can still be disabled if one of its ancestors is a disabled <optgroup> element.
...if the <option> element is the descendant of a <select> element whose multiple attribute is not set, only one single <option> of this <select> element may have the selected attribute.
<p>: The Paragraph element - HTML: Hypertext Markup Language
WebHTMLElementp
paragraphs are block-level elements, and notably will automatically close if another block-level element is parsed before the closing </p> tag.
...the end tag may be omitted if the <p> element is immediately followed by an <address>, <article>, <aside>, <blockquote>, <div>, <dl>, <fieldset>, <footer>, <form>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <header>, <hr>, <menu>, <nav>, <ol>, <pre>, <section>, <table>, <ul> or another <p> element, or if there is no more content in the parent element and the parent element is not an <a> element.
... note: the align attribute on <p> tags is obsolete and shouldn't be used.
...screen readers may announce the paragraph's presence, but not any content contained within it — because there is none.
<picture>: The Picture element - HTML: Hypertext Markup Language
WebHTMLElementpicture
offering alternative image formats, for cases where certain formats are not supported.
... usage notes you can use the object-position property to adjust the positioning of the image within the element's frame, and the object-fit property to control how the image is resized to fit within the frame.
... note: use these properties on the child <img> element, not the <picture> element.
...if the user agent does not support the given type, the <source> element is skipped.
<plaintext>: The Plain Text element (Deprecated) - HTML: Hypertext Markup Language
note: do not use this element.
... <plaintext> is deprecated since html 2, and not all browsers implemented it.
... if <plaintext> is the first element on the page (other than any non-displayed elements, like <head>), do not use html at all.
... implementation note: in gecko 1.9.2 and before, firefox implements the interface htmlspanelement for this element.
<shadow>: The obsolete Shadow Root element - HTML: Hypertext Markup Language
WebHTMLElementshadow
it is not useful in ordinary html.
... note: this is an experimental technology.
...--> <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 shadowroot1 = origcontent.createshadowroot(); // create the second shadow root var shadowroot2 = origcontent.createshadowroot(); // insert something into the older shadow root shadowroot1.innerhtml = '<p>older shadow root inserted by &lt;shadow&gt;</p>'; // insert into younger shadow root, including <shado...
... // the previous markup will not be displayed unless // <shadow> is used below.
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
WebHTMLElementstrong
usage notes the <strong> element is for content that is of "strong importance," including things of great seriousness or urgency (such as warnings).
...however, it should not be used simply to apply bold styling; use the css font-weight property for that purpose.
... another accepted use for <strong> is to denote the labels of paragraphs which represent notes or warnings within the text of a page.
...don't they both do the same thing?" not exactly.
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
WebHTMLElementtd
note: do not use this attribute as it is obsolete in the latest standard.
... the default value when this attribute is not specified is left.
... note: to achieve the same effect as the left, center, right or justify values, apply the css text-align property to the element.
...if align is not set to char, this attribute is ignored.
<xmp> - HTML: Hypertext Markup Language
WebHTMLElementxmp
note: do not use this element.
... it has been deprecated since html3.2 and was not implemented in a consistent way.
...note that you will need to escape the '<' character as '&lt;' to make sure it is not interpreted as markup.
... implementation note: up to gecko 1.9.2 inclusive, firefox implements the htmlspanelement interface for this element.
id - HTML: Hypertext Markup Language
this attribute's value is an opaque string: this means that web authors should not rely on it to convey human-readable information (although having your ids somewhat human-readable can be useful for code comprehension, e.g.
... id's value must not contain whitespace (spaces, tabs etc.).
... note: using characters except ascii letters, digits, '_', '-' and '.' may cause compatibility problems, as they weren't allowed in html 4.
... recommendation snapshot of html living standard, now accept '_', '-' and '.' if not at the beginning of the id.
itemref - HTML: Hypertext Markup Language
properties that are not descendants of an element with the itemscope attribute can be associated with an item using the global attribute itemref.
... itemref provides a list of element ids (not itemids) elsewhere in the document, with additional properties the itemref attribute can only be specified on elements that have an itemscope attribute specified.
... note: the itemref attribute is not part of the microdata data model.
... it is merely a syntactic construct to aid authors in adding annotations to pages where the data to be annotated does not follow a convenient tree structure.
tabindex - HTML: Hypertext Markup Language
it accepts an integer as a value, with different results depending on the integer's value: a negative value (usually tabindex="-1") means that the element is not reachable via sequential keyboard navigation, but could be focused with javascript or visually by clicking with the mouse.
...if not specified, it takes the default value 0.
... if you set the tabindex attribute on a <div>, then its child content cannot be scrolled with the arrow keys unless you set tabindex on the content, too.
... interactive components authored using non-interactive elements are not be listed in the accessibility tree.
translate - HTML: Hypertext Markup Language
"no", which indicates that the element must not be translated.
... although not all browsers recognize this attribute, it is respected by automatic translation systems such as google translate, and may also be respected by tools used by human translators.
... as such it's important that web authors use this attribute to mark content that should not be translated.
... examples in this example, the translate attribute is used to ask translation tools not to translate the company's brand name in the footer.
Quirks Mode and Standards Mode - HTML: Hypertext Markup Language
when the web standards were made at w3c, browsers could not just start using them, as doing so would break most existing sites on the web.
...if you do use another doctype, you may risk choosing one which triggers almost standards mode or quirks mode.
... xhtml if you serve your page as xhtml using 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.
CORS errors - HTTP
WebHTTPCORSErrors
this might not necessarily be a set-up mistake, though.
... note: for security reasons, specifics about what went wrong with a cors request are not available to javascript code.
... reason: cors disabled reason: cors request did not succeed reason: cors header ‘origin’ cannot be added reason: cors request external redirect not allowed reason: cors request not http reason: cors header ‘access-control-allow-origin’ missing reason: cors header ‘access-control-allow-origin’ does not match ‘xyz’ reason: credential is not supported if the cors header ‘access-control-allow-origin’ is ‘*’ reason: did n...
...ot find method in cors header ‘access-control-allow-methods’ reason: expected ‘true’ in cors header ‘access-control-allow-credentials’ reason: cors preflight channel did not succeed reason: invalid token ‘xyz’ in cors header ‘access-control-allow-methods’ reason: invalid token ‘xyz’ in cors header ‘access-control-allow-headers’ reason: missing token ‘xyz’ in cors header ‘access-control-allow-headers’ from cors preflight channel reason: multiple cors header ‘access-control-allow-origin’ not allowed ...
Compression in HTTP - HTTP
for images, an image generated by a tool could be not optimized enough for the web; it is recommended to use tools that will compress as much as possible with the required quality.
... as compression works better on a specific kind of files, it usually provides nothing to compress them a second time.
...do not use the two following techniques for files in a compressed format.
... note that using transfer-encoding and compression at the hop level is so rare that most servers, like apache, nginx, or iis, have no easy way to configure it.
Using Feature Policy - HTTP
if you do not specify a policy for a feature, then a default allowlist will be used.
...the feature is not allowed in cross-origin documents in nested browsing contexts.
...if a feature has been disabled for a child frame by its parent frame, the child cannot re-enable it, and neither can any of the child's descendants.
...this is especially important for embedded or third-party content that you do not control.
CSP: style-src-attr - HTTP
you can also specify data schemes (not recommended).
...use this sparingly and definitely not for scripts.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
...when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including leading or trailing whitespace.
CSP: style-src-elem - HTTP
you can also specify data schemes (not recommended).
...use this sparingly and definitely not for scripts.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
...when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including leading or trailing whitespace.
Content-Security-Policy-Report-Only - HTTP
the http content-security-policy-report-only response header allows web developers to experiment with policies by monitoring (but not enforcing) their effects.
... header type response header forbidden header name no this header is not supported inside a <meta> element.
...this is not always the case.
... for example, when the signup.html would attempt to load css from http://anothercdn.example.com/stylesheet.css, the browser would not include the full path but only the origin (http://anothercdn.example.com).
DNT - HTTP
WebHTTPHeadersDNT
the dnt (do not track) request header indicates the user's tracking preference.
... 1 the user prefers not to be tracked on the target site.
... null the user has not specified a preference about tracking.
... examples reading do not track status from javascript the user's dnt preference can also be read from javascript using the navigator.donottrack property: navigator.donottrack; // "0" or "1" specifications specification status comment tracking preference expression (dnt)the definition of 'dnt header field for http requests' in that specification.
Feature-Policy: screen-wake-lock - HTTP
note: this api is still actively being developed and available only behind a flag on select browsers and platforms.
... the http feature-policy header screen-wake-lock directive controls whether the current document is allowed to use screen wake lock api to indicate that device should not dim or turn off the screen.
... note: in earlier specification drafts this directive was called wake-lock.
...the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: wake-lock - HTTP
note: this api is still actively being developed and available only behind a flag on select browsers and platforms.
... the http feature-policy header wake-lock directive controls whether the current document is allowed to use wake lock api to indicate that device should not enter power-saving mode.
... note: latest drafts of screen wake lock api defines screen-wake-lock directive.
...the feature is not allowed in cross-origin documents in nested browsing contexts.
If-Match - HTTP
WebHTTPHeadersIf-Match
if it doesn't match, then a 416 (range not satisfiable) response is returned.
...it can check if the modification of a resource that the user wants to upload will not override another change that has been done since the original resource was fetched.
... if the request cannot be fulfilled, the 412 (precondition failed) response is returned.
...that they represent the resource semantically, but not byte-for-byte.
If-None-Match - HTTP
when the condition fails for get and head methods, then the server must return http status code 304 (not modified).
...note that the server generating a 304 response must generate any of the following header fields that would have been sent in a 200 (ok) response to the same request: cache-control, content-location, date, etag, expires, and vary.
... 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 problem.
...they are only useful when uploading a resource, usually with put, to check if another resource with the identity has already been uploaded before.
Strict-Transport-Security - HTTP
not part of the specification.
... note: the strict-transport-security header is ignored by the browser when your site is accessed using http; this is because an attacker may intercept http connections and inject the header or remove it.
...however, it is not part of the hsts specification and should not be treated as official.
...note that 1 year is acceptable for a domain to be included in browsers' hsts preload lists.
Tk - HTTP
WebHTTPHeadersTk
(dynamic) tk: g (gateway or multiple parties) tk: n (not tracking) tk: t (tracking) tk: c (tracking with consent) tk: p (potential consent) tk: d (disregarding dnt) tk: u (updated) directives !
... n not tracking.
...the origin server does not know, in real-time, whether it has received prior consent for tracking this user, user agent, or device, but promises not to use or share any dnt:1 data until such consent has been determined, and further promises to delete or permanently de-identify within 48 hours any dnt:1 data received for which such consent has not been received.
... examples a tk header for a resource that claims not to be tracking would look like: tk: n specifications specification status comment tracking preference expression (dnt)the definition of 'tk header field' in that specification.
Upgrade - HTTP
WebHTTPHeadersUpgrade
for example, the client might send a get request as shown, listing the preferred protocols to switch to (in this case "example/1" and "foo/2"): get /index.html http/1.1 host: www.example.com connection: upgrade upgrade: example/1, foo/2 note: connection: upgrade must be set whenever upgrade is sent.
... the server can choose to ignore the request, for any reason, in which case it should just respond as though the upgrade header had not been sent (for example, with a  200 ok).
... syntax connection: upgrade upgrade: protocol_name[/protocol_version] notes: the connection header with type upgrade must always be sent with the upgrade header (as shown above).
...for example: connection: upgrade upgrade: a_protocol/1, example ,another_protocol/2.2 directives any comma-separated list protocol names (each with optional protocol version) one or more protocol names with optional version ("/" separated).
X-DNS-Prefetch-Control - HTTP
this is what browsers do, if they support the feature, when this header is not present off disables dns prefetching.
... also, by default, prefetching of embedded link hostnames is not performed on documents loaded over https.
...link element can be used to resolve hostnames without providing a complete url, but only, by preceding the hostname with two slashes: <link rel="dns-prefetch" href="//www.mozilla.org/contribute/"> forced prefetching of hostnames might be useful, for example, on the homepage of a site to force pre-resolution of domain names that are referenced frequently throughout the site even though they are not used on the home page itself.
... this will improve the overall performance of site even though the performance of the home page may not be affected.
HTTP Messages - HTTP
WebHTTPMessages
the http/2 binary framing mechanism has been designed to not require any alteration of the apis or config files applied: it is broadly transparent to the user.
...not all requests have one: requests fetching resources, like get, head, delete, or options, usually don't need one.
... a typical status line looks like: http/1.1 404 not found.
...not all responses have one: responses with a status code that sufficiently answers the request without the need for corresponding payload (like 201 created or 204 no content) usually don't.
451 Unavailable For Legal Reasons - HTTP
WebHTTPStatus451
the hypertext transfer protocol (http) 451 unavailable for legal reasons client error response code indicates that the user requested a resource that is not available due to legal reasons, such as a web page for which a legal action has been issued.
... note: the link header might also contain a rel="blocked-by" relation identifying the entity and implementing blockage, not any other entity mandating it.
... any attempt to identify the entity ultimately responsible for the resource being unavailable belongs in the response body, not in the rel="blocked-by" link.
... http/1.1 451 unavailable for legal reasons link: <https://spqr.example.org/legislatione>; rel="blocked-by" content-type: text/html <html> <head><title>unavailable for legal reasons</title></head> <body> <h1>unavailable for legal reasons</h1> <p>this request may not be serviced in the roman province of judea due to the lex julia majestatis, which disallows access to resources hosted on servers deemed to be operated by the people's front of judea.</p> </body> </html> specifications specification title rfc 7725: 451 unavailable for legal reasons an http status code to report legal obstacles ...
Loops and iteration - JavaScript
you can think of a loop as a computerized version of the game where you tell someone to take x steps in one direction, then y steps in another.
...(note that it's possible that number could be zero!) the various loop mechanisms offer different ways to determine the start and end points of the loop.
... the syntax of the labeled statement looks like the following: label : statement the value of label may be any javascript identifier that is not a reserved word.
...in contrast to the break statement, continue does not terminate the execution of the loop entirely.
Public class fields - JavaScript
syntax class classwithinstancefield { instancefield = 'instance field' } class classwithstaticfield { static staticfield = 'static field' } class classwithpublicinstancemethod { publicmethod() { return 'hello world' } } examples public static fields public static fields are useful when you want a field to exist only once per class, not on every class instance you create.
... class classwithstaticfield { static staticfield } console.assert(classwithstaticfield.hasownproperty('staticfield')) console.log(classwithstaticfield.staticfield) // expected output: "undefined" public static fields are not reinitialized on subclasses, but can be accessed via the prototype chain.
... class classwithstaticfield { static basestaticfield = 'base static field' static anotherbasestaticfield = this.basestaticfield static basestaticmethod() { return 'base static method output' } } class subclasswithstaticfield extends classwithstaticfield { static substaticfield = super.basestaticmethod() } console.log(classwithstaticfield.anotherbasestaticfield) // expected output: "base static field" console.log(subclasswithstaticfield.substaticfield) // expected output: "b...
... class classwithinstancefield { baseinstancefield = 'base field' anotherbaseinstancefield = this.baseinstancefield baseinstancemethod() { return 'base method output' } } class subclasswithinstancefield extends classwithinstancefield { subinstancefield = super.baseinstancemethod() } const base = new classwithinstancefield() const sub = new subclasswithinstancefield() console.log(base.anotherbaseinstancefield) // expected output: "base field" console.log(sub.
constructor - JavaScript
or() {} if your class is a derived class, the default constructor calls the parent constructor, passing along any arguments that were provided: constructor(...args) { super(...args); } that enables code like this to work: class validationerror extends error { printcustomermessage() { return `validation failed :-( (details: ${this.message})`; } } try { throw new validationerror("not a valid phone number"); } catch (error) { if (error instanceof validationerror) { console.log(error.name); // this is error instead of validationerror!
...for example: class validationerror extends error { constructor(message) { super(message); // call parent class constructor this.name = 'validationerror'; this.code = '42'; } printcustomermessage() { return `validation failed :-( (details: ${this.message}, code: ${this.code})`; } } try { throw new validationerror("not a valid phone number"); } catch (error) { if (error instanceof validationerror) { console.log(error.name); // now this is validationerror!
... 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`.
... this.name = 'square'; } get area() { return this.height * this.width; } set area(value) { this.height = value**0.5; this.width = value**0.5; } } another example here the prototype of square class is changed—but the constructor of its base class polygon is still called when a new instance of a square is created.
static - JavaScript
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 static method of the same class, you can use the this keyword.
... class staticmethodcall { static staticmethod() { return 'static method has been called'; } static anotherstaticmethod() { return this.staticmethod() + ' from another static method'; } } staticmethodcall.staticmethod(); // 'static method has been called' staticmethodcall.anotherstaticmethod(); // 'static method has been called from another static method' calling static methods from a class constructor and other methods static methods are not directly accessible using the this keyword from non-static methods.
SyntaxError: missing = in const declaration - JavaScript
the javascript exception "missing = in const declaration" occurs when a const declaration was not given a value in the same statement (like const red_flag;).
... a constant is a value that cannot be altered by the program during normal execution.
... it cannot change through re-assignment, and it can't be redeclared.
... do not use const if you weren't meaning to declare a constant.
SyntaxError: missing ; before statement - JavaScript
however, oftentimes, this error is only a consequence of another error, like not escaping strings properly, or using var wrongly.
... examples unescaped strings this error can occur easily when not escaping strings properly and the javascript engine is expecting the end of your string already.
... for example: var foo = 'tom's bar'; // syntaxerror: missing ; before statement you can use double quotes, or escape the apostrophe: var foo = "tom's bar"; var foo = 'tom\'s bar'; declaring properties with var you cannot declare properties of an object or array with a var declaration.
... var obj = {}; var obj.foo = 'hi'; // syntaxerror missing ; before statement var array = []; var array[0] = 'there'; // syntaxerror missing ; before statement instead, omit the var keyword: var obj = {}; obj.foo = 'hi'; var array = []; array[0] = 'there'; bad keywords if you come from another programming language, it is also common to use keywords that don't mean the same or have no meaning at all in javascript: def print(info){ console.log(info); }; // syntaxerror missing ; before statement instead, use function instead of def: function print(info){ console.log(info); }; ...
Array.prototype.reduceRight() - JavaScript
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.
...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'); } if ('function' !== typeof callback) { throw new typeerror(callback + ' is not a function'); } var t = object(this), len = t.length >>> 0, k = len - 1, value; if (arguments.length >= 2) { value = arguments[1]; } else { while (k >= 0 && !(k in t)) { k--; } if (k < 0) { throw new typeerror('reduce of empty array with no initial value'); } value = t[k--]; } for (; k >= 0; k--) { if (k in t) { ...
... /** * function composition is way in which result of one function can * be passed to another and so on.
BigInt.prototype.toString() - JavaScript
the trailing "n" is not part of the string.
... description the bigint object overrides the tostring() method of the object object; it does not inherit object.prototype.tostring().
... if the radix is not specified, the preferred radix is assumed to be 10.
...this is the case even if the radix is 2; the string returned is the positive binary representation of the bigintobj preceded by a - sign, not the two's complement of the bigintobj.
BigInt64Array - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation).
... bigint64array.prototype.find() returns the found value in the array if an element in the array satisfies the provided testing function, or undefined if not found.
... bigint64array.prototype.findindex() returns the found index in the array if an element in the array satisfies the provided testing function, or -1 if not found.
... examples different ways to create a bigint64array // from a length var bigint64 = new bigint64array(2); bigint64[0] = 42n; console.log(bigint64[0]); // 42n console.log(bigint64.length); // 2 console.log(bigint64.bytes_per_element); // 8 // from an array var arr = new bigint64array([21n,31n]); console.log(arr[1]); // 31n // from another typedarray var x = new bigint64array([21n, 31n]); var y = new bigint64array(x); console.log(y[0]); // 21n // from an arraybuffer var buffer = new arraybuffer(32); var z = new bigint64array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1n, 2n, 3n]; }(); var bigint64 = new bigint64array(iterable); // bigint64array[1n, 2n, 3n] specifications specification ...
BigUint64Array - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation).
... biguint64array.prototype.find() returns the found value in the array if an element in the array satisfies the provided testing function, or undefined if not found.
... biguint64array.prototype.findindex() returns the found index in the array if an element in the array satisfies the provided testing function, or -1 if not found.
... examples different ways to create a biguint64array // from a length var biguint64 = new biguint64array(2); biguint64[0] = 42n; console.log(biguint64[0]); // 42n console.log(biguint64.length); // 2 console.log(biguint64.bytes_per_element); // 8 // from an array var arr = new biguint64array([21n,31n]); console.log(arr[1]); // 31n // from another typedarray var x = new biguint64array([21n, 31n]); var y = new biguint64array(x); console.log(y[0]); // 21n // from an arraybuffer var buffer = new arraybuffer(32); var z = new biguint64array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1n, 2n, 3n]; }(); var biguint64 = new biguint64array(iterable); // biguint64array[1n, 2n, 3n] specifications specificat...
Date() constructor - JavaScript
syntax new date() new date(value) new date(datestring) new date(year, monthindex [, day [, hours [, minutes [, seconds [, milliseconds]]]]]) note: the only correct way to instantiate a new date object is by using the new operator.
...(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.
..."1970-01-01") are treated as utc, not local.
... examples several ways to create a date object the following examples show several ways to create javascript dates: note: parsing of date strings with the date constructor (and date.parse, they are equivalent) is strongly discouraged due to browser differences and inconsistencies.
Date.prototype.toLocaleString() - JavaScript
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.
...arabic 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: 'l...
... most notably, the ie and edge browsers insert bidirectional control characters around dates, so the output text will flow properly when concatenated with other text.
... for this reason, you cannot expect to be able to compare the results of tolocalestring() to a static value: "1/1/2019, 01:00:00" === new date("2019-01-01t01:00:00z").tolocalestring("en-us"); // true in firefox and others // false in ie and edge note: see also this stackoverflow thread for more details and examples.
Float32Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... float32array.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found.
... float32array.prototype.findindex() returns the found index in the array, if an element in the array satisfies the provided testing function or -1 if not found.
... examples different ways to create a float32array // from a length var float32 = new float32array(2); float32[0] = 42; console.log(float32[0]); // 42 console.log(float32.length); // 2 console.log(float32.bytes_per_element); // 4 // from an array var arr = new float32array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new float32array([21, 31]); var y = new float32array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(16); var z = new float32array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var float32 = new float32array(iterable); // float32array[1, 2, 3] specifications specification ecmascript...
Float64Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... float64array.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found.
... float64array.prototype.findindex() returns the found index in the array, if an element in the array satisfies the provided testing function or -1 if not found.
... examples different ways to create a float64array // from a length var float64 = new float64array(2); float64[0] = 42; console.log(float64[0]); // 42 console.log(float64.length); // 2 console.log(float64.bytes_per_element); // 8 // from an array var arr = new float64array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new float64array([21, 31]); var y = new float64array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(32); var z = new float64array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var float64 = new float64array(iterable); // float64array[1, 2, 3] specifications specification ecmascript...
Function - JavaScript
examples difference between function constructor and function declaration functions created with the function constructor do not create closures to their creation contexts; they always are created in the global scope.
... when running them, they will only be able to access their own local variables and global ones, not the ones from the scope in which the function constructor was created.
...;'); // this |x| refers global |x| } function createfunction2() { var x = 20; function f() { return x; // this |x| refers local |x| above } return f; } var f1 = createfunction1(); console.log(f1()); // 10 var f2 = createfunction2(); console.log(f2()); // 20 while this code works in web browsers, f1() will produce a referenceerror in node.js, as x will not be found.
... this is because the top-level scope in node is not the global scope, and x will be local to the module.
Int16Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... int16array.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found.
... int16array.prototype.findindex() returns the found index in the array, if an element in the array satisfies the provided testing function or -1 if not found.
... examples different ways to create an int16array // from a length var int16 = new int16array(2); int16[0] = 42; console.log(int16[0]); // 42 console.log(int16.length); // 2 console.log(int16.bytes_per_element); // 2 // from an array var arr = new int16array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new int16array([21, 31]); var y = new int16array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new int16array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var int16 = new int16array(iterable); // int16array[1, 2, 3] specifications specification ecmascript (ecma-262)th...
Int32Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... int32array.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found.
... int32array.prototype.findindex() returns the found index in the array, if an element in the array satisfies the provided testing function or -1 if not found.
... examples different ways to create an int32array // from a length var int32 = new int32array(2); int32[0] = 42; console.log(int32[0]); // 42 console.log(int32.length); // 2 console.log(int32.bytes_per_element); // 4 // from an array var arr = new int32array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new int32array([21, 31]); var y = new int32array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(16); var z = new int32array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var int32 = new int32array(iterable); // int32array[1, 2, 3] specifications specification ecmascript (ecma-262)t...
Int8Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... int8array.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found.
... int8array.prototype.findindex() returns the found index in the array, if an element in the array satisfies the provided testing function or -1 if not found.
... examples different ways to create an int8array // from a length var int8 = new int8array(2); int8[0] = 42; console.log(int8[0]); // 42 console.log(int8.length); // 2 console.log(int8.bytes_per_element); // 1 // from an array var arr = new int8array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new int8array([21, 31]); var y = new int8array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new int8array(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var int8 = new int8array(iterable); // int8array[1, 2, 3] specifications specification ecmascript (ecma-262)the defi...
JSON.parse() - JavaScript
exceptions throws a syntaxerror exception if the string to parse is not valid json.
... walk({ "": j }, "") : j; } // if the text is not json parseable, then a syntaxerror is thrown.
... if the reviver only transforms some values and not others, be certain to return all untransformed values as-is, otherwise, they will be deleted from the resulting object.
...}); // 1 // 2 // 4 // 6 // 5 // 3 // "" json.parse() does not allow trailing commas // both will throw a syntaxerror json.parse('[1, 2, 3, 4, ]'); json.parse('{"foo" : 1, }'); json.parse() does not allow single quotes // will throw a syntaxerror json.parse("{'foo': 1}"); specifications specification ecmascript (ecma-262)the definition of 'json.parse' in that specification.
Math.max() - JavaScript
if at least one of the arguments cannot be converted to a number, nan is returned.
... description because math is not a constructor, max() is a static method of math (you always use it as math.max(), rather than as a method of an instanced math object).
... if at least one of arguments cannot be converted to a number, the result is nan.
...the reduce solution does not have this problem.
Number.prototype.toExponential() - JavaScript
the toexponential() method returns a string representing the number object in exponential notation.
... return value a string representing the given number object in exponential notation with one digit before the decimal point, rounded to fractiondigits digits after the decimal point.
...values between 0 and 20, inclusive, will not cause a rangeerror.
... typeerror if this method is invoked on an object that is not a number.
Number.prototype.toLocaleString() - JavaScript
english locale checking for support for locales and options arguments the locales and options arguments are not supported in all browsers yet.
... to check for support in es5.1 and later implementations, the requirement that illegal language tags are rejected with a rangeerror exception can be used: function tolocalestringsupportslocales() { var number = 0; try { number.tolocalestring('i'); } catch (e) { return e.name === 'rangeerror'; } return false; } prior to es5.1, implementations were not required to throw a range error exception if tolocalestring is called with arguments.
... in all hosts, including those supporting ecma-262 prior to ed 5.1, is to test for the features specified in ecma-402 that are required to support regional options for number.prototype.tolocalestring directly: function tolocalestringsupportsoptions() { return !!(typeof intl == 'object' && intl && typeof intl.numberformat == 'function'); } this tests for a global intl object, checks that it's not null and that it has a numberformat property that is a function.
...chinese decimal console.log(number.tolocalestring('zh-hans-cn-u-nu-hanidec')); // → 一二三,四五六.七八九 // when requesting a language that may not be supported, such as // balinese, include a fallback language, in this case indonesian console.log(number.tolocalestring(['ban', 'id'])); // → 123.456,789 using options the results provided by tolocalestring can be customized using the options argument: var number = 123456.789; // request a currency format console.log(number.tolocalestring('de-de', { style: 'currency', currency: 'eur' }))...
Number.prototype.toString() - JavaScript
(it does not inherit object.prototype.tostring()).
... if the radix is not specified, the preferred radix is assumed to be 10.
...this is the case even if the radix is 2; the string returned is the positive binary representation of the numobj preceded by a - sign, not the two's complement of the numobj.
... if the numobj is not a whole number, the 'dot' sign is used to separate the decimal places.
Object.keys() - JavaScript
polyfill to add compatible object.keys support in older environments that do not natively support it, copy the following snippet: // from /docs/web/javascript/reference/global_objects/object/keys if (!object.keys) { object.keys = (function() { 'use strict'; var hasownproperty = object.prototype.hasownproperty, hasdontenumbug = !({ tostring: null }).propertyisenumerable('tostring'), dontenums = [ 'tostring', 'tolocalestring', ...
... var result = [], prop, i; for (prop in obj) { if (hasownproperty.call(obj, prop)) { result.push(prop); } } if (hasdontenumbug) { for (i = 0; i < dontenumslength; i++) { if (hasownproperty.call(obj, dontenums[i])) { result.push(dontenums[i]); } } } return result; }; }()); } please note that the above code includes non-enumerable keys in ie7 (and maybe ie8), when passing in an object from a different window.
... non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
... // in es5 object.keys('foo'); // typeerror: "foo" is not an object // in es2015+ object.keys('foo'); // ["0", "1", "2"] specifications specification ecmascript (ecma-262)the definition of 'object.keys' in that specification.
Object.preventExtensions() - JavaScript
note that the properties of a non-extensible object, in general, may still be deleted.
... attempting to add new properties to a non-extensible object will fail, either silently or by throwing a typeerror (most commonly, but not exclusively, when in strict mode).
...fixed.__proto__ = { oh: 'hai' }; non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
... object.preventextensions(1); // typeerror: 1 is not an object (es5 code) object.preventextensions(1); // 1 (es2015 code) specifications specification ecmascript (ecma-262)the definition of 'object.preventextensions' in that specification.
Object.seal() - JavaScript
making all properties non-configurable also prevents them from being converted from data properties to accessor properties and vice versa, but it does not prevent the values of data properties from being changed.
... attempting to delete or add properties to a sealed object, or to convert a data property to accessor or vice versa, will fail, either silently or by throwing a typeerror (most commonly, although not exclusively, when in strict mode code).
...object.defineproperty(obj, 'ohai', { value: 17 }); // throws a typeerror object.defineproperty(obj, 'foo', { value: 'eit' }); // changes existing property value non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
... object.seal(1); // typeerror: 1 is not an object (es5 code) object.seal(1); // 1 (es2015 code) specifications specification ecmascript (ecma-262)the definition of 'object.seal' in that specification.
Promise() constructor - JavaScript
the promise constructor is primarily used to wrap functions that do not already support promises.
... therefore, the code within the executor has the opportunity to perform some operation and then reflect the operation's outcome(if the value is not another promise object) as either "fulfilled" or "rejected" by terminating with an invocation of either the resolutionfunc or the rejectionfunc, respectively.
... resolutionfunc(value) // call on fulfilled rejectionfunc(reason) // call on rejected the returned value can be another promise object, in which case the promise gets dynamically inserted into the chain.
...note that if you call resolutionfunc or rejectionfunc and pass another promise object as an argument, you can say that it is "resolved", but still cannot be said to be "settled".
Promise.prototype.finally() - JavaScript
the finally() method is very similar to calling .then(onfinally, onfinally) however there are a couple of differences: when creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it a finally callback will not receive any argument, since there's no reliable means of determining if the promise was fulfilled or rejected.
... this use case is for precisely when you do not care about the rejection reason, or the fulfillment value, and so there's no need to provide it.
... note: a throw (or returning a rejected promise) in the finally callback will reject the new promise with the rejection reason specified when calling throw.
...when console = {} */ }) .finally(function() { isloading = false; }); please do not add polyfills on mdn pages.
Reflect.defineProperty() - JavaScript
return value a boolean indicating whether or not the property was successfully defined.
... exceptions a typeerror, if target is not an object.
... one key difference: object.defineproperty returns the object or throws a typeerror if the property has not been successfully defined.
... reflect.defineproperty, however, simply returns a boolean indicating whether or not the property was successfully defined.
Reflect.isExtensible() - JavaScript
return value a boolean indicating whether or not the target is extensible.
... exceptions a typeerror, if target is not an object.
...let frozen = object.freeze({}) reflect.isextensible(frozen) // === false difference to object.isextensible() if the target argument to this method is not an object (a primitive), then it will cause a typeerror.
... reflect.isextensible(1) // typeerror: 1 is not an object object.isextensible(1) // false specifications specification ecmascript (ecma-262)the definition of 'reflect.isextensible' in that specification.
Reflect.preventExtensions() - JavaScript
return value a boolean indicating whether or not the target was successfully set to prevent extensions.
... exceptions a typeerror, if target is not an object.
...reflect.preventextensions(empty) reflect.isextensible(empty) // === false difference from object.preventextensions() if the target argument to this method is not an object (a primitive), then it will cause a typeerror.
... reflect.preventextensions(1) // typeerror: 1 is not an object object.preventextensions(1) // 1 specifications specification ecmascript (ecma-262)the definition of 'reflect.preventextensions' in that specification.
Reflect.setPrototypeOf() - JavaScript
it sets the prototype (i.e., the internal [[prototype]] property) of a specified object to another object or to null, and returns true if the operation was successful, or false otherwise.
... return value a boolean indicating whether or not the prototype was successfully set.
... exceptions a typeerror, if target is not an object or if prototype is neither an object nor null.
...reflect.setprototypeof({}, null) // true // returns false if target is not extensible.
Reflect - JavaScript
reflect is not a function object, so it's not constructible.
... description unlike most global objects, reflect is not a constructor.
... you cannot use it with a new operator or invoke the reflect object as a function.
... reflect.ownkeys(target) returns an array of the target object's own (not inherited) property keys.
RegExp.$1-$9 - JavaScript
description the $1, ..., $9 properties are static, they are not a property of an individual regular expression object.
...when used this way, do not prepend them with regexp.
...when parentheses are not included in the regular expression, the script interprets $n's literally (where n is a positive integer).
...regexp.$1 : '0'; number; // "24" please note that any operation involving the usage of other regular expressions between a re.test(str) call and the regexp.$n property, might have side effects, so that accessing these special properties should be done instantly, otherwise the result might be unexpected.
String.prototype.toLocaleUpperCase() - JavaScript
tolocaleuppercase() does not affect the value of the string itself.
... in most cases, this will produce the same result as touppercase(), but for some locales, such as turkish, whose case mappings do not follow the default case mappings in unicode, there may be a different result.
... also notice that conversion is not necessarily a 1:1 character mapping, as some characters might result in two (or even more) characters when transformed to upper-case.
...this also implies that the conversion is not stable, so i.e.
TypedArray.prototype.indexOf() - JavaScript
the indexof() method returns the first index at which a given element can be found in the typed array, or -1 if it is not present.
...if the index is greater than or equal to the typed array's length, -1 is returned, which means the typed array will not be searched.
...note: if the provided index is negative, the typed array is still searched from front to back.
... return value the first index of the element in the array; -1 if not found.
TypedArray.prototype.lastIndexOf() - JavaScript
the lastindexof() method returns the last index at which a given element can be found in the typed array, or -1 if it is not present.
...note that even when the index is negative, the typed array is still searched from back to front.
...the typed array will not be searched.
... return value the last index of the element in the array; -1 if not found.
TypedArray.prototype.map() - JavaScript
mapfn is invoked only for indexes of the typed array which have assigned values; it is not invoked for indexes that are undefined, those which have been deleted, or which have never been assigned values.
... map() does not mutate the typed array on which it is called (although mapfn, if invoked, may do so).
...elements which are appended to the array after the call to map() begins will not be visited by mapfn.
... if existing elements of the typed array are changed, or deleted, their value as passed to mapfn will be the value at the time map() visits them; elements that are deleted are not visited.
TypedArray.prototype.slice() - JavaScript
slice extracts up to but not including end.
... description the slice method does not alter.
... if a new element is added to either typed array, the other typed array is not affected.
... 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.
Uint16Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... uint16array.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found.
... uint16array.prototype.findindex() returns the found index in the array, if an element in the array satisfies the provided testing function or -1 if not found.
... examples different ways to create a uint16array // from a length var uint16 = new uint16array(2); uint16[0] = 42; console.log(uint16[0]); // 42 console.log(uint16.length); // 2 console.log(uint16.bytes_per_element); // 2 // from an array var arr = new uint16array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint16array([21, 31]); var y = new uint16array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint16array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint16 = new uint16array(iterable); // uint16array[1, 2, 3] specifications specification ecmascript (ecma-...
Uint32Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... uint32array.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found.
... uint32array.prototype.findindex() returns the found index in the array, if an element in the array satisfies the provided testing function or -1 if not found.
... examples different ways to create a uint32array // from a length var uint32 = new uint32array(2); uint32[0] = 42; console.log(uint32[0]); // 42 console.log(uint32.length); // 2 console.log(uint32.bytes_per_element); // 4 // from an array var arr = new uint32array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint32array([21, 31]); var y = new uint32array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(16); var z = new uint32array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint32 = new uint32array(iterable); // uint32array[1, 2, 3] specifications specification ecmascript (ecma...
Uint8Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... uint8array.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found.
... uint8array.prototype.findindex() returns the found index in the array, if an element in the array satisfies the provided testing function or -1 if not found.
... examples different ways to create a uint8array // from a length var uint8 = new uint8array(2); uint8[0] = 42; console.log(uint8[0]); // 42 console.log(uint8.length); // 2 console.log(uint8.bytes_per_element); // 1 // from an array var arr = new uint8array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint8array([21, 31]); var y = new uint8array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint8array(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint8 = new uint8array(iterable); // uint8array[1, 2, 3] specifications specification ecmascript (ecma-262)th...
Uint8ClampedArray - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... uint8clampedarray.prototype.find() returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found.
... uint8clampedarray.prototype.findindex() returns the found index in the array, if an element in the array satisfies the provided testing function or -1 if not found.
... examples different ways to create a uint8clampedarray // from a length var uintc8 = new uint8clampedarray(2); uintc8[0] = 42; uintc8[1] = 1337; console.log(uintc8[0]); // 42 console.log(uintc8[1]); // 255 (clamped) console.log(uintc8.length); // 2 console.log(uintc8.bytes_per_element); // 1 // from an array var arr = new uint8clampedarray([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint8clampedarray([21, 31]); var y = new uint8clampedarray(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint8clampedarray(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uintc8 = new uint8clampedarray(iterable); // uint8clampedarray[1, 2, 3] specifications specificat...
WebAssembly.CompileError - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jscompileerrorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0compileerror() constructorchrome full support 57edge full support 16firefox full support ...
... 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios ...
...t 11samsung internet android full support 7.0nodejs full support 8.0.0legend full support full support no support no supportsee implementation notes.see implementation notes.
WebAssembly.Instance.prototype.exports - JavaScript
var importobject = { imports: { imported_func: function(arg) { console.log(arg); } } }; webassembly.instantiatestreaming(fetch('simple.wasm'), importobject) .then(obj => obj.instance.exports.exported_func()); note: you can also find this example as instantiate-streaming.html on github (view it live also).
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsexportschrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0legend full support full support no support no supportsee implementation...
... notes.see implementation notes.
WebAssembly.LinkError - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jslinkerrorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0linkerror() constructorchrome full support 57edge full support 16firefox full support ...
... 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios ...
...t 11samsung internet android full support 7.0nodejs full support 8.0.0legend full support full support no support no supportsee implementation notes.see implementation notes.
WebAssembly.Memory.prototype.grow() - JavaScript
var memory = new webassembly.memory({initial:1, maximum:10}); we can then grow the instance by one page like so: const bytesperpage = 64 * 1024; console.log(memory.buffer.bytelength / bytesperpage); // "1" console.log(memory.grow(1)); // "1" console.log(memory.buffer.bytelength / bytesperpage); // "2" note the return value of grow() here is the previous number of webassembly pages.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsgrowchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0legend full support full support no support no supportsee implementation...
... notes.see implementation notes.
WebAssembly.Module.exports() - JavaScript
exceptions if module is not a webassembly.module object instance, a typeerror is thrown.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsexportschrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0legend full support full support no support no supportsee implementation...
... notes.see implementation notes.
WebAssembly.Module.imports() - JavaScript
exceptions if module is not a webassembly.module object instance, a typeerror is thrown.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsimportschrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0legend full support full support no support no supportsee implementation...
... notes.see implementation notes.
WebAssembly.RuntimeError - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsruntimeerrorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0runtimeerror() constructorchrome full support 57edge full support 16firefox full support ...
... 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios ...
...t 11samsung internet android full support 7.0nodejs full support 8.0.0legend full support full support no support no supportsee implementation notes.see implementation notes.
WebAssembly.Table.prototype.get() - JavaScript
webassembly.instantiatestreaming(fetch('table.wasm')) .then(function(obj) { var tbl = obj.instance.exports.tbl; console.log(tbl.get(0)()); // 13 console.log(tbl.get(1)()); // 42 }); note how you've got to include a second function invocation operator at the end of the accessor to actually retrieve the value stored inside the reference (e.g.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsgetchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0legend full support full support no support no supportsee implementation...
... notes.see implementation notes.
escape() - JavaScript
warning: although escape() is not strictly deprecated (as in "removed from the web standards"), it is defined in annex b of the ecma-262 standard, whose introduction states: … all of the language features and behaviours specified in this annex have one or more undesirable characteristics and in the absence of legacy usage would be removed from this specification.
... … … programmers should not use or assume the existence of these features and behaviours when writing new ecmascript code.
... note: this function was used mostly for url queries (the part of a url following ?)—not for escaping ordinary string literals, which use the format "\xhh".
... please do not add polyfills to reference pages.
null - JavaScript
null is not an identifier for a property of the global object, like undefined can be.
... // foo does not exist.
... it is not defined and has never been initialized: foo; //referenceerror: foo is not defined // foo is known to exist now but it has no type or value: var foo = null; foo; //null examples difference between null and undefined when checking for null or undefined, beware of the differences between equality (==) and identity (===) operators, as the former performs type-conversion.
... typeof null // "object" (not "null" for legacy reasons) typeof undefined // "undefined" null === undefined // false null == undefined // true null === null // true null == null // true !null // true isnan(1 + null) // false isnan(1 + undefined) // true specifications specification ecmascript (ecma-262)the definition of 'null value' in that specification.
parseFloat() - JavaScript
if this argument is not a string, then it is converted to one using the tostring abstract operation.
... or nan when the first non-whitespace character cannot be converted to a number.
... description parsefloat is a top-level function and not a method of any object.
... if the argument’s first character can’t be converted to a number (it’s not any of the above characters), parsefloat returns nan.
Logical OR assignment (||=) - JavaScript
syntax expr1 ||= expr2 description short-circuit evaluation the logical or operator works like this: x || y; // returns x when x is truthy // returns y when x is not truthy the logical or operator short-circuits: the second operand is only evaluated if the first operand doesn’t already determine the result.
...in other words, x ||= y is equivalent to: x || (x = y); and not equivalent to the following which would always perform an assignment: x = x || y; note that this behavior is different to mathematical and bitwise assignment operators.
... examples setting default content if the "lyrics" element is empty, set the innerhtml to a default value: document.getelementbyid('lyrics').innerhtml ||= '<i>no lyrics.</i>' here the short-circuit is especially beneficial, since the element will not be updated unnecessarily and won't cause unwanted side-effects such as additional parsing or rendering work, or loss of focus, etc.
... note: pay attention to the value returned by the api you're checking against.
Unary plus (+) - JavaScript
syntax operator: +x description 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.
...negative numbers are supported (though not for hex).
...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 typeerror: cannot convert bigint value to number specifications specification ecmascript (ecma-262)the definition of 'unary plus operator' in that specification.
class expression - JavaScript
there are several differences between class expressions and class statements, however: class expressions may omit the class name ("binding identifier"), which is not possible with class statements.
...this is not the case with class statements.
... 'use strict'; let foo = class {}; // constructor property is optional foo = class {}; // re-declaration is allowed typeof foo; // returns "function" typeof class {}; // returns "function" foo instanceof object; // true foo instanceof function; // true class foo {} // throws syntaxerror (class declarations do not allow re-declaration) examples a simple class expression this is just a simple anonymous class expression which you can refer to using the variable foo.
... const foo = class namedfoo { constructor() {} whoisthere() { return namedfoo.name; } } const bar = new foo(); bar.whoisthere(); // "namedfoo" namedfoo.name; // referenceerror: namedfoo is not defined foo.name; // "namedfoo" specifications specification ecmascript (ecma-262)the definition of 'class definitions' in that specification.
Function expression - JavaScript
syntax the expression is not allowed at the start of a statement.
... function expression hoisting function expressions in javascript are not hoisted, unlike function declarations.
... you can't use function expressions before you create them: console.log(nothoisted) // undefined // even though the variable name is hoisted, the definition isn't.
...nothoisted(); // typeerror: nothoisted is not a function var nothoisted = function() { console.log('bar'); }; named function expression if you want to refer to the current function inside the function body, you need to create a named function expression.
empty - JavaScript
see the following example with an empty loop body: let arr = [1, 2, 3]; // assign all array values to 0 for (let i = 0; i < arr.length; arr[i++] = 0) /* empty statement */ ; console.log(arr); // [0, 0, 0] unintentional usage it is a good idea to comment intentional use of the empty statement, as it is not really obvious to distinguish from a normal semicolon.
... in the following example, the usage is probably not intentional: if (condition); // caution, this "if" does nothing!
... if three is true, nothing will happen, four does not matter, and also the launchrocket() function in the else case will not be executed.
... if (one) doone(); else if (two) dotwo(); else if (three) ; // nothing here else if (four) dofour(); else launchrocket(); specifications specification ecmascript (ecma-262)the definition of 'empty statement' in that specification.
JavaScript typed arrays - JavaScript
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.
...there's not a lot we can do with it, though.
... note: the data structure alignment in a c structure is platform-dependent.
MathML attribute reference - MathML
notes: the mathml <mstyle> and <math> elements accept all attributes of all mathml presentation elements.
... see values for notes on values and units in mathml.
... unimplemented alignmentscope <mtable> a boolean value specifying whether table columns should act as alignment scopes or not.
... notation <menclose> a list of notations, separated by white space, to apply to the child elements.
<menclose> - MathML
the mathml <menclose> element renders its content inside an enclosing notation specified by the notation attribute.
... notation a list of notations, separated by white space, to apply to the child elements.
... the symbols are each drawn as if the others are not present, and therefore may overlap.
... a2 + b2 vertical strikeout line through contents horizontalstrike a2 + b2 horizontal strikeout line through contents madruwb a2 + b2 arabic factorial symbol updiagonalarrow a2 + b2 diagonal arrow phasorangle a2 + b2 phasor angle examples <math> <menclose notation="circle box"> <mi> x </mi> <mo> + </mo> <mi> y </mi> </menclose> </math> specifications specification status comment mathml 3.0the definition of 'menclose' in that specification.
MathML element reference - MathML
the term presentation markup is used to describe the layout structure of mathematical notation whereas content markup provides the underlying mathematical meaning and is not supposed to be rendered by the mathml parser (see bug 276028).
...ion> (binded actions to sub-expressions) <maligngroup> (alignment group) <malignmark> (alignment points) e <menclose> (enclosed contents) <merror> (enclosed syntax error messages) f <mfenced> (parentheses) <mfrac> (fraction) g <mglyph> (displaying non-standard symbols) i <mi> (identifier) l <mlabeledtr> (labeled row in a table or a matrix) <mlongdiv> (long division notation) m <mmultiscripts> (prescripts and tensor indices) n <mn> (number) o <mo> (operator) <mover> (overscript) p <mpadded> (space around content) <mphantom> (invisible content with reserved space) r <mroot> (radical with specified index) <mrow> (grouped sub-expressions) s <ms> (string literal) <mscarries> (annotations such as carries) <mscarry> (single carry, ch...
...ements) <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 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> ...
Optimizing startup performance - Web Performance
this article offers tips and suggestions to help you achieve that goal, both when writing a new app and when porting an app from another platform to the web.
...that means not running all your startup code in a single event handler on the app's main thread.
...if the app is being run in a browser, it's possible the user may get an "unresponsive app" or "slow script" notification.
...don't do one chunk of data after another; do them all at once when possible!
Performance budgets - Web Performance
the warning level allows you to be proactive and plan any tech debt, while not blocking development or deploys.
... the error level is an upper bound limit, where changes will have a negative and noticeable impact.
...when defining metrics, you should focus on user experience, which will dictate not only the bounce or conversion rate but how likely is that user to return.
...webpack), has performance features that will notify you when assets exceed specified limits.
Privacy, permissions, and information security
modern browsers take steps to help prevent fingerprinting-based attacks by either not allowing information to be accessed or, where the information must be made available, by introducing variations that prevent it from being used for identification purposes.
...public key with the server going forward in order to decrease the likelihood of man-in-the-middle attacks http strict transport security (hsts) hsts is used by servers to let them protect themselves from protocol downgrade and cookie hijack attacks by letting sites tell clients that they can only use https to communicate with the server http/2 while http/2 technically does not have to use encryption, most browser developers are only supporting it when used with https, so it can be thought of in that regard as being security-related permissions api provides a way to determine the status of permissions for the current browser context transport layer security (tls); formerly known as secure sockets layer (ssl) tls provides security and privacy by e...
...this is the technology behind the https (hypertext transport protocol secured) protocol not all of these are generally directly used within code; notably, the permissions api, feature policy, and the allow attribute on <iframe> elements are primary tools directly used by code to help secure a site and its content.
... keeping personal data safe managing site permissions bringing it all together <using feature policy with permissions and so forth; how to use them together, how they interact, etc> permission requests in <iframe> elements things can get tricky when your web app uses the <iframe> element to embed content from another site inside your own, especially if the document you load into the frame has its own permission needs to consider.
accumulate - SVG: Scalable Vector Graphics
the accumulate attribute controls whether or not an animation is cumulative.
... four elements are using this attribute: <animate>, <animatecolor>, <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.
baseline-shift - SVG: Scalable Vector Graphics
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, 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.
... candidate recommendation refers to the definition in css inline layout and notes that vertical-align should be preferred.
begin - SVG: Scalable Vector Graphics
WebSVGAttributebegin
the element's animation start time is defined relative to the begin or active end of another animation.
... a valid syncbase-value consists of an id reference to another animation element followed by a dot and either begin or end to identify whether to synchronize with the beginning or active end of the referenced animation element.
...all valid events (not necessarily supported by all elements) are defined by the dom and html specifications.
...the target element did not exist), the <discard> element itself is still removed after the activation.
clip-path - SVG: Scalable Vector Graphics
note: as a presentation attribute clip-path can be used as a css property.
... as a presentation attribute, it can be applied to any element but it has noticeable effects mostly on the following nineteen elements: <a>, <circle>, <clippath>, <ellipse>, <g>, <glyph>, <image>, <line>, <marker>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <svg>, <symbol>, <text>, <use> html,body,svg { height:100% } <svg viewbox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <clippath id="myclip" clippathunits="objectboundingbox"> <circle cx=".5" cy=".5" r=".5" /> </clippath> <!-- top-left: apply a custom defined clipping path --> <rect x="1" y="1" width="8" height="8" stroke="green" clip-path="url(#myclip)" /> <!-- top-right: apply a css basic shape on a fill-box geometry.
...this is the same as having a custom clipping path with a clippathunits set to userspaceonuse --> <rect x="11" y="11" width="8" height="8" stroke="green" clip-path="circle() view-box" /> </svg> usage notes value <url> | [ <basic-shape> || <geometry-box> ] | none default value none animatable yes <geometry-box> an extra information to tell how a <basic-shape> is applied to an element: fill-box indicates to use the object bounding box; stroke-box indicates to use the object bounding box extended with the stroke; view-box indicates to use the nearest sv...
... note: for more details on the clip-path syntax, see the css property clip-path reference page.
end - SVG: Scalable Vector Graphics
WebSVGAttributeend
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> usage notes default value none value <end-value-list> animatable no the <end-value-list> is a semicolon-separated list of values.
...the element's animation end time is defined relative to the begin or active end of another animation.
... a valid syncbase-value consists of an id reference to another animation element followed by a dot and either begin or end to identify whether to synchronize with the beginning or active end of the referenced animation element.
...all valid events (not necessarily supported by all elements) are defined by the dom and html specifications.
externalResourcesRequired - SVG: Scalable Vector Graphics
the externalresourcesrequired attribute specifies whether referenced resources that are not part of the current document are required for proper rendering of the given container or graphics element.
... the externalresourcesrequired attribute is not inheritable (from a sense of attribute value inheritance), but if set on a container element, its value will apply to all elements within the container.
... usage notes value false | true default value false animatable no true this value indicates that resources external to the current document are required.
... if an external resource is not available, progressive rendering is suspended, the document's svgload event is not fired and the animation timeline does not begin until that resource and all other required resources become available, have been parsed and are ready to be rendered.
glyph-orientation-horizontal - SVG: Scalable Vector Graphics
otherwise, if the value of this attribute is not a multiple of 180 degrees, then the current text position is incremented according to the vertical metrics of the glyph.
... note: as a presentation attribute, glyph-orientation-horizontal can be used as a css property.
... as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> context notes value <angle> default value 0deg animatable no <angle> the value of the angle is restricted to 0, 90, 180, and 270 degrees.
... if another angle is specified, it is rounded to the closest of the permitted values.
id - SVG: Scalable Vector Graphics
WebSVGAttributeid
<svg width="120" height="120" viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <style type="text/css"> <![cdata[ #smallrect { stroke: #000066; fill: #00cc00; } ]]> </style> <rect id="smallrect" x="10" y="10" width="100" height="100" /> </svg> usage notes value <id> default value none animatable no <id> specifies the element's id.
... the id must be unique within the node tree, must not be an empty string, and must not contain any whitespace characters.
... note: you should avoid the use of id values that would be parsed as an svg view specification (e.g., mydrawing.svg#svgview(viewbox(0,200,1000,1000))) or a basic media fragment when used as a url target fragment.
...a stand-alone svg document uses xml 1.0 syntax, which specifies that valid ids only include designated characters (letters, digits, and a few punctuation marks), and do not start with a digit, a full stop (.) character, or a hyphen-minus (-) character.
in - SVG: Scalable Vector Graphics
WebSVGAttributein
fourteen elements are using this attribute: <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <fegaussianblur>, <femergenode>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile> usage notes value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primitive-reference> default value sourcegraphic for first filter primitive, otherwise result of previous filter primitive animatable yes sourcegraphic this keyword represents the graphics elements that were the original input into the <filter>...
...in many cases, the fillpaint 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.
...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.
... html <div style="width: 420px; height: 220px;"> <svg style="width:200px; height:200px; display: inline;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="backgroundmultiply"> <!-- this will not work.
marker-end - SVG: Scalable Vector Graphics
in this case, if the value of marker-start and marker-end are both not none, then two markers will be rendered on that final vertex.
... note: as a presentation attribute, marker-end can be used as a css property.
.../svg"> <defs> <marker id="triangle" viewbox="0 0 10 10" refx="1" refy="5" markerunits="strokewidth" markerwidth="10" markerheight="10" orient="auto"> <path d="m 0 0 l 10 5 l 0 10 z" fill="#f00"/> </marker> </defs> <polyline fill="none" stroke="black" points="20,100 40,60 70,80 100,20" marker-end="url(#triangle)"/> </svg> usage notes value none | <marker-ref> default value none animatable yes none indicates that no marker symbol shall be drawn at the final vertex.
...if the reference is not valid, then no marker will be drawn.
marker-start - SVG: Scalable Vector Graphics
in this case, if the value of marker-start and marker-end are both not none, then two markers will be rendered on that final vertex.
... note: as a presentation attribute, marker-start can be used as a css property.
...vg"> <defs> <marker id="triangle" viewbox="0 0 10 10" refx="1" refy="5" markerunits="strokewidth" markerwidth="10" markerheight="10" orient="auto"> <path d="m 0 0 l 10 5 l 0 10 z" fill="#f00"/> </marker> </defs> <polyline fill="none" stroke="black" points="20,100 40,60 70,80 100,20" marker-start="url(#triangle)"/> </svg> usage notes value none | <marker-ref> default value none animatable yes none indicates that no marker symbol shall be drawn at the first vertex.
...if the reference is not valid, then no marker will be drawn.
order - SVG: Scalable Vector Graphics
WebSVGAttributeorder
filter id="emboss2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" seed="0" /> <feconvolvematrix kernelmatrix="3 0 0 0 0 0 0 0 -4" order="1 1 1"/> </filter> <rect x="0" y="0" width="200" height="200" style="filter:url(#emboss1);" /> <rect x="0" y="0" width="200" height="200" style="filter:url(#emboss2); transform: translatex(220px);" /> </svg> usage notes value <number-optional-number> default value 3 animatable yes <number-optional-number> this value indicates the number of cells in each dimension for the kernel matrix.
...values that are not integers will be truncated, i.e.
...if no second number is not provided, it defaults to the first number.
... it is recommended that only small values (e.g., 3) be used; higher values may result in very high cpu overhead and usually do not produce results that justify the impact on performance.
preserveAspectRatio - SVG: Scalable Vector Graphics
the alignment value must be one of the following keywords: none do not force uniform scaling.
...note that if <align> is none, then the optional <meetorslice> value is ignored.
...reference the meet or slice reference is optional and, if provided, must be one of the following keywords: meet (the default) - scale the graphic such that: aspect ratio is preserved the entire viewbox is visible within the viewport the viewbox is scaled up as much as possible, while still meeting the other criteria in this case, if the aspect ratio of the graphic does not match the viewport, some of the viewport will extend beyond the bounds of the viewbox (i.e., the area into which the viewbox will draw will be smaller than the viewport).
... slice - scale the graphic such that: aspect ratio is preserved the entire viewport is covered by the viewbox the viewbox is scaled down as much as possible, while still meeting the other criteria in this case, if the aspect ratio of the viewbox does not match the viewport, some of the viewbox will extend beyond the bounds of the viewport (i.e., the area into which the viewbox will draw is larger than the viewport).
restart - SVG: Scalable Vector Graphics
WebSVGAttributerestart
the restart attribute specifies whether or not an animation can restart.
...vg viewbox="0 0 220 200" xmlns="http://www.w3.org/2000/svg"> <rect y="30" width="100" height="100"> <animate attributetype="xml" attributename="y" from="30" to="100" dur="5s" repeatcount="1" restart="always" /> </rect> <rect x="120" y="30" width="100" height="100"> <animate attributetype="xml" attributename="y" from="30" to="100" dur="5s" repeatcount="1" restart="whennotactive"/> </rect> <a id="restart"><text y="20">restart animation</text></a> </svg> document.getelementbyid("restart").addeventlistener("click", evt => { document.queryselectorall("animate").foreach(element => { element.beginelement(); }); }); usage notes value always | whennotactive | never default value always animatable no always th...
... whennotactive this value indicates that the animation can only be restarted when it is not active (i.e.
... never this value indicates that the animation cannot be restarted for the time the document is loaded.
textLength - SVG: Scalable Vector Graphics
the user agent will ensure that the text does not extend farther than that distance, using the method or methods specified by the lengthadjust attribute.
... by using textlength, you can ensure that your svg text displays at the same width regardless of conditions including web fonts failing to load (or not having loaded yet).
... four elements are using this attribute: <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 200 60" xmlns="http://www.w3.org/2000/svg"> <text y="20" textlength="6em">small text length</text> <text y="40" textlength="120%">big text length</text> </svg> usage notes value <length-percentage> | <number> default value none animatable yes <length-percentage> this value specifies the width of the space the text will be adjusted to occupy as absolute length or percentage.
...note that we have to dive into textlength to get its baseval property; textlength is stored as an svglength object, so we can't treat it like a plain number.
transform - SVG: Scalable Vector Graphics
s="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g fill="grey" transform="rotate(-10 50 100) translate(-36 45.5) skewx(40) scale(1 0.5)"> <path id="heart" d="m 10,30 a 20,20 0,0,1 50,30 a 20,20 0,0,1 90,30 q 90,60 50,90 q 10,60 10,30 z" /> </g> <use xlink:href="#heart" fill="none" stroke="red"/> </svg> note: as of svg2, transform is a presentation attribute, meaning it can be used as a css property.
...if y is not provided, it is assumed to be 0.
...if y is not provided, it is assumed to be equal to x.
...if optional parameters x and y are not supplied, the rotation is about the origin of the current user coordinate system.
unicode - SVG: Scalable Vector Graphics
WebSVGAttributeunicode
it is often useful to refer to characters using xml character references expressed in hexadecimal notation or decimal notation.
... for example, unicode="ffl" could be expressed as xml character references in hexadecimal notation as unicode="&#x66;&#x66;&#x6c;" or in decimal notation as unicode="&#102;&#102;&#108;".
...if the attribute is not provided for a given <glyph>, then the only way to use this glyph is via an <altglyph> reference.
... only one element is using this attribute: <glyph> context notes value <string> default value none animatable no <string> this value specifies one or more unicode characters corresponding to a glyph.
visibility - SVG: Scalable Vector Graphics
note: if the visibility attribute is set to hidden on a text element, then the text is invisible but still takes up space in text layout calculations.
... note: as a presentation attribute, visibility can be used as a css property.
...00%; } <svg viewbox="0 0 220 120" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="200" height="100" stroke="black" stroke-width="5" fill="transparent" /> <g stroke="seagreen" stroke-width="5" fill="skyblue"> <rect x="20" y="20" width="80" height="80" visibility="visible" /> <rect x="120" y="20" width="80" height="80" visibility="hidden"/> </g> </svg> usage notes value visible | hidden | collapse default value visible animatable yes visible this value indicates that the element will be painted.
... hidden this value indicates that the element will not be painted.
<a> - SVG: Scalable Vector Graphics
WebSVGElementa
g); html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- a link around a shape --> <a href="/docs/web/svg/element/circle"> <circle cx="50" cy="40" r="35"/> </a> <!-- a link around a text --> <a href="/docs/web/svg/element/text"> <text x="50" y="90" text-anchor="middle"> &lt;circle&gt; </text> </a> </svg> /* as svg does not provide a default visual style for links, it's considered best practice to add some */ @namespace svg url(http://www.w3.org/2000/svg); /* necessary to select only svg <a> elements, and not also html’s.
... value type: <url> ; default value: none; animatable: yes global attributes core attributes most notably: id, lang, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, document element event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-r...
...ule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes most notably: xlink:title aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed...
..., aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2the definition of '<a>' in that specification.
<ellipse> - SVG: Scalable Vector Graphics
WebSVGElementellipse
note: ellipses are unable to specify the exact orientation of the ellipse (if, for example, you wanted to draw an ellipse tilted at a 45 degree angle), but it can be rotated by using the transform attribute.
... value type: <number> ; default value: none; animatable: yes note: starting with svg2 cx, cy, rx and ry are geometry properties, meaning those attributes can also be used as css properties for that element.
... global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current,...
...a-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<ellipse>' in that specification.
<linearGradient> - SVG: Scalable Vector Graphics
value type: <transform-list> ; default value: identity transform; animatable: yes href this attribute defines a reference to another <lineargradient> element that will be used as a template.
... value type: <length> ; default value: 100%; animatable: yes xlink:href an <iri> reference to another <lineargradient> element that will be used as a template.
... value type: <length> ; default value: 0%; animatable: yes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-...
...linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatetransform>, <set>, <stop> specifications specification status comment scalable vector graphics (svg) 2the definition of '<lineargradient>' in that specification.
<set> - SVG: Scalable Vector Graphics
WebSVGElementset
it supports all attribute types, including those that cannot reasonably be interpolated, such as string and boolean values.
... note: the <set> element is non-additive.
... the additive and accumulate attributes are not allowed, and will be ignored if specified.
... value type: <anything>; default value: none; animatable: no animation attributes animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill other animation attributes most notably: attributename animation event attributes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements specificati...
<text> - SVG: Scalable Vector Graphics
WebSVGElementtext
if text is included in svg not inside of a <text> element, it is not rendered.
... html,body,svg { height:100% } <svg viewbox="0 0 240 80" xmlns="http://www.w3.org/2000/svg"> <style> .small { font: italic 13px sans-serif; } .heavy { font: bold 30px sans-serif; } /* note that the color of the text is set with the * * fill property, the color property is for html only */ .rrrrr { font: italic 40px serif; fill: red; } </style> <text x="20" y="35" class="small">my</text> <text x="40" y="35" class="heavy">cat</text> <text x="55" y="55" class="small">is</text> <text x="65" y="55" class="rrrrr">grumpy!</text> </svg> attributes x the x coordinate of the starting point of the text baseline.
... value type: <length>|<percentage> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style, font-family, font-size, font-size-adjust, font-stretch, font-style, font-variant, font-weight conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-...
...a-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesgraphics element, text content elementpermitted contentcharacter data and any number of the following elements, in any order:animation elementsdescriptive elementstext content elements<a> specifications specification status comment scalable vector graphics (svg) 2the definition of '<text>' in that specification.
<tspan> - SVG: Scalable Vector Graphics
WebSVGElementtspan
the svg <tspan> element defines a subtext within a <text> element or another <tspan> element.
... html,body,svg { height:100% } <svg viewbox="0 0 240 40" xmlns="http://www.w3.org/2000/svg"> <style> text { font: italic 12px serif; } tspan { font: bold 10px sans-serif; fill: red; } </style> <text x="10" y="30" class="small"> you are <tspan>not</tspan> a banana!
... value type: <length>|<percentage> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, fill, fill-opacity, fill-rule, filter, mask, opa...
...a-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriestext content element, text content child elementpermitted contentcharacter data and any number of the following elements, in any order:descriptive elements<a>, <altglyph>, <animate>, <animatecolor>, <set>, <tref>, <tspan> specifications specification status comment scalable vector graphics (svg) 2the definition of '<tspan>' in that specification.
Basic shapes - SVG: Scalable Vector Graphics
h="5"/> <polyline points="60 110 65 120 70 115 75 130 80 125 85 140 90 135 95 150 100 145" stroke="orange" fill="transparent" stroke-width="5"/> <polygon points="50 160 55 180 70 180 60 190 65 205 50 195 35 205 40 190 30 180 45 180" stroke="green" fill="transparent" stroke-width="5"/> <path d="m20,230 q40,205 50,230 t90,230" fill="none" stroke="blue" stroke-width="5"/> </svg> note: the stroke, stroke-width, and fill attributes are explained later in the tutorial.
...if they're not set, they default to 0.
... note: a rectangle is a type of polygon, so a polygon can be used to create a <rect/> element in cases where you need a little more flexibility.
...but for now, note that there is a single parameter used to control its shape.
Getting started - SVG: Scalable Vector Graphics
basic properties of svg files the first important thing to notice is the order of rendering elements.
...unfortunately, it is very problematic to get gzip-compressed svg files to work reliably across all svg capable user agents when served from a microsoft iis server, and firefox cannot load gzip-compressed svg from the local computer.
...if you find that your server is not sending the headers with the values given above, then you should contact your web host.
...if your server is not configured to send the correct headers with the svg files it serves, then firefox will most likely show the markup of the files as text or encoded garbage, or even ask the viewer to choose an application to open them.
Patterns - SVG: Scalable Vector Graphics
WebSVGTutorialPatterns
the caveat here is that if the object changes size, the pattern itself will scale to fit it, but the objects inside will not.
... so while we would still have 4 repeating units inside the pattern, the objects composing that pattern would remain the same size, and you end up with large areas of nothing in between them.
... as a slight aside, in gecko circles seem to have trouble drawing if their radius is set to something less than 0.075 (it is currently unknown whether this is a bug in the pattern element or not).
...all three of the preceding examples are shown below on a rectangle that has been slightly elongated to a height of 300px, but i should note that it's not an exhaustive picture, and there are other options available depending on your application.
SVG fonts - SVG: Scalable Vector Graphics
« previousnext » when svg was specified, support for web fonts was not widespread in browsers.
...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.
...this defines what should be displayed if a certain glyph is not found in the font and if there are no fallback mechanisms.
... option: use css @font-face you can use @font-face to reference remote (and not so remote) fonts: <font id="super_sans"> <!-- and so on --> </font> <style type="text/css"> @font-face { font-family: "super sans"; src: url(#super_sans); } </style> <text font-family="super sans">my text uses super sans</text> option: reference a remote font the above mentioned font-face-uri element allows you to reference an external font, hence allowing greater re-usability: <font>...
Certificate Transparency - Web security
certificate transparency initially came about in 2013 against a backdrop of ca compromises (diginotar breach in 2011), questionable decisions (trustwave subordinate root incident in 2012) and technical issuance issues (weak, 512 bit certificate issuance by digicert sdn bhd of malaysia).
... browser requirements google chrome requires ct log inclusion for all certificates issues with a notbefore date of after 30 april 2018.
... firefox does not currently check or require the use of ct logs for sites that users visit.
...in chrome, even if the certificate was issued with a notbefore date prior to april).
Secure contexts - Web security
for example, even for a document delivered over tls within an <iframe>, its context is not considered secure if it has an ancestor that was not also delivered over tls.
... however, it’s important to note that if a non-secure context causes a new window to be created (with or without specifying noopener), then the fact that the opener was insecure has no effect on whether the new window is considered secure.
... that’s because the determination of whether or not a particular document is in a secure context is based only on considering it within the top-level browsing context with which it is associated — and not whether a non-secure context happened to be used to create it.
... resources that are not local, to be considered secure, must meet the following criteria: must be served over https:// or wss:// urls the security properties of the network channel used to deliver the resource must not be considered deprecated feature detection pages can use feature detection to check whether they are in a secure context or not by using the issecurecontext boolean, which is exposed on the global scope.
current - XPath
notes this function is an xslt-specific addition to xpath.
... it is not a part of the core xpath function library.
... for an outermost expression (an expression not occurring within another expression), the current node is always the same as the context node (which will be returned by the .
...thus within all of the following three expressions the current function (not the entire expressions) returns the same node.
XPath snippets - XPath
anode.documentelement : anode.ownerdocument.documentelement); var result = xpe.evaluate(aexpr, anode, nsresolver, 0, null); var found = []; var res; while (res = result.iteratenext()) found.push(res); return found; } this function uses the new xpathevaluator() constructor, which is supported in firefox, chrome, opera and safari, but not in edge or internet explorer.
...web document which might be accessed by edge or internet explorer users should replace the call to new xpathevaluator() with the following fragment: // xpathevaluator is implemented on objects that implement document var xpe = anode.ownerdocument || anode; in that case the creation of the xpathnsresolver can be simplified as: var nsresolver = xpe.creatensresolver(xpe.documentelement); note however that creatensresolver should only be used if you are sure the namespace prefixes in the xpath expression match those in the document you want to query (and that no default namespace is being used (though see document.creatensresolver for a workaround)).
...if you can rely on id attributes, document.getelementbyid() is still powerful, but it's not nearly as powerful as xpath.
...it avoids the more complex syntax of document.evaluate() for cases when it is not required as well as the need to use the special iterators on xpathresult (by returning an array instead).
XPath
it can also be used to test addressed nodes within a document to determine whether they match a pattern or not.
... xpath uses a path notation (as in urls) for navigating through the hierarchical structure of an xml document.
... 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.
... jxon jxon (lossless javascript xml object notation) is a generic name by which is defined the representation of javascript objects using xml.
<xsl:output> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementoutput
omit-xml-declaration indicates whether or not to include an xml declaration in the output.
... standalone (not supported.) if present, indicates that a standalone declaration should occur in the output document and gives its value.
... 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.
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElement
a third type of element, not discussed here, is the literal result element (lre).
... on a related note, any attribute in an lre and some attributes of a limited number of xslt elements can also include what is known as an attribute value template.
...for example, assume that a variable "image-dir" is defined as follows: <xsl:variable name="image-dir">/images</xsl:variable> the expression to be evaluated is placed inside curly brackets: <img src="{$image-dir}/mygraphic.jpg"/> this would result in the following: <img src="/images/mygraphic.jpg"/> the element annotations that follow include a description, a syntax listing, a list of required and optional attributes, a description of type and position, its source in the w3c recommendation and an explanation of the degree of present gecko support.
...<xsl: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:te...
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.
... elements xsl:apply-imports (supported) xsl:apply-templates (supported) xsl:attribute (supported) xsl:attribute-set (supported) xsl:call-template (supported) xsl:choose (supported) xsl:comment (supported) xsl:copy (supported) xsl:copy-of (supported) xsl:decimal-format (supported) xsl:element (supported) xsl:fallback (not supported) xsl:for-each (supported) xsl:if (supported) xsl:import (mostly supported) xsl:include (supported) xsl:key (supported) xsl:message (supported) xsl:namespace-alias (not supported) xsl:number (partially supported) xsl:otherwise (supported) xsl:output (partially supported) xsl:param (supported) xsl:preserve-space (supported) xsl:processing-instruction xsl:sort (s...
...sl:strip-space (supported) xsl:stylesheet (partially supported) xsl:template (supported) xsl:text (partially supported) xsl:transform (supported) xsl:value-of (partially supported) xsl:variable (supported) xsl:when (supported) xsl:with-param (supported) axes ancestor ancestor-or-self attribute child descendant descendant-or-self following following-sibling namespace (not supported) parent preceding preceding-sibling self functions boolean() (supported) ceiling() (supported) concat() (supported) contains() (supported) count() (supported) current() (supported) document() (supported) element-available() (supported) false() (supported) floor() (supported) format-number() (supported) function-available() (supported) generate-id() (suppo...
...rted) id() (partially supported) key() (supported) lang() (supported) last() (supported) local-name() (supported) name() (supported) namespace-uri() (supported) normalize-space() (supported) not() (supported) number() (supported) position() (supported) round() (supported) starts-with() (supported) string() (supported) string-length() (supported) substring() (supported) substring-after() (supported) substring-before() (supported) sum() (supported) system-property() (supported) translate() (supported) true() (supported) unparsed-entity-url() (not supported) ...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference elements xsl:apply-imports (supported) xsl:apply-templates (supported) xsl:attribute (supported) xsl:attribute-set (supported) xsl:call-template (supported) xsl:choose (supported) xsl:comment (supported) xsl:copy (supported) xsl:copy-of (supported) xsl:decimal-format (supported) xsl:element (supported) xsl:fallback (not supported) xsl:for-each (supported) xsl:if (supported) xsl:import (mostly supported) xsl:include (supported) xsl:key (supported) xsl:message (supported) xsl:namespace-alias (not supported) xsl:number (partially supported) xsl:otherwise (supported) xsl:output (partially supported) xsl:param (supported) xsl:preserve-space (supported) xsl:processing-instruction xsl:sort (supported) xs...
...l:strip-space (supported) xsl:stylesheet (partially supported) xsl:template (supported) xsl:text (partially supported) xsl:transform (supported) xsl:value-of (partially supported) xsl:variable (supported) xsl:when (supported) xsl:with-param (supported) axes ancestor ancestor-or-self attribute child descendant descendant-or-self following following-sibling namespace (not supported) parent preceding preceding-sibling self functions boolean() (supported) ceiling() (supported) concat() (supported) contains() (supported) count() (supported) current() (supported) document() (supported) element-available() (supported) false() (supported) floor() (supported) format-number() (supported) function-available() (supported) generate-id() (supported) id() (partiall...
...y supported) key() (supported) lang() (supported) last() (supported) local-name() (supported) name() (supported) namespace-uri() (supported) normalize-space() (supported) not() (supported) number() (supported) position() (supported) round() (supported) starts-with() (supported) string() (supported) string-length() (supported) substring() (supported) substring-after() (supported) substring-before() (supported) sum() (supported) system-property() (supported) translate() (supported) true() (supported) unparsed-entity-url() (not supported) for further reading books online the world wide web consortium portals articles tutorials/examples mailing lists/newsgroups resources index original document information copyright information: copyright...
... note: this reprinted article was originally part of the devedge site.
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.
... note: you could specify outputting just the javascript "glue" file* rather than the full html by specifying a .js file instead of an html file in the -o flag, e.g.
... note: we are including the #ifdef blocks so that if you are trying to include this in c++ code, the example will still work.
...(note that we need to compile with no_exit_runtime, which is necessary as otherwise when main() exits the runtime would be shut down — necessary for proper c emulation, e.g., atexits are called — and it wouldn't be valid to call compiled code.) emcc -o hello3.html hello3.c -o3 -s wasm=1 --shell-file html_template/shell_minimal.html -s no_exit_runtime=1 -s "extra_exported_runtime_methods=['ccal...
Caching compiled WebAssembly modules - WebAssembly
note: the entire site's wasm cache (not just the given url) is versioned by the specified dbversion passed into the function.
...kupindatabase(db) { return new promise((resolve, reject) => { var store = db.transaction([storename]).objectstore(storename); var request = store.get(url); request.onerror = reject.bind(null, `error getting wasm module ${url}`); request.onsuccess = event => { if (request.result) resolve(request.result); else reject(`module ${url} was not found in wasm cache`); } }); } storing and instantiating modules next, we define a function storeindatabase() that fires off an async operation to store a given wasm module in a given database.
...we start by trying to open a database, then see if we already have a compiled module with the key url stored in the given db: return opendatabase().then(db => { return lookupindatabase(db).then(module => { if we do, we instantiate it with the given import object: console.log(`found ${url} in wasm cache`); return webassembly.instantiate(module, importobject); }, if not, we compile it from scratch and then store the compiled module in the database with a key of url, for next time we want to use it: errmsg => { console.log(errmsg); return webassembly.instantiatestreaming(fetch(url)).then(results => { storeindatabase(db, results.module); return results.instance; }); }) }, note: it is for this kind of usage that webass...
...embly.instantiate() returns both a module and an instance: the module represents the compiled code and can be stored/retrieved in idb or shared between workers via postmessage(); the instance is stateful and contains the callable javascript functions, therefore it cannot be stored/shared.
Compiling an Existing C Module to WebAssembly - WebAssembly
it seemed to work brilliantly: $ emcc -o3 -s wasm=1 -s extra_exported_runtime_methods='["cwrap"]' \ -i libwebp \ webp.c \ libwebp/src/{dec,dsp,demux,enc,mux,utils}/*.c note: this strategy will not work with every c project.
... now you only need some html and javascript to load your new module: <script src="./a.out.js"></script> <script> module.onruntimeinitialized = async _ => { const api = { version: module.cwrap('version', 'number', []), }; console.log(api.version()); }; </script> and you will see the correct version number in the output: note: libwebp returns the current version a.b.c as a hexadecimal number 0xabc.
...this may not be clean c.
...put it in a javascript buffer of your own, and release all the wasm buffers allocated in the process: api.encode(p, image.width, image.height, 100); const resultpointer = api.get_result_pointer(); const resultsize = api.get_result_size(); const resultview = new uint8array(module.heap8.buffer, resultpointer, resultsize); const result = new uint8array(resultview); api.free_result(resultpointer); note: new uint8array(somebuffer) will create a new view onto the same memory chunk, while new uint8array(sometypedarray) will copy the data.
Communicating With Other Scripts - Archive of obsolete content
however, content scripts which have been loaded into different documents cannot interact directly with each other.
... if an add-on creates a single page-mod object and loads several content scripts into the page mod, then only content scripts associated with the same page can interact with each other: if two different matching pages are loaded, content scripts attached to page a cannot interact with those attached to page b.
... page scripts if a page includes its own scripts using <script> tags, either embedded in the page or linked to it using the src attribute, there are a couple of ways a content script can communicate with it: using the dom postmessage() api using custom 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.
Contributor's Guide - Archive of obsolete content
unlike languages like c++ and java, javascript does not have native support for classical 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.
...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.
Working with Events - Archive of obsolete content
by registering a listener function to an event emitter an add-on can receive notifications of these events.
... for example, the following add-on registers a listener with the tabs module to listen for the ready event, and logs a string to the console reporting the event: var tabs = require("sdk/tabs"); tabs.on("ready", function () { console.log("tab loaded"); }); it is not possible to enumerate the set of listeners for a given event.
...quire("sdk/self"); var panel = panels.panel({ contenturl: self.data.url("panel.html") }); panel.on("*", function(e) { console.log("event " + e + " was emitted"); }); var button = ui.actionbutton({ id: "my-button", label: "my button", icon: "./icon-16.png", onclick: handleclick }); function handleclick(state) { panel.show({ position: button }); } this wildcard feature does not yet work for the tabs or windows modules.
clipboard - Archive of obsolete content
var clipboard = require("sdk/clipboard"); if (clipboard.currentflavors.indexof("image") != -1) require("sdk/tabs").open(clipboard.get()); as noted before, data type can be easily omitted for images.
... if the intention is set the clipboard to a data url as string and not as image, it can be done by specifying a different flavor, like text.
...the function will return null if the contents of the clipboard do not match the supplied type.
indexed-db - Archive of obsolete content
the database created will be unique and private per add-on, and is not linked to any website database.
... the module cannot be used to interact with a given website database.
... console.log(itemlist); } open("1"); var add = require("sdk/ui/button/action").actionbutton({ id: "add", label: "add", icon: "./add.png", onclick: function() { additem(require("sdk/tabs").activetab.title); } }); var list = require("sdk/ui/button/action").actionbutton({ id: "list", label: "list", icon: "./list.png", onclick: function() { getitems(listitems); } }); note that to run this add-on you'll need to provide icons named "add.png" and "list.png" in the add-on's "data" directory.
request - Archive of obsolete content
for example, if you're retrieving text content which was encoded as iso-8859-1 (latin 1), it will be given a content type of "utf-8" and certain characters will not display correctly.
... since the request is not being made by any particular website, requests made here are not subject to the same-domain restriction that requests made in web pages are subject to.
...the value will be null if the document cannot be processed by json.parse.
selection - Archive of obsolete content
usage registering for selection notifications to be notified when the user makes a selection, register a listener for the "select" event.
... 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.
... iscontiguous true if the current selection is a single, contiguous selection, and false if there are two or more discrete selections, each of which may or may not be spatially adjacent.
self - Archive of obsolete content
note that the self module is completely different from the global self object accessible to content scripts, which is used by a content script to communicate with the add-on code.
...while not generally of use to add-on code directly, it can be used by internal api code to index local storage and other resources that are associated with a particular add-on.
... 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.
content/symbiont - Archive of obsolete content
if frame is not provided hidden one will be created.
... allow object permissions for the content, with the following keys: script boolean whether or not to execute script in the content.
... allow permissions for the content, with a single boolean key called script which defaults to true and indicates whether or not to execute scripts in the content.
frame/hidden-frame - Archive of obsolete content
xul <iframe> elements) that are not displayed to the user.
... this is useful in the construction of apis that load web content not intended to be directly seen or accessed by users, like page-worker.
...you must specify an onready callback and refrain from using the hidden frame until the callback gets called, because hidden frames are not always ready to load content the moment they are added.
io/text-streams - Archive of obsolete content
if not specified, "utf-8" is assumed.
...if not specified, "utf-8" is assumed.
...if not given, the remainder of the stream is read.
lang/functional - Archive of obsolete content
}, 0)), except that the wrapped function may be reused and does not need to be repeated each time.
... from underscore's debounce() function: this takes a function and returns a new version of the function which, when invoked, will not be executed until it has not been invoked for wait milliseconds.
... from underscore's throttle() function: this takes a function and returns a new version of the function which, when invoked repeatedly, will not excute the function more than once per wait milliseconds.
remote/parent - Archive of obsolete content
each frame loads in a process but sometimes the application may choose to switch from loading a tab in one process to another.
... loading modules into the child process to load a module into the child process, use remoterequire(): const { remoterequire } = require("sdk/remote/parent"); remoterequire("./my-module.js", module); inter-process communication a module loaded into a different process cannot directly communicate or share state with the module that loaded it.
... const { remoterequire } = require("sdk/remote/parent"); remoterequire("./my-module.js", module); note that even single-process applications have a process that contains content frames.
system/child_process - Archive of obsolete content
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.
...em/child_process"); var ls = child_process.spawn('/bin/ls', ['-lh', '/usr']); ls.stdout.on('data', function (data) { console.log('stdout: ' + data); }); ls.stderr.on('data', function (data) { console.log('stderr: ' + data); }); ls.on('close', function (code) { console.log('child process exited with code ' + code); }); writing to child process' stdin because the sdk implementation does not include a write() method for child processes, you must use the "raw" emit event.
system/unload - Archive of obsolete content
if object does not have the expected destructor method, then an exception is thrown when ensure() is called.
...if a reason could not be determined, undefined will be passed instead.
... note that if an add-on is unloaded with reason "disable", it will not be notified about "uninstall" while it is disabled.
Getting started (cfx) - Archive of obsolete content
then when you invoke cfx run or cfx xpi, you pass the "-o" option: cfx run -o this instructs cfx to use the local copies of the sdk modules, not the ones in firefox.
...for example: while true ; do cfx xpi ; wget --post-file=codesy.xpi http://localhost:8888/ ; sleep 5 ; done note that the logging level defined for the console is different when you use this method, compared to the logging level used when an add-on is run using cfx run.
... another example using grunt and grunt-shell: module.exports = function(grunt) { 'use strict'; require('matchdep').filterdev('grunt-!(cli)').foreach(grunt.loadnpmtasks); grunt.initconfig({ shell: { xpi: { command: [ 'cd pluginpath', 'cfx xpi', 'wget --post-file=pluginname.xpi http://localhost:8888/ || echo>/dev/null' ].join('&&') } }, watch: { xpi: { files: ['pluginpath/**'], tasks: ['shell:xpi'] } } }); grunt.loadnpmtasks('grunt-contrib-watch'); grunt.loadnpmtasks('grunt-shell'); grunt.registertask('default', ...
Modifying Web Pages Based on URL - Archive of obsolete content
pi var pagemod = require("sdk/page-mod"); // import the self api var self = require("sdk/self"); // create a page-mod // it will run a script whenever a ".org" url is loaded // the script replaces the page contents with a message pagemod.pagemod({ include: "*.org", contentscriptfile: self.data.url("jquery-1.7.min.js"), contentscript: '$("body").html("<h1>page matches ruleset</h1>");' }); note, though, that you can't load a script from a web site.
... injecting css note that the feature described in this section is experimental at the moment.
...in particular, the pagemod constructor takes several additional options to control its behavior: by default, content scripts are not attached to any tabs that are already open when the page-mod is created, and are attached to iframes as well as top-level documents.
Unit Testing - Archive of obsolete content
unfortunately these functions are attached to the window object: since this object is not available in your main add-on code, atob() and btoa() aren't available either.
...assert) { assert.ok(base64.atob("agvsbg8=") == "hello", "atob works"); } exports["test btoa"] = function(assert) { assert.ok(base64.btoa("hello") == "agvsbg8=", "btoa works"); } exports["test empty string"] = function(assert) { assert.throws(function() { base64.atob(); }, "empty string check works"); } require("sdk/test").run(exports); note that with jpm we must give the exact relative path to the base64.js module.
... what happens here is that jpm test: looks in the test directory of your package loads any modules whose names start with the word test- (note the hyphen after "test" in the module name.
Tutorials - Archive of obsolete content
listen for page load use the tabs module to get notified when new web pages are loaded, and access their content.
... listen for load and unload get notifications when your add-on is loaded or unloaded by firefox, and pass arguments into your add-on from the command line.
... putting it together annotator add-on a walkthrough of a relatively complex add-on.
Examples and demos from articles - Archive of obsolete content
[article] note: the filereader() constructor was not supported by internet explorer for versions before 10.
... 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.
... 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.
HTML to DOM - Archive of obsolete content
although you can now natively parse html using domparser and xmlhttprequest, this is a new feature that is not yet supported by all browsers in use in the wild.
...ead of body), you have all document object with its complete functions list, therefore you can retrieve info within div tag like this: var dompars = htmlparser("<div id='userinfo'>john was a mediocre programmer, but people liked him <strong>anyway</strong>.</div>"); alert(dompars.getelementbyid('userinfo').innerhtml); to parse a complete html page, load it into an iframe whose type is content (not chrome).
... using a hidden xul iframe (alternate example) sometimes, a browser element is overkill, or does not meet your needs, or you can't fulfill its requirements.
IsDefaultNamespace - Archive of obsolete content
note that all gecko-based browsers (including firefox) support node.isdefaultnamespace.
... this function is not necessary for gecko-based browsers (though the function will quickly return the standard value for mozilla browsers).
...ntnode) { // entityreferences may have to be skipped to get to it return isdefaultnamespace(node.parentnode, namespaceuri); } else { return false; // unknown; } case 9: // document_node return isdefaultnamespace(node.documentelement, namespaceuri); case 6: // entity_node case 12: // notation_node case 10: // document_type_node case 11: // document_fragment_node return false; // unknown case 2: // attribute_node: if (node.ownerelement ) { return isdefaultnamespace(node.ownerelement , namespaceuri); } else { return false; // unknown } default: if ...
LookupPrefix - Archive of obsolete content
note that all gecko-based browsers (including firefox) support node.lookupprefix.
... this function is not necessary for gecko-based browsers when used in xhtml.
...as will return null return node.lookupprefix(namespaceuri); } if (namespaceuri === null || namespaceuri === '') { return null; } switch (node.nodetype) { case 1: // node.element_node return _lookupnamespaceprefix(namespaceuri, node); case 9: // node.document_node return _lookupnamespaceprefix(namespaceuri, node.documentelement); case 6: // node.entity_node case 12: // node.notation_node case 11: // node.document_fragment_node case 10: // node.document_type_node return null; // type is unknown case 2: // node.attribute_node if (node.ownerelement) { return _lookupnamespaceprefix(namespaceuri, node.ownerelement); } return null; default: if (node.parentnode) { // entityreferences may have to be skipped to get to it return _lookupnamespac...
On page load - Archive of obsolete content
progress listeners allow extensions to be notified of events associated with documents loading in the browser and with tab switching events.
... if(doc.location.href.search("forum") > -1) alert("a forum page is loaded"); // add event listener for page unload aevent.originaltarget.defaultview.addeventlistener("unload", function(event){ myextension.onpageunload(event); }, true); }, onpageunload: function(aevent) { // do something } }; current firefox trunk nightlies will fire the onpageload function for not only documents, but xul:images (favicons in tabbrowser).
... // if (win.frameelement) return; // skip iframes/frames alert("page is loaded \n" +doc.location.href); } } window.addeventlistener("load", function load(event){ window.removeeventlistener("load", load, false); //remove listener, no longer needed myextension.init(); },false); references if you need to have a more complicated listener (not just onload), use progress listeners.
Delayed Execution - Archive of obsolete content
note: if an nsitimer is garbage collected, it will be deactivated and its callbacks will not fire.
... delete delay.timers[idx]; func(); }, timeout, ci.nsitimer.type_one_shot); // store a reference to the timer so that it's not reaped before it fires.
... let idx = delay.timers.push(timer) - 1; return idx; } delay.timers = []; function repeat(timeout, func) { let timer = new timer(function () { func(); }, timeout, ci.nsitimer.type_repeating_slack); // store a reference to the timer so that it's not reaped before it fires.
Windows - Archive of obsolete content
however, window.open() returns a window object for content, not for the browser window itself, so you should get the chrome window first.
...the following code does not care which element is clicked on, simply responding to all mousedown events equally.
...additionally, if the window is in the background, it may not be brought to the front.
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.
... // var ns = 'http://www.w3.org/xml/1998/namespace'; var att, protocolpos; var xmlbase = ''; var abs = false; // avoid loop if node is not present if (!thisitem || !thisitem.nodename) { return xmlbase; } // check present element and higher up for xml:base // now check for the next matching local name up in the hierarchy (until the document root) while (thisitem.nodename !== '#document' && thisitem.nodename !== '#document-fragment') { att = thisitem.getattribute('xml:base'); // xml: namespaces must use 'xml' prefix if (at...
...// find first path separator ('/') after protocol if (att2 !== -1) { att = att.substring(0, att2 - 1); // don't want any trailing slash, as the absolute path to be added already has one } } else if (!att.match(/\/$/)) { // if no trailing slash, add one, since it is being attached to a relative path att += '/'; } xmlbase = att + xmlbase; // if previous path was not absolute, resolve against the full uri here' break; } else if (att.indexof('/') === 0) { // if absolute (/), need to prepare for next time to strip out after slash xmlbase = att + xmlbase; abs = true; // once the protocol is found on the next round, make sure any extra path is ignored } else { // if relative, just add it xmlbase = att + xmlbase; } } thisitem = t...
Code snippets - Archive of obsolete content
these examples demonstrate how to accomplish basic tasks that might not be immediately obvious.
...xml file i/o code used to read, write and process files drag & drop code used to setup and handle drag and drop events dialogs code used to display and process dialog boxes alerts and notifications modal and non-modal ways to notify users preferences code used to read, write, and modify preferences js xpcom code used to define and call xpcom components in javascript running applications code used to run other applications <canvas> related what wg canvas-related code signing a xpi how to sign an xpi with pki delayed execution performing background operations.
...hence, if you are going to use another scripting language you might expect that most of the browsers will not recognize it.
Deploying a Plugin as an Extension - Archive of obsolete content
this feature is particularly useful for vendors who wish to deploy the plugin even if firefox is not currently installed, or who want to use the automatic extension update mechanism to update their plugin to a newer version.
...if you have written extensions for firefox in the past, you'll notice that we no longer require the use of guids as extension ids.
...you'll notice that one thing we did not do is provide a mechanism for updating the plugin, as discussed at the beginning of this article.
Extension Theming Guidelines - Archive of obsolete content
branding certain items of your extensions style, in particular logos and icons can be kept in the chrome content package such that they are not replaceable by custom themes stylesheets guidelines include stylesheets for every new window that your extension adds and for every window that your extension overlays content into be sure to add a stylesheet from your chrome skin package.
...if you are not then you run a risk of conflicting with content that other extensions add to the window.
...they are impossible to override from styleheets so anything you put in there cannot be adjusted by custom themes.
Signing an extension - Archive of obsolete content
note: these instructions are outdated.
... for an extension to work in firefox it must be signed by mozilla, not by yourself.
... 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.
Getting the page URL in NPAPI plugin - Archive of obsolete content
npvariant variantvalue; // get the location property from the window object (which is another object).
...tradeoffs: uses npapi only works in most browsers does not work in mozillas older than firefox 1.0 via npp_newstream from braden mcdaniel: if you want the uri of the resource for which the plug-in is invoked, the most npapi-friendly way to do that is to get it from the npstream that is passed to npp_newstream.
...does not work in opera, safari etc.) compatible with older versions of the mozilla (probably back to mozilla 1.0) requires c++ ...
Localizing an extension - Archive of obsolete content
note that the urls of the dtd files don't actually include the name of the localization to use.
... note: you should use a unique id for each string bundle element for each file you use to avoid conflicts.
...adding more localizations to add another localization for a new language, all you need to do is add another line to the chrome manifest referencing the new locale.
cert_override.txt - Archive of obsolete content
the key and the website are not valid: # psm certificate override settings file # this is a generated file!
... do not edit.
....840.1.101.3.4.2.1 (most used) sha-384: oid.2.16.840.1.101.3.4.2.2 sha-512: oid.2.16.840.1.101.3.4.2.3 certificate fingerprint using previous hash algorithm one or more characters for override type: m : allow mismatches in the hostname u : allow untrusted certs (whether it's self signed cert or a missing or invalid issuer cert) t : allow errors in the validity time, for example, for expired or not yet valid certs certificate's serial number and the issuer name as a base64 encoded string ...
Creating a Web based tone generator - Archive of obsolete content
setinterval(function() { var written; // check if some data was not written in previous attempts.
... if(tail) { written = audio.mozwriteaudio(tail); currentwriteposition += written; if(written < tail.length) { // not all the data was written, saving the tail...
... written = audio.mozwriteaudio(sounddata); if(written < sounddata.length) { // not all the data was written, saving the tail.
Source Navigator - Archive of obsolete content
note: this document is still in the draft state.
...let me know if this is wrong..) it can generate a class hierarchy quite easily (unfortunately, not for classnames which are defined by macro.) installing source navigator in ubuntu execute the following line in a terminal window: sudo apt-get install sourcenav this should install source-navigator.
...(you can always include more by pressing the "more" button.) in my case, i inputted the followings: project file: <tt>~/snav-mozilla</tt> add directory (where your source files reside in -- i understand that the label here is not so self-explanatory...): <tt>~/moz1.9/mozilla</tt> (because i saved my source at ~/moz1.9/mozilla.) remember to ensure that "include subdirectories" and "build cross-reference database" are checked.
Using content preferences - Archive of obsolete content
this permits code running within chrome (in other words: extensions and the browser itself, not web sites) to locally save preferences on a per-site basis.
... var value = prefservice.getpref(uri, "devmo.somesetting"); built-in site-specific preferences preference name menu equivalent values notes browser.content.full-zoom view / zoom example: "1.10000002384186" (rounding variant of "1.1") related about:config preferences: browser.zoom.full boolean, set by the menu item view / zoom / zoom text only.
... despite the confusion in names, this preference is not site-specific.
Working with BFCache - Archive of obsolete content
that might come from the http cache or not, depending on whether it's been evicted; typically it does come from the http cache.
...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.
Automatically Handle Failed Asserts in Debug Builds - Archive of obsolete content
the valid values are: 0x5 automatically ignore 0x4 automatically retry 0x3 automatically abort note that you can also force windbgdlg to prompt, by setting a value of 0xfffffffe.
...as an example, consider the following failed assertion: assertion: no document: 'mdocument != nsnull', file d:/cvs-1.11.4/mozilla/content/xul/content/src/nsxulelement.cpp, line 3173 (note that i have my source tree in d:/cvs-1.11.4/mozilla) if you have a dword in hkcu\software\mozilla.org\windbgdlg\ named "d:/cvs-1.11.5/mozilla/content/xul/content/src/nsxulelement.cpp," (with the comma - matches are whole-word only) and value 0x5, the assert would automatically be ignored.
...note that double quotes which delimit an item (") are ignored in value names and the assertion string, so "silly" and silly will both be matched by a value named silly.
Bookmark Keywords - Archive of obsolete content
in figure 2, we can see the bookmark has been filed into a folder called "widgets." you can create a folder with another name, or not put your keymarks into a folder at all.
...however, the two should not be a case-sensitive match-- that is, if your keyword is av, then your title should be "av" or "av" or anything besides "av." (see bugzilla entry 119201 for details.) since this bookmark is intended to look up bugzilla entries, we'll call it "bz," as shown in figure 3.
... note: this reprinted article was originally part of the devedge site.
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
general decisions filename of dll must start with "np" (not "ns") and ends with ".dll" (i wasted hours on this - repeatedly) mimetype reflects the data type handled by the plugin.
... again note that the resulting dll filename must start with "np", so either call your project like this or rename the file later delete the .cpp and .h and readme files from the project and disk (if you did not create an empty project) copy the npruntime sample plugin source code into the dir of the new vs project and add the files to the project using the vs gui (.cpp files to "source files", .h files to...
...note: if your project is still empty, the c++ tree might not be visible.
Creating a Firefox sidebar extension - Archive of obsolete content
most additions are provided with a default tree structure, although not required it is recommended to use this structure.
...it is not used for this tutorial.
... if the sidebar is not going to have a command-key, one can remove the openemptysidebar.commandkey and openemptysidebar.modifierskey keys from the dtd, remove the <keyset> from the firefoxoverlay.xul file.
Adding the structure - Archive of obsolete content
the lock icon in mozilla that shows whether or not a loaded document was encrypted with ssl).
... the status attribute is not part of the xul definition for the statusbarpanel element, but is used by our extension to store the current tinderbox state.
...all xul elements can be given custom attributes in addition to the ones the xul rendering engine recognizes which get ignored by the engine, so adding this custom attribute does not create any problems or modify the way the widget is displayed (except for the ways we explicitly specify with css).
Finding the code to modify - Archive of obsolete content
notice the flashing red border around the horizontal status bar at the bottom of the browser window.
...notice the flashing red border around each different section of the status bar.
... as a side note it would be good if the inspectorwidget additions were integrated directly in domi, that would help everyone.
Finding the file to modify - Archive of obsolete content
mention the localization layer (note: these layers are not completely mutually exclusive.
... each window and dialog box in mozilla is defined by a single xul file (in some cases other xul files called overlays contribute portions of another window's structure).
...chrome urls have paths that do not necessarily refer to a precise directory hierarchy.
Installing Dehydra - Archive of obsolete content
dehydra is not supported on mac os x.
...please also note that autoconf v2.13 is really needed: it does not work with e.g.
...-wchar $cppfile -s -o /dev/null for example, in the tests directory created by the installation procedure, i can run a dehydra script 'a.js' on a mozilla file like this: g++ -quiet -fplugin=../gcc_dehydra.so \ -fplugin-arg=a.js -fshort-wchar -fpreprocessed \ /home/dmandelin/builds/dehydra-gcc/browser/app/nsbrowserapp.ii -o /dev/null the -fshort-wchar is required for running against firefox, but not necessarily for other codebases.
Documentation for BiDi Mozilla - Archive of obsolete content
while it was published in 2001 and might not be totally accurate, it does help understanding the internals of the bidi code.
...the order of the frames in the content model is not affected, so frames that are adjacent in the content model can be far apart visually.
...note that we are not affected by buggy bidi implementations on specific platforms, since the platform never sees a text fragment with mixed directionality, and is not expected to do anything more complicated than displaying left-to-right text from left to right or right-to-left text from right to left.
Hidden prefs - Archive of obsolete content
note, the ui has "name or email contains:".
... so if you change the quick search query to match based on phone number, the ui will not match the query.
... the default (defined in mailnews.js) is: pref("mail.addr_book.quicksearchquery.format","?(or(primaryemail,c,@v)(displayname,c,@v)(firstname,c,@v)(lastname,c,@v))"); "and", "or" and "not" are valid.
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.
... warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser.
Makefile.mozextension.2 - Archive of obsolete content
note that the original makefile.mozextention merely repeats the steps in getting started with extension development - mozillazine knowledge base (2008).
...note: unfortunately, this wiki system at developer.mozilla.org will try to parse xml declarations - even if they are within a pre tag!!
...efile.mozextension2 ## file: makefile.mozextension2 ## based on http://kb.mozillazine.org/makefile_for_packaging_an_extension ## "this makefile.mozextention is for the test extension" ## the original makefile.mozextention reconstructs http://kb.mozillazine.org/getting_started_with_extension_development # call with: # make -f makefile.mozextension2 make_structure ## (without args for 'all') # note: @echo silent; without @ the command is written in stdout project=test project_name=testworld #~ project_id={xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} project_id=test@testworld.ext project_version=1.0 project_desc="a $(project_name) project with advanced features" project_author=author name # mkdir=$(shell which mkdir) mkdir=/bin/mkdir zipprog=/usr/bin/zip shell = /bin/sh noop = $(shell) -c tr...
Monitoring downloads - Archive of obsolete content
note: the mozistorageconnection method close() is being added to firefox 3 alpha 8; in prior versions of firefox, there is no way to explicitly close the database.
...the remaining rows are set to zeroes since that's not information we have at the moment.
... note that the start time is being divided by 1000 before we create a javascript date object from it.
Scripting - Archive of obsolete content
since the web application has not yet loaded, the window object is still undefined.
...the server is not accessible).
...note: in the future, the webapp script may have lower privileges.
Safely loading URIs - Archive of obsolete content
not all uri loads are safe.
...so if you're implementing a context menu and you add a "view image" option, the source of the image uri would be the page the image is in, not the chrome document the context menu code is in.
...note that checkloaduriwithprincipal is not scriptable in gecko 1.8, so extensions are not able to use it.
open - Archive of obsolete content
file is non-standard, not generally compiled into distributions, is a potential source of huge security holes, and not well tested.
...certain methods of file, such as read and write should not be used when the file is not open.
... other methods, such as remove may not be used when the file is open.
Merging TraceMonkey Repo - Archive of obsolete content
hg clone ssh://hg.mozilla.org/mozilla-central mozilla-central hg clone ssh://hg.mozilla.org/tracemonkey tm-merge cd tm-merge pull mozilla-central into tracemonkey via hg pull ../mozilla-central you will see a notice about adding at least one head to the repository -- this is the mozilla-central head that you are about to merge.
... if the tree does not build successfully you've likely merged something incorrectly.
... once you've pushed to mozilla-central, do a bugzilla search for bugs that are not marked as resolved but have fixed-in-tracemonkey in the whiteboard.
String Quick Reference - Archive of obsolete content
old way: use nsautostring and assignwithconversion() nsautostring widestring; widestring.assignwithconversion("some string"); callwidefunction(widestring); // use widestring again, but need a const prunichar* callwidewithflatstring(widestring.get()) nsautostring widestring2; widestring2.assignwithconversion("another string"); callwidefunction(widestring2); new way: use ns_literal_string or ns_named_literal_string // pre-declare the variable if you'll use it multiple times ns_named_literal_string(widestring, "some string"); callwidefunction(widestring); // use widestring again, but need a const prunichar* callwidewithflatstring(widestring.get()); // inline the string with ns_literal_string callwidefunc...
...tion(ns_literal_string("another string")); converting literal strings to string objects what: converting from const prunichar*/const char* to the appropriate string type why: avoid making extra copies of strings, just to convert between types!
... note: may involve changing existing apis old way: wrap with nscautostring() // foo is a prunichar* string // call // void handlestring(const nsstring& str); handlestring(nsautostring(foo)); new way: wrap with nsdependentstring // foo is a prunichar* string // fix caller to be // void handlestring(const nsastring& str); handlestring(nsdependentstring(foo)); stack-based strings what: use of special stack-oriented classes why: to avoid excess heap allocations and memory leaks wrong: use nsstring/nscstring or raw characters // call getstringvalue(nsastring& out); nsstring value; getstringvalue(value); // call getstringvalue(char** out); char *result; getstringvalue(&result); // don't forget to free result!
Tamarin Acceptance Test Template - Archive of obsolete content
ptance tests (placed in test/acceptance/feature_name): /* -*- mode: js; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 -*- */ /* vi: set ts=4 sw=4 expandtab: (add to ~/.vimrc: set modeline modelines=5) */ /* ***** begin license block ***** * version: mpl 1.1/gpl 2.0/lgpl 2.1 * * the contents of this file are subject to the mozilla public license version * 1.1 (the "license"); you may not use this file except in compliance with * the license.
...if you wish to allow use of your version of this file only * under the terms of either the gpl or the lgpl, and not to allow others to * use your version of this file under the terms of the mpl, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the gpl or the lgpl.
... if you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the mpl, the gpl or the lgpl.
Tamarin mercurial commit hook - Archive of obsolete content
the hook is located in the tamarin-redux repository in the file utils/hooks/tamarin-commit-hook.py this is a simple mercurial hook that checks the following filetypes ('.cpp', '.h', '.as', '.abs', '.py') for the following: tabs anywhere in the line trailing whitespace windows line endings (\r\n) "mark_security_change" - looks for this text and warns user as security changes should not be checked into the public tamarin-redux repository.
...[n]: note that the prompt gives you the options to abort the commit (no), allow the tab (or other violation) on that particular line, or allow the violation for all lines in that file.
... this allows you to reuse the commit message after fixing the issue by using the -l (--logfile) option: hg commit -l /reporoot/.hg/commit.save notes at the moment this is a local-only hook and is not enforced on the server.
Using cross commit - Archive of obsolete content
if you don't, however, then from the parent directory of your source dir, do: cvs co mozilla/tools/cross-commit note that you will need to have $cvsroot and such set up correctly for this to work.
...nk # update to the first branch you want to land on cvs update -rmozilla_1_8_branch layout/base/nscaret.h # modify the files (probably by applying the patch) patch -p0 < ~/caret.patch # commit on all the branches at once # make sure to use -m "commit message" when doing so tools/cross-commit --moz18 --branch mozilla_1_8_0_branch -m "fix some sort of security bug" layout/base/nscaret.h notes note that you must use a -m option with a cvs checkin message.
...(although it works without specifying -m on the command line if you are using x-enabled emacs on linux.) also note that if you don't specify any branches to commit on, cross-commit will commit to the trunk and the mozilla_1_8_branch by default.
Venkman - Archive of obsolete content
note that it is not included in the gecko-based browsers such as k-meleon, galeon and netscape 8.x.
... learning the javascript debugger venkman written by svend tofte to the javascript programmers who are not familiar with other debugging tools.
... venkman internals notes on venkman source code.
Event Handlers - Archive of obsolete content
in both cases the javascript body is compiled just before execution; code that does not depend on the context of the event should be factored into normal javascript file.
... (note that there is a possibility that this may change in the future.) handlers are attached to the bound element, and they are registered by default for bubbling events.
... [editor's note: should we have section on error-handling?
XBL 1.0 Reference - Archive of obsolete content
there are numerous adjustments in the current implementation in comparison of earlier xbl proposals, and not all of them are reflected yet in this document.
...ertion points <children> handling dom changes event flow and targeting flow and targeting across scopes focus and blur events mouseover and mouseout events anonymous content and css selectors and scopes binding stylesheets binding implementations introduction methods properties inheritance of implementations event handlers example - sticky notes updated and adjusted for the current firefox implementation.
... notes.html notes.xml notes.css view this example download all files (.zip archive) need to ask to adjust the server - it gives "access denied" for zip files (?) references initial xbl 1.0 proposal submitted as a note to w3c (does not reflect mozilla implementation, nor future plans) xbl 2.0 project original document information last updated date: april 24, 2006 ...
Install Wizards (aka: Stub Installers) - Archive of obsolete content
to learn more about the xpinstall and installer packages please refer to the annotated browser xpi installer and the xpinstall api reference.
...this saves low-bandwidth users considerable time since they do not need to download software packages they may not be interested in.
... the xpinstall engine is not called directly by the stub installer.
addFile - Archive of obsolete content
typically, absolute pathnames are only used for shared components, or components that come from another vendor, such as /microsoft/shared/msvcrt40.dll.typically, relative pathnames are relative to the main pathname specified in the initinstall method.
... this parameter can also be null, in which case the xpisourcepath parameter is used as a relative pathname.note that the registry pathname is not the location of the software on the machine; it is the location of information about the software inside the client version registry.
...note: if you are installing binary files on a macintosh, be aware that the binary format for those files must be applesingle if the resource information is to be installed properly.
registerChrome - Archive of obsolete content
note that you can combine switches as in the example below.
...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 directory to see how and where the registerchrome function has registered your package with the chrome registry.
Properties - Archive of obsolete content
note that spaces in the arg string are legal.
...note that due to branching (different versions of gecko with different feature sets might be built on the same day), using this property to "detect" the application version may produce false results.
...note, even if triggered using relative urls this will show the full url (after qualification).
setRootKey - Archive of obsolete content
returns nothing.
...if you want to access keys in another portion, you must use this method to change the root key.
... on 16-bit windows platforms, hkey_classes_root is the only valid value and this method does nothing.
panel.consumeoutsideclicks - Archive of obsolete content
« xul reference home consumeoutsideclicks type: boolean controls whether or not the event that caused the popup to be automatically dismissed (or "rolled up") should be consumed or be dispatched as a normal event.
... if it is not set, it defaults to the platform behavior.
...if set to false, the rollup event is not consumed.
flags - Archive of obsolete content
dont-test-empty: for template generated content, the builder will not check that a container is empty.
... dont-build-content: this flag may be used on a tree to indicate that content elements should not be generated.
... this results in a performance enhancement, but you will not be able to use the dom functions to retrieve the tree rows.
panel.level - Archive of obsolete content
if this attribute is not set, the popup window level depends on the platform.
...if a panel has one or more text fields, this attribute should not be set, otherwise ime or on-screen keyboard popups will appear incorrectly.
... for these reasons, you should avoid setting the level if not needed.
reserved - Archive of obsolete content
setting this attribute to "true" indicates that the command is reserved for chrome code and is not available for use in the content.
... this means that, to execute these commands, key events won't be passed to content, and event listeners registered for them in content will not be executed.
... example here, the command to open a new browser window is reserved: <command id="cmd_newnavigator" oncommand="openbrowserwindow()" reserved="true"/> if the keyboard shortcut for that is accel-t, then this code will not work as expected, as compared to when it is run from web content: document.addeventlistener("keydown", handlekey, true); function handlekey(event) { // listen for the "new tab" shortcut if (event.metakey && (event.key == "t")) { // log a message console.log("intercepted accel-t"); // prevent the default browser action event.preventdefault(); event.stoppropagation(); } } ...
value - Archive of obsolete content
it is not used for any specific purpose, but you can access it with a script for your own use.
... be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
...for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user.
Dynamically modifying XUL-based user interface - Archive of obsolete content
note, that haschildnodes() and firstchild are also part of the dom api.
...note: document.createelementns() creates an element, but does not put it anywhere in the document.
...this content, called anonymous content, is not accessible through normal dom methods.
openPopup - Archive of obsolete content
anchor the popup may be either anchored to another node or opened freely.
...the anchor node does not need to be in the same document as the popup.
...it affects menu item highlighting; that is, while a context menu is open, menus opened earlier do not highlight or execute their items.
showPopup - Archive of obsolete content
the anchor and align arguments are ignored if either x or y are not -1.
... to have a popup appear relative to another element yet still offset by some number of pixels, determine the actual screen position of the element using the boxobject.screenx and boxobject.screeny properties of the element, and use those as the x and y arguments offset by the desired values.
...each type of popup is intended to be displayed only temporarily; they are not expected to be displayed permanently.
Methods - Archive of obsolete content
« xul reference home acceptdialog additemtoselection addpane addprogresslistener addsession addtab addtabsprogresslistener advance advanceselectedtab appendcustomtoolbar appendgroup appenditem appendnotification blur cancel canceldialog centerwindowonscreen checkadjacentelement clearresults clearselection click close collapsetoolbar contains decrease decreasepage docommand ensureelementisvisible ensureindexisvisible ensureselectedelementisvisible expandtoolbar extra1 extra2 focus getbrowseratindex getbrowserfordocument getbrowserfortab getbrowserindexfordocument getbutton getdefaultsession geteditor getelementsbyattribute getelementsbyattributens getformattedstring gethtmleditor getindexoffir...
...stvisiblerow getindexofitem getitematindex getnextitem getnotificationbox getnotificationwithvalue getnumberofvisiblerows getpagebyid getpreviousitem getresultat getresultcount getresultvalueat getrowcount getsearchat getselecteditem getsession getsessionbyname getsessionresultat getsessionstatusat getsessionvalueat getstring goback gobackgroup godown goforward goforwardgroup gohome goto gotoindex goup hidepopup increase increasepage insertitem insertitemat invertselection loadgroup loadonetab loadtabs loaduri loaduriwithflags makeeditable movebyoffset moveto movetoalertposition onsearchcomplete ontextentered ontextreverted openpopup openpopupatscreen opensubdialog openwindow preferencefore...
...lement reload reloadalltabs reloadtab reloadwithflags removeallitems removeallnotifications removealltabsbut removecurrentnotification removecurrenttab removeitemat removeitemfromselection removenotification removeprogresslistener removesession removetab removetabsprogresslistener removetransientnotifications replacegroup reset rewind scrollbyindex scrollbypixels scrolltoindex select selectall selectitem selectitemrange selecttabatindex setselectionrange showpane showpopup sizeto startediting stop stopediting swapdocshells syncsessions timedselect toggleitemselection related dom element methods dom:element.addeventlistener dom:element.appendchild dom:element.comparedocumentposition dom:element.dispatcheven...
MenuButtons - Archive of obsolete content
the 'menu' button the 'menu' type of button is used when pressing the button alone should just open the menu and not execute a command directly.
... <button type="menu" label="view"> <menupopup> <menuitem label="icons" type="radio" name="view"/> <menuitem label="list" type="radio" name="view"/> <menuitem label="details" type="radio" name="view"/> </menupopup> </button> note that when the menu is closed, the button doesn't indicate which view is selected.
...the stoppropagation method is used to stop the bubbling effect so that the command event on the button does not get called as well.
state - Archive of obsolete content
ArchiveMozillaXULPropertystate
« xul reference state type: string this read only property indicates whether the popup is open or not.
... four values are possible: closed: the popup is closed and not visible.
... showing: a request has been made to open the popup, but it has not yet been shown.
Sorting and filtering a custom tree view - Archive of obsolete content
this will not work for other types of trees, for example rdf-backed or ones created with dom methods.
... for the sake of simplicity, strings are not localized and the data loaded is hard coded.
..."ascending" : "descending"); } //prepares an object for easy comparison against another.
RDF Query Syntax - Archive of obsolete content
you'll notice that this is the value of the ref attribute which is the desired starting node in the rdf graph.
...it determines which direction to use by examining which data is known and which data is not known yet.
...since three values have been found, the network will now have three potential results: (?start = http://www.xulplanet.com/rdf/a, ?relateditem = http://www.xulplanet.com/rdf/b) (?start = http://www.xulplanet.com/rdf/a, ?relateditem = http://www.xulplanet.com/rdf/c) (?start = http://www.xulplanet.com/rdf/a, ?relateditem = http://www.xulplanet.com/rdf/d) you may note that the ?start variable is repeated for each result.
SQLite Templates - Archive of obsolete content
this is useful for user data, and is suitable as you do not need to calculate where this directory is located.
...note also that the query statement has a where clause which restricts the rows to those with an age greater or equal to 30.
...however, this can become unweidly for more complex queries, and would be more error prone if values were not escaped properly to ensure that extraneous quotes, semicolons and other characters didn't appear in the values.
Using Recursive Templates - Archive of obsolete content
le"> <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 level for each person.
..." class="indent"><label value="julius caesar"/></vbox> <vbox id="row6" class="indent"><label value="ferdinand magellan"/></vbox> </vbox> <vbox id="row3" container="true" empty="false" class="indent"> <label value="female"/> <vbox id="row7" class="indent"><label value="cleopatra"/></vbox> <vbox id="row8" class="indent"><label value="laura secord"/></vbox> </vbox> </groupbox> note how similar content corresponding to the action body is created for both the groups as well as the people.
...sometimes, you will not want a template generate recursive content.
Things I've tried to do with XUL - Archive of obsolete content
short answer: you can't easily, at least not yet.
... this means that creating any sort of visual display (not necessarily "ui"; my use case is for creating a calendar time display) that sizes sanely when the user resizes the window is unfortunately very difficult.
... xbl in listboxes using xbl bindings in listboxes is not easy because there is a big bug there: if you create from js an element you want to bind, and if it is hidden when the listbox is first rendered, the listbox does not create a frame for it, and the xbl doesn't get attached...
Box Model Details - Archive of obsolete content
that means that the flex might not work exactly as you want it.
...the spacer will grow and shrink but not exceed 30 pixels.
...if this was not specified, the default would be stretch, which would make the child elements stretch horizontally.
Open and Save Dialogs - Archive of obsolete content
note that the file picker only works from chrome urls.
...if you do not set this, a suitable default will be selected for you.
...note that the function does not return until the user has selected a file.
Progress Meters - Archive of obsolete content
indeterminate progress meters are used when you do not know the length of time of an operation.
...if this is set to undetermined, the progress meter is indeterminate where you do not know the length of time.
... the value determined is the default if you do not specify this attribute.
Scrolling Menus - Archive of obsolete content
if the available space is large enough, the arrows will not appear.
... note that the exact behavior of the scrolling will depend on the current theme.
...you do not have to do anything in order to get scrolling menus.
Stack Positioning - Archive of obsolete content
here, all three children are buttons, but the elements do not have to be same type.
...stacks have the advantage that when one absolutely positioned element changes its position, the position of the other elements is not affected.
... note that bottom and right attributes, unlike rect, are relative to the bottom and right of the stack.
Window icons - Archive of obsolete content
note: this feature was removed at firefox 67.
... note: the global icons override does not currently work due to bug bug 543490.
... global icon files currently take precedence and bundles are only searched for icons which are not provided by the application.
XUL FAQ - Archive of obsolete content
if your question is not answered here, you can try looking for the answer in the xul documentation or ask in the xul newsgroup.
...(the animation effect when you open the preference window will not stop, if a script outside <prefpane> refers any element inside <prefpane>, while initializing the window.
... if you want to access elements inside <prefpane>, you should put script in the <prefpane> or write script into "onpaneload" of the <prefpane>.) note, that prefwindow only works in chrome xul.
commandset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is not displayed and serves as a container for command elements.
...if this attribute is not specified, or you set it to the value '*', all events are valid.
...if this attribute is not specified, or you set it to the value '*', all elements are valid.
image - Archive of obsolete content
ArchiveMozillaXULimage
note: prior to gecko 8.0, images did not shrink down with the same ratio in both directions when specifying maximum sizes using maxheight or maxwidth.
...this event will not bubble up the element tree.
... validate type: one of the values below this attribute indicates whether to load the image from the cache or not.
rule - Archive of obsolete content
ArchiveMozillaXULrule
if not specified, the rule may match regardless of whether a node is a container or not.
... false: the rule will only match nodes that are not marked as containers.
...if not specified, the rule may match regardless of whether a node has children or not.
<statusbarpanel> - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] firefox 4 note the status bar has been removed.
...unlike normal buttons, a statusbarpanel can only have a label or an image but not both.
... none the text will be not be cropped using an ellipsis.
treecell - Archive of obsolete content
it is not used for any specific purpose, but you can access it with a script for your own use.
... be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
...for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user.
XULRunner FAQ - Archive of obsolete content
not particularly; xulrunner is a internet technology runtime.
...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.
...please search to make sure that your bug has not already been reported.
XUL Application Packaging - Archive of obsolete content
note: for instructions on deploying your applications see deploying xulrunner.
... optional - default is 0 note: this option does not add menu items that make the extension/theme manager available in the ui; that is the responsibility of the application author.
... optional - default is 0 note: the application author is responsible for implementing the nsiprofilemigrator interface; if an implementation is not found no migration will be performed.
mozilla.dev.platform FAQ - Archive of obsolete content
a: xulrunner trunk and 1.8 (but not 1.8.0) build storage by default, and anything can be built with storage if you put in you <tt>mozconfig --enable-storage</tt> q: program received signal exc_bad_instruction, illegal instruction/operand.
...please make sure you're using 1.8.0.4 or later (not 1.8.0.1, which had a bug that prevented this from working properly).
... visual studio express 2005 q: when i try to run xulrunner-stub.exe i get the error "this application failed to start because msvcr80.dll was not found." a: see bug 350616 ...
reftest opportunities files - Archive of obsolete content
it is not always clear why particular files were checked in, but one presumes that something needed 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.
...note that bugs with the testcase keyword already have one or more testcases attached to the bug that can be used when creating the reftest.
2006-11-17 - Archive of obsolete content
no could not run gtk test program, checking why...
... configure regeneration back up, but another outage tonight...
...he also warns that there will be another outage which will cause the servers in his office as well as all tinderboxes to go down.
2006-10-13 - Archive of obsolete content
(meeting notes) bon echo status meeting a bon echo status meeting was held on oct.
... 10 (meeting notes) gecko 1.9/gran paradiso status meeting a gecko 1.9/gran paradiso status meeting was held on oct.
... 11 (notes) ...
2006-10-20 - Archive of obsolete content
decommissioning sparky on friday preed wants to get rid of sparky (a linux build box) and wants to know if there are reasons wy not to do it.
...meeting notes gecko status meeting october 19 (*thursday*) gecko 1.9 status meeting.
...meeting notes ...
2006-11-10 - Archive of obsolete content
announcments mike connor announced new 'driving' bugs "we have added a pair of drivers-only flags...o track bugs that are not strictly blockers, but are wanted as soon as possible" benjamin smedberg announced new rules for patches to toolkit from now on unit test must be provided with all patches.
... other important notes are contained in the link above firefox and thunderbird 1.5.0.8 were released firefox and thunderbird 1.5.0.8 were released on november 7, 2006 blocker nomination and code freeze for 1.5.0.9/2.0.0.1 blocker nomination is due on november 10.
... discussion version numbering changes some discussion about paul's announcement of version number changes meetings november 6 project status meeting (notes) november 7 bon echoe status meeting (notes) november 8 gecko 1.9/gran paradiso status meeting: (agenda) ...
2006-11-17 - Archive of obsolete content
configure regeneration back up, but another outage tonight...
...but there is another outage scheduled so the tinderboxen will be down early.
... version numbering changes continuation of the discussion about preed's announcement of version number changes meetings project status meeting (notes) ...
2006-10-20 - Archive of obsolete content
discussions october 16, 2006, 5:10pm - david marteau notes that using "persist" on templatized content prevents from restoring values for the persistent attributes.
... neil notes that the format of localstore has changed from previous versions and that "persist" is not functioning properly using the new format.
...the bug number has not been posted to the newsgroup and searching in bugzilla was unsuccessful.
NPN_GetAuthenticationInfo - Archive of obsolete content
note: the username may have internal null bytes and may not be null-terminated.
...note: the password may have internal null bytes and may not be null-terminated.
...unless the plugin has special networking needs, it is recommended to use the standard network apis, such as npn_geturlnotify/npn_posturlnotify.
NPN_PluginThreadAsyncCall - Archive of obsolete content
returns nothing.
...in particular, the user must ensure that the function pointer remains callable and the user data is not deallocated until the browser executes the call.
...the browser might not execute calls successfully registered with this api call during plug-in termination.
NPN_RequestRead - Archive of obsolete content
the plug-in can call npn_requestread() on streams that were not initially in np_seek mode as long as the stream is inherently seekable; npn_requestread() automatically changes the mode to np_seek.
... if the stream is not inherently seekable, the stream must have been put in np_seek 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.
NPN_SetValue - Archive of obsolete content
nppvpluginkeeplibraryinmemory specifies that the plugin does not want to be unloaded from memory after the page which initiated it has gone.
...if this is not desired, the plugin can instruct the browser not to unload the dll and not to call np_shutdown when the page is left.
...although the function prototype has type of value void *, the actual boolean should be placed there, not a pointer to a boolean.
NPP_Destroy - Archive of obsolete content
if unsuccessful, the plug-in is not loaded and the function returns an error code.
... to ensure that the browser does not crash or leak memory when the saved data is discarded, npsaveddata's buf field should be a flat structure (a simple structure with no allocated substructures) allocated with npn_memalloc.
... note: you should not perform any graphics operations in npp_destroy as the instance's window is no longer guaranteed to be valid.
Version - Archive of obsolete content
note: in the list below, although rss 1.0 seems to be out of place, it is actually in the correct place chronologically.
... note: there are 3 different versions of rss 0.91.
... note: rss 0.93 and rss 0.94 were only ever released as "drafts" and never became "final" and thus were not meant to actually be used.
SAX - Archive of obsolete content
the following handlers are available: interface purpose nsisaxcontenthandler receive notification of the logical content of a document (e.g.
... nsisaxdtdhandler receive notification of basic dtd-related events.
... nsisaxerrorhandler receive notification of errors in the input stream.
.htaccess ( hypertext access ) - Archive of obsolete content
file accessing : htaccess files can be opened using any text editor, like windows notepad, vin, sublime text editor or any other.
... 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.
... errordocument 404 /notfound.html # redirects traffic to notfound.html in case of a 404 error errordocument 500 /serverr.html # redirects traffic to serverr.html in case of a 500 internal server error for further information see this external article: redirect your traffic for error handling.
Create Your Own Firefox Background Theme - Archive of obsolete content
firefox may reveal more of the lower portion of the image if another toolbar or other ui element is added to the top of the window.
...duplicate names are not allowed, so you may need to try a few times to find a unique name.
...keep in mind that a reviewer may reject your theme if your description is not an accurate representation of your theme.
Theme changes in Firefox 3 - Archive of obsolete content
note: we could use an article called updating themes for firefox 3 that would serve as a how-to guide for updating themes.
...may or may not affect other mac themes that use it.
...the rule that's needed to show and hide the go button and other location bar icons is: #urlbar[pageproxystate="invalid"] > #urlbar-icons > :not(#go-button) , #urlbar[pageproxystate="valid"] > #urlbar-icons > #go-button { visibility: collapse; } images to add add the following images: chrome://global/skin/icons/information-16.png used when presenting information notices.
-ms-accelerator - Archive of obsolete content
initial valuefalseapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete syntax /* the object is not a keyboard shortcut (the default) */ -ms-accelerator: false /* the object is a keyboard shortcut */ -ms-accelerator: true values false the object is not a keyboard shortcut.
...when the option to "hide keyboard navigation indicators until i use the alt key" is enabled in the user's display properties, the "n" is not underlined until the user presses the alt key.
... <!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.
-ms-hyphenate-limit-chars - Archive of obsolete content
if the word does not meet the required minimum number of characters in the word, before the hyphen, or after the hyphen, then the word is not hyphenated.
... negative values are not allowed.
... formal syntax auto | <integer>{1,3} specifications not part of any specification.
-ms-hyphenate-limit-lines - Archive of obsolete content
initial valueno-limitapplies toblock container elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values no-limit indicates that hyphenation is not limited based on the number of consecutive hyphenated lines.
...(hyphenation is effectively disabled.) negative values are not allowed.
... formal syntax no-limit | <integer> specifications not part of any specification.
-ms-hyphenate-limit-zone - Archive of obsolete content
negative values are not allowed.
... negative values are not allowed.
... formal syntax <percentage> | <length> specifications not part of any specification.
-ms-wrap-flow - Archive of obsolete content
initial valueautoapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values auto for floated elements, an exclusion is created; for all other elements, an exclusion is not created.
... formal syntax auto | both | start | end | maximum | clear specifications not part of any specification.
... when the -ms-wrap-flow property's computed value is auto, the element does not become an exclusion element unless its float property's computed value is not none.
-ms-wrap-through - Archive of obsolete content
none the exclusion element does not inherit its parent node's wrapping context.
... formal syntax wrap | none specifications not part of any specification.
... remarks you can use the -ms-wrap-through property to control the effect of exclusions; for instance, to cause one content block to wrap around an exclusion element and another to intersect the same exclusion element.
:-moz-system-metric(windows-default-theme) - 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.
...</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-m...
...etric(windows-default-theme)) { display: none; } specifications not part of any specification.
display-inside - Archive of obsolete content
/* keyword values */ display-inside: auto; display-inside: block; display-inside: table; display-inside: flex; display-inside: grid; display-inside: ruby; /* global values */ display-inside: inherit; display-inside: initial; display-inside: unset; value not found in db!
... formal syntax syntax not found in db!
... candidate recommendation initial specification browser compatibility not supported in any browser.
display-outside - Archive of obsolete content
roup; display-outside: table-row; display-outside: table-cell; display-outside: table-column-group; display-outside: table-column; display-outside: table-caption; display-outside: ruby-base; display-outside: ruby-text; display-outside: ruby-base-container; display-outside: ruby-text-container; /* global values */ display-outside: inherit; display-outside: initial; display-outside: unset; value not found in db!
... none the element generates no boxes, and does not participate in any formatting context.
... formal syntax syntax not found in db!
E4X - Archive of obsolete content
ArchiveWebE4X
note: in gecko 1.8 based browsers such as firefox 1.5, e4x is already partially enabled for web page authors.
...the difference between the two modes is that without the "e4x=1" mime type, any statement-level xml/html comment literals (<!--...-->) are ignored for backwards compatibility with the comment 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).
Expression closures - Archive of obsolete content
do not use!
... description this addition is nothing more than a shorthand for writing simple functions, giving the language something similar to a typical lambda notation.
... examples a shorthand for binding event listeners: document.addeventlistener('click', function() false, true); using this notation with some of the array functions from javascript 1.6: elems.some(function(elem) elem.type == 'text'); ...
Debug.msTraceAsyncCallbackStarting - Archive of obsolete content
note: some debugging tools do not display the information sent to the debugger.
... 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.msUpdateAsyncCallbackRelation - Archive of obsolete content
note: some debugging tools do not display the information sent to the debugger by this function.
... 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.writeln - Archive of obsolete content
if the script is not being debugged, the debug.writeln function has no effect.
...the only difference is that the debug.write function does not send a newline character after sending the strings.
... note: to run this example, you must have a script debugger installed and the script must run in debug mode.
Enumerator.atEnd - Archive of obsolete content
do not use!
...efirst(); while (e.atend() == false) { var drv = e.item(); s += drv.path + " - "; if (drv.isready) { var freegb = drv.freespace / bytespergb; var totalgb = drv.totalsize / bytespergb; s += freegb.tofixed(3) + " gb free of "; s += totalgb.tofixed(3) + " gb"; } else { s += "not ready"; } s += "<br />"; e.movenext(); } return(s); } 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.
Enumerator.item - Archive of obsolete content
do not use!
...efirst(); while (e.atend() == false) { var drv = e.item(); s += drv.path + " - "; if (drv.isready) { var freegb = drv.freespace / bytespergb; var totalgb = drv.totalsize / bytespergb; s += freegb.tofixed(3) + " gb free of "; s += totalgb.tofixed(3) + " gb"; } else { s += "not ready"; } s += "<br />"; e.movenext(); } return(s); } 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.
Enumerator.moveFirst - Archive of obsolete content
do not use!
...efirst(); while (e.atend() == false) { var drv = e.item(); s += drv.path + " - "; if (drv.isready) { var freegb = drv.freespace / bytespergb; var totalgb = drv.totalsize / bytespergb; s += freegb.tofixed(3) + " gb free of "; s += totalgb.tofixed(3) + " gb"; } else { s += "not ready"; } s += "<br />"; e.movenext(); } return(s); } 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.
Enumerator.moveNext - Archive of obsolete content
do not use!
...efirst(); while (e.atend() == false) { var drv = e.item(); s += drv.path + " - "; if (drv.isready) { var freegb = drv.freespace / bytespergb; var totalgb = drv.totalsize / bytespergb; s += freegb.tofixed(3) + " gb free of "; s += totalgb.tofixed(3) + " gb"; } else { s += "not ready"; } s += "<br />"; e.movenext(); } return(s); } 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.
VBArray - Archive of obsolete content
do not use!
... remarks vbarrays are read-only, and cannot be created directly.
...not supported in windows 8.x store apps.
New in JavaScript 1.3 - Archive of obsolete content
additional features of version 1.2, at the time not specified by ecma-262 were kept in the javascript language (see below for a list of differences).
...note that communicator and navigator 4.0-4.05 and earlier ignored scripts with the language attribute set to "javascript1.3" and higher.
...the following features were not part of the standard at that time, but implemented in javascript 1.3.
Object.unobserve() - Archive of obsolete content
the callback should be a reference to a function and not an anonymous function, because this reference will be used to unset the previous observer.
... it's useless to call object.unobserve() with an anonymous function as callback, it will not remove any observer.
...= { name: 'ahmed', age: 25 }; object.observe(person, function(changes) { console.log(changes); }); person.age = 40; // [{name: 'age', object: <obj>, oldvalue: 25, type: 'update'}] object.unobserve(person, function(changes) { console.log(changes); }); person.age = 63; // [{name: 'age', object: <obj>, oldvalue: 40, type: 'update'}] // the callback will always be called specifications not part of any standard.
Object.prototype.unwatch() - Archive of obsolete content
deprecation warning: do not use unwatch() and watch()!
... note: the reason for unwatch() to take the property name prop as its only parameter is due to the "single handler allowing" behavior of the watch() method.
... specifications not part of any standard.
for each...in - Archive of obsolete content
this variable is local to the function, not to the loop.
... description some built-in properties are not iterated over.
... the following snippet iterates over an object's properties, calculating their sum: var sum = 0; var obj = {prop1: 5, prop2: 13, prop3: 8}; for each (var item in obj) { sum += item; } console.log(sum); // logs "26", which is 5+13+8 specifications not part of any standard.
LiveConnect - Archive of obsolete content
mailing list newsgroup rss feed related topics javascript, plugins older notes (please update or remove as needed.) while the bloated liveconnect code in the mozilla source was removed in version 1.9.2 of the platform (see bug 442399), its former api has been restored (see also the specification and this thread) (building on npapi?), and as of java 6 update 12, extensions as well as applets can make use of this restored api.
... the reimplementation also restores the ability to use try-catch exceptions within javascript, and is free of the increasing number of other bugs introduced by the decline of the original liveconnect (e.g., java.lang.string and arrays not working properly).
... note: liveconnect blocked under some conditions liveconnect calls from javascript to java api are blocked when the java control panel security slider is set to very high level, or when the slider is at the default high level and the jre has either expired or is below the security baseline.
StopIteration - Archive of obsolete content
do not use this ancient feature.
... function f() { yield 1; yield 2; throw stopiteration; yield 3; // this is not executed.
...not part of any current standards document ...
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
well, i couldn't letthat continue—fish are flexible, slippery things, and tables are very much not.
... div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} div.card img {float: left; position: relative; z-index: 10; margin: 4px 0 0 0; border: 1px solid #339;} div.card h3 {margin: 0 0 0 4px; padding: 0.2em 0 1px 150px; border: 1px solid #339; border-left: 5px double #339; background: #eec url(body-bg-tan.jpg) bottom left no-repeat fixed; color: #339;} note how the image is pushed downward four pixels, while the h3 is pushed rightward four pixels.
... note: this reprinted article was originally part of the devedge site.
RDF in Fifty Words or Less - Archive of obsolete content
first, rdf is a graph-based model for describing internetresources (like web pages and email messages), and how these resources relate to one another.
...or you might want to relate a bookmark to another bookmark, or keep it in multiple "folders" at once.
... <sm:subject>we won our ultimate game</sm:subject> <sm:body> http://www.mozilla.org/smart-mail/get-body.cgi?id=4025294 </sm:body> </sm:message> </rdf:description> </rdf:rdf> upon receipt of the above monstrosity, the rdf engine folds the rdf into the graph at the appropriate place, and the tree control that actually implements the ui to the bookmarks is notified that it should begin drawing some icons for the latest message about yam soup from aunt helga.
Building up a basic demo with Babylon.js - Game development
if you have already worked through our building up a basic demo series with three.js, playcanvas or a-frame (or you are familiar with other 3d libraries) you'll notice that babylon.js works on similar concepts: camera, light and objects.
... note: you probably noticed the babylon.vector3() method in use here — this defines a 3d position on the scene.
... note: the size or position values (e.g.
GLSL Shaders - Game development
glsl is not as intuitive as javascript.
... note: remember that you don't have to use three.js or any other library to write your shaders — pure webgl (web graphics library) is more than enough.
... note: you can learn more about model, view, and projection transformations from the vertex processing paragraph, and you can also check out the links at the end of this article to learn more about it.
WebVR — Virtual Reality for the Web - Game development
note: for more information, read our webvr concepts article.
... 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.
...it's not easy to achieve, but it doesn't require realistic images.
Square tilemaps implementation: Scrolling maps - Game development
note: when writing this article, we assumed previous reader knowledge of canvas basics such as how get a 2d canvas context, load images, etc., which is all explained in the canvas api tutorial, as well as the basic information included in our tilemaps introduction article.
... this article also builds upon implementing static square tilemaps — you should read that too if you've not done so already.
... there's another demo available, that shows how to make the camera follow a character.
2D breakout game using pure JavaScript - Game development
frameworks speed up development time and help take care of boring parts of the game, but if something is not working as expected, you can always try to debug that or just write your own solutions in pure javascript.
... note: if you are interested in learning about 2d web game development using a game library, consult this series' counterpart, 2d breakout game using phaser.
... note: this series of articles can be used as material for hands-on game development workshops.
Buttons - Game development
new variables we will need a variable to store a boolean value representing whether the game is currently being played or not, and another one to represent our button.
... note: the over event is the same as hover, out is when the pointer moves out of the button and down is when the button is pressed.
...you only want the ball to move when the button is pressed, not before!
Load the assets and print them on screen - Game development
block) and the preload() function: var ball; note: for the sake of this tutorial, we will use global variables.
...(note that the file name does not also have to be the same, but we'd recommend it, as it makes everything easier to follow.) of course, to load the image, it must be available in our code directory.
... now, to show it on the screen we will use another phaser method called add.sprite(); add the following new code line inside the create() function as shown: function create() { ball = game.add.sprite(50, 50, 'ball'); } this will add the ball to the game and render it on the screen.
502 - MDN Web Docs Glossary: Definitions of Web-related terms
a server can act as a gateway or proxy (go-between) between a client (like your web browser) and another, upstream server.
... normally the upstream server is not down (i.e.
... furnishes no response to the gateway/proxy), but simply does not understand the same data-exchange protocol as the gateway/proxy.
Asynchronous - MDN Web Docs Glossary: Definitions of Web-related terms
the term asynchronous refers to two or more objects or events not existing or happening at the same time (or multiple related things happening without waiting for the previous one to complete).
... when software communicates asynchronously, a program may make a request for information from another piece of software (such as a server), and continue to do other things while waiting for a reply.
...when the secondary task is completed, the original task is notified using an agreed-upon mechanism so that it knows the work is done, and that the result, if any, is available.
Conditional - MDN Web Docs Glossary: Definitions of Web-related terms
a condition is a set of rules that can interrupt normal code execution or change it, depending on whether the condition is completed or not.
...otherwise, another instruction is executed.
... it is also possible to repeat the execution of an instruction, or set of instructions, while a condition is not yet fulfilled.
Cross-site scripting - MDN Web Docs Glossary: Definitions of Web-related terms
these attacks succeed if the web app does not employ enough validation or encoding.
... the user's browser cannot detect the malicious script is untrustworthy, and so gives it access to any cookies, session tokens, or other sensitive site-specific information, or lets the malicious script rewrite the html content.
... learn more general knowledge cross-site scripting (xss) cross-site scripting on wikipedia cross-site scripting on owasp another article about cross-site scripting xss attack – exploit & protection ...
Gutters - MDN Web Docs Glossary: Definitions of Web-related terms
f8f8; padding: 1em; color: #d9480f; } .wrapper { display: grid; grid-template-columns: repeat(3,1.2fr); grid-auto-rows: 45%; grid-column-gap: 20px; grid-row-gap: 20px; } <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> </div> in terms of grid sizing, gaps act as if they were a regular grid track however nothing can be placed into the gap.
... the grid-gap properties are not the only thing that can cause tracks to space out.
... margins, padding or the use of the space distribution properties in box alignment can all contribute to the visible gap – therefore the grid-gap properties should not be seen as equal to “the gutter size” unless you know that your design has not introduced any additional space with one of these methods.
JSON - MDN Web Docs Glossary: Definitions of Web-related terms
javascript object notation (json) is a data-interchange format.
... although not a strict subset, json closely resembles a subset of javascript syntax.
... json does not natively represent more complex data types like functions, regular expressions, dates, and so on.
Progressive Enhancement - MDN Web Docs Glossary: Definitions of Web-related terms
special notice should be taken of accessibility.
...graceful degradation is related but is not the same thing and is often seen as going in the opposite direction to progressive enhancement.
... in reality both approaches are valid and can often complement one another.
Quality values - MDN Web Docs Glossary: Definitions of Web-related terms
the importance of a value is marked by the suffix ';q=' immediately followed by a value between 0 and 1 included, with up to three decimal digits, the highest value denoting the highest priority.
... when not present, the default value is 1.
...nevertheless, with the same quality, more specific values have priority over less specific ones: text/html;q=0.8,text/*;q=0.8,*/*;q=0.8 value priority text/html 0.8 (but totally specified) text/* 0.8 (partially specified) */* 0.8 (not specified) some syntax, like the one of accept, allow additional specifiers like text/html;level=1.
Random Number Generator - MDN Web Docs Glossary: Definitions of Web-related terms
these include: that it's computationally unfeasible for an attacker (without knowledge of the seed) to predict its output that if an attacker can work out its current state, this should not enable the attacker to work out previously emitted numbers.
... most prngs are not cryptographically secure.
...note that this is not a cryptographically secure prng.
Request header - MDN Web Docs Glossary: Definitions of Web-related terms
not all headers appearing in a request are request headers.
... in addition, cors defines a subset of request headers as simple headers, request headers that are always considered authorized and are not explicitly listed in responses to preflight requests.
...pplication/xml;q=0.9,*/*;q=0.8 accept-language: en-us,en;q=0.5 accept-encoding: gzip, deflate, br referer: https://developer.mozilla.org/testpage.html connection: keep-alive upgrade-insecure-requests: 1 if-modified-since: mon, 18 jul 2016 02:36:04 gmt if-none-match: "c561c68d0ba92bbeb8b0fff2a9199f722e3a621a" cache-control: max-age=0 strictly speaking, the content-length header in this example is not a request header like the others, but an entity header: post /myform.html http/1.1 host: developer.mozilla.org user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0 content-length: 128 learn more technical knowledge list of all http headers ...
Response header - MDN Web Docs Glossary: Definitions of Web-related terms
not all headers appearing in a response are response headers.
...note that strictly speaking, the content-encoding and content-type headers are entity header: 200 ok access-control-allow-origin: * connection: keep-alive content-encoding: gzip content-type: text/html; charset=utf-8 date: mon, 18 jul 2016 16:06:00 gmt etag: "c561c68d0ba92bbeb8b0f612a9199f722e3a621a" keep-alive: timeout=5, max=997 last-modified: mon, 18 jul 2016 02:36:04 gmt server: apache set-cookie: mykey=myvalue; expires=mon, 17-jul-2017 16:06:00 gmt; max-age=31449600; path=/; secure transfer-encoding: chunked vary: cookie...
..., accept-encoding x-backend-server: developer2.webapp.scl3.mozilla.com x-cache-info: not cacheable; meta data too large x-kuma-revision: 1085259 x-frame-options: deny ...
Scope - MDN Web Docs Glossary: Definitions of Web-related terms
if a variable or other expression is not "in the current scope," then it is unavailable for use.
... scopes can also be layered in a hierarchy, so that child scopes have access to parent scopes, but not vice versa.
... a function serves as a closure in javascript, and thus creates a scope, so that (for example) a variable defined exclusively within the function cannot be accessed from outside the function or within other functions.
Symbol - MDN Web Docs Glossary: Definitions of Web-related terms
note: if you are familiar with ruby's (or another language) that also has a feature called "symbols", please don’t be misguided.
... for example: let sym = symbol("sym") alert(sym) // typeerror: cannot convert a symbol value to a string that’s a "language guard" against messing up, because strings and symbols are fundamentally different, and should not occasionally convert one into another.
...the global symbol registry is mostly built by javascript's compiler infrastructure, and the global symbol registry's content is not available to javascript's run-time infrastructure, except through these reflective methods.
Thread - MDN Web Docs Glossary: Definitions of Web-related terms
however, modern javascript offers ways to create additional threads, each executing independently while possibly communicating between one another.
...this is used to create sites capable of notifying the user when things happen while they're not actively engaged with a site.
... such as notifying a user they have received new email even though they're not currently logged into their mail service.
Type coercion - MDN Web Docs Glossary: Definitions of Web-related terms
type coercion is the automatic or implicit conversion of values from one data type to another (such as strings to numbers).
... type conversion is similar to type coercion because they both convert values from one data type to another with one key difference — type coercion is implicit whereas type conversion can be either implicit or explicit.
... the compiler could have coerced the 5 into a number and returned a sum of 14, but it did not.
Test your skills: WAI-ARIA - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
...assuming you are not able to change the elements used, how can you allow screenreader users to recognize this as a list?
... the problem we have now is that when the dom changes to show a new decription, screenreaders cannot see what has changed.
Accessibility - Learn web development
sites should also not cause harm: web features like motion can cause migraines or epileptic seizures.
... note: if you are working on a computer/tablet/other devices where you don't have the ability to create your own files, you can try out most of the code examples in an online coding program such as jsbin or glitch.
... accessible multimedia another category of content that can create accessibility problems is multimedia — video, audio, and image content need to be given proper textual alternatives, so they can be understood by assistive technologies and their users.
Fundamental CSS comprehension - Learn web development
note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page.
... note: bear in mind that the second ruleset sets font-size: 10px; on the <html> element — this means that for any descendants of <html>, an em will be equal to 10px rather than 16px as it is by default.
...this could affect the values you need, although in this simple example this is not an issue.) other things to think about: you'll get bonus marks if you write your css for maximum readability, with a separate declaration on each line.
Attribute selectors - Learn web development
li[class="a"] matches a selector with a class of a, but not a selector with a class of a with another space-separated class as part of the value.
... (aside: it may help to note that ^ and $ have long been used as anchors in so-called regular expressions to mean begins with and ends with.) the next example shows usage of these selectors: li[class^="a"] matches any attribute value which starts with a, so matches the first two 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.
Test Your Skills: Fundamental layout comprehension - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... you will not need to edit the html in order to achieve this layout and the techniques you should use are: positioning float flexbox css grid layout there are a few ways in which you could achieve some of these tasks, and there often isn’t a single right or wrong way to do things.
...make notes as you experiment.
Typesetting a community school homepage - Learn web development
note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page.
... give your headings a little bit of letter-spacing to make them not too too squashed, and allow the letters to breathe a bit.
... give the active state a noticeably different styling so it stands out nicely, but make it still fit in with the overall page design.
How do you host your website on Google App Engine? - Learn web development
if you've not created a project before, you'll need to select whether you want to receive email updates or not, agree to the terms of service, and then you should be able to continue.
... enter a name for the project, edit your project id and note it down.
...if you've not got one to use, download and unzip this sample app.
How do I use GitHub Pages? - Learn web development
it will look something like this: note: you could also consider using a git graphical user interface to do the same work, if you feel uncomfortable with the command line.
...note that windows has its own command conventions differing from linux and os x, so the commands below may vary on your machine.
...then, you need to enter the following commands (pressing enter after each one) to push those changes to github: git add --all git commit -m 'another commit' git push you can replace another commit with a more suitable message to describe what change you just made.
What is a web server? - Learn web development
(not all isps provide a fixed ip address for home lines) a dedicated web server is typically maintained by a third-party.
...if not, an application server builds the necessary file.
... if neither process is possible, the web server returns an error message to the browser, most commonly 404 not found.
How the Web works - Learn web development
this theory is not essential to writing web code in the short term, but before long you'll really start to benefit from understanding what's happening in the background.
...however, it's not very easy to remember, is it?
...if websites were sent as single big chunks, only one user could download one at a time, which obviously would make the web very inefficient and not much fun to use.
Add a hitmap on top of an image - Learn web development
do not use server-side image maps, which require the user to have a mouse.
... how to insert an image map, properly step 1: the image not just any image is acceptable.
...it's not enough to resize the image for small screens, because the coordinates stay the same and no longer match the image.
Mozilla splash page - Learn web development
note: the example html file contains quite a lot of css, to style the page.
... note: you should optimise your jpg and png images to make them as small as possible, while still looking ok.
... note: to properly test the srcset/sizes examples, you'll need to upload your site to a server (using github pages is an easy and free solution), then from there you can test whether they are working properly using browser developer tools such as the firefox network monitor.
Multimedia and Embedding - Learn web development
if you've not worked through this module (or something similar), work through it first, then come back!
... note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
...in this article we'll look at how to use it in more depth, including basics, annotating it with captions using <figure>, and how it relates to css background images.
Image gallery - Learn web development
note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page.
... it sets the width of any images inside the thumb-bar <div> (so-called "thumbnail" images) to 20%, and floats them to the left so they sit next to one another on a line.
... if the class name not "dark", changes the <button> class to "dark", its text content back to "darken", and the background-color of the overlay <div> to "rgba(0,0,0,0)".
Test your skills: Events - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... note: in the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
... the html should not be changed; just the javascript.
Test your skills: Functions - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... note: in the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
... you'll want to clear the canvas before drawing, so that when the code is updated in the case of the live version, you don't get lots of rectangles drawn on top of one another.
Client-side web APIs - Learn web development
note: if you are working on a device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... fetching data from the server another very common task in modern websites and applications is retrieving individual data items from the server to update sections of a webpage without having to load an entirely new page.
... third party apis the apis we've covered so far are built into the browser, but not all apis are.
Silly story generator - Learn web development
note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page.
... will generate another random silly story if you press the button again (and again...) the following screenshot shows an example of what the finished program should output: to give you more of an idea, have a look at the finished example (no peeking at the source code!) steps to complete the following sections describe what you need to do.
... inside the first if block, add another string replacement method call to replace the name 'bob' found in the newstory string with the name variable.
Introducing JavaScript objects - Learn web development
note: if you are working on a computer/tablet/other devices where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... object prototypes prototypes are the mechanism by which javascript objects inherit features from one another, and they work differently to inheritance mechanisms in classical object-oriented programming languages.
... working with json data javascript object notation (json) is a standard text-based format for representing structured data based on javascript object syntax, which is commonly used for representing and transmitting data on web sites (i.e.
Measuring performance - Learn web development
the performanceobserver api can be used to observe performance measurement events and it can notify you of new performance entries as they are recorded in the browser's performance timeline.
... while this article does not dive into using these apis, it is useful to know they exist.
... webpagetest.org is another example of a tool that automatically tests your site and returns useful metrics.
Web performance - Learn web development
learning pathway while knowing html, css, and javascript is needed for implementing many web performance improvement recommendations, knowing how to build applications is not a necessary pre-condition for understanding and measuring web performance.
...in this article, we discuss the various loading metrics, animation, and responsiveness metrics, along with best practices to improve user perception, if not the actual timings.
...in this article we look at some css properties that impact performance and suggested ways of handling styles to ensure performance is not negatively impacted.
Getting started with Ember - Learn web development
as you work through this series of tutorials, you'll notice ember's opinions — such as strict naming conventions of component files.
... a note on todomvc and accessibility the todomvc project has a few issues in terms of adhering to accessible/default web practices.
... if everything is working correctly, you should see a page like this: note: on windows systems without windows subsystem for linux (wsl), you will experience slower build-times overall compared to macos, linux, and windows with wsl.
React interactivity: Editing, filtering, conditional rendering - Learn web development
beneath our previous addition, add the following — here we are using the object.keys() method to collect an array of filter_names: const filter_names = object.keys(filter_map); note: we are defining these constants outside our app() function because if they were defined inside it, they would be recalculated every time the <app /> component re-renders, and we don’t want that.
...this is not what we want!
... choosing a filter in your browser will now remove the tasks that do not meet its criteria.
Learn web development
the aim of this area of mdn is not to take you from "beginner" to "expert" but to take you from "beginner" to "comfortable." from there, you should be able to start making your way, learning from the rest of mdn, and other intermediate to advanced resources that assume a lot of previous knowledge.
...we have started keeping learning area release notes to show what has changed — keep checking back frequently!
... note: our glossary provides terminology definitions.
ChromeWorkers and the Chrome worker loader
that makes it available not only to the application itself, but also to add-ons.
... note: if you're contributing content to this section, create subpages using the "new sub-page" option in the "this page" menu.
...this module loader should not surprise developers familiar with commonjs, as it implements a minimal commonjs require().
Lightweight themes
firefox may reveal more of the lower portion of the image if another toolbar or other ui element is added to the top of the window.
...duplicate names are not allowed, so you may need to try a few times to find a unique name.
...keep in mind that a reviewer may reject your theme if your description is not an accurate representation of your theme.
Benchmarking
in particular, "gc poisoning" is used in all debug builds, and in optimized nightly builds (but not opt developer edition or beta builds).
... another option that is on by default in non-release builds is the preference javascript.options.asyncstack, which provides better debugging information to developers.
... flash plugin if you are profiling real websites, you should disable the adobe flash plugin so you are testing firefox code and not flash jank problems.
Bugzilla
what to do and what not to do in bugzilla tips for how to use bugzilla, as well as things you should avoid.
... how to tell if a bug has already been reported it's useful (but not mandatory) for you to check if the problem you're reporting has been already tracked.
... testopia - test case management extension bugzilla.org - the project site wikipedia:bugzilla - general description of bugzilla (not specific to mozilla projects) bmo on wiki.mozilla.org - information about mozilla's customized bugzilla installation, including how to contribute to it tools bugzilla todos lists review and flag requests, patches to check in, unfulfilled requests you made of other people, and assigned bugs.
Continuous Integration
be - b2g build jobs for engineering builds; user builds are denoted with b, the same as for desktop and android builds.
... talos performance tests all performance tests displayed in treeherder are run using the talos framework, and denoted by the letter t.
... talos is used to execute several suites for desktop firefox and firefox for android; these suites are denoted using lower-case letters, e.g., t(c d g1 o s tp).
Cookies Preferences in Mozilla
these preferences apply to most mozilla products (including firefox and seamonkey), however they are application-specific, so not all of them may apply to you.
... network.cookie.cookiebehavior default value: 0 0 = accept all cookies by default 1 = only accept from the originating site (block third party cookies) 2 = block all cookies by default 3 = use p3p settings (note: this is only applicable to older mozilla suite and seamonkey versions.) 4 = storage access policy: block cookies from trackers network.cookie.lifetimepolicy default value: 0 0 = accept cookies normally 1 = prompt for each cookie (prompting was removed in firefox 44) 2 = accept for current session only 3 = accept for n days network.cookie.lifetime.days default value: 90 only used if network.cookie.lifetimepolicy is set to 3 sets the number of days that the lifetime of cookies should be limited to.
...00 configures the maximum amount of cookies to be stored valid range is from 0-65535, rfc 2109 and 2965 require this to be at least 300 network.cookie.maxperhost default value: 50 configures the maximum amount of cookies to be stored per host valid range is from 0-65535, rfc 2109 and 2965 require this to be at least 20 network.cookie.disablecookieformailnews default value: true true = do not accept any cookies from within mailnews or from mail-style uris false = allow cookies in these situations this preference is applicable to all versions of seamonkey.
Creating JavaScript callbacks in components
javascript functions as callbacks another common use of the pattern is found in addeventlistener / removeeventlistener.
...note, that since the javascript function is a single method, this magic only works for callback interfaces with a single method, like nsidomeventlistener.
...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.
Capturing a minidump
small minidumps are created by the breakpad crash reporting tool, but sometimes that's not sufficient to diagnose a problem.
... for example, if the application is hanging (not responding to input, but hasn't crashed) then breakpad is not triggered, and it can be difficult to determine where the problem lies.
... if firefox is not already running, then open windbg from the start menu (start->all programs->debugging tools for windows->windbg).
Debugging a hang on OS X (Archived)
note that sampling will quickly hog up a lot of memory if you leave it on for too long!
...note that only 3-4 seconds usually suffice, note that this will quickly hog up a lot of memory if you leave it on for too long!
... when you have the raw sample data, you can't just save that and attach it to a bug, because the format is not very usable (unless the developer is a mac hacker).
Inner and outer windows
consider that when the user is looking at a document in a browser window, not only can the document the user is currently viewing change, but the document's contents can change.
...this may be a window or a tab, or it might be an <iframe> contained within another document.
...not only can the outermost document be navigated, but if the user clicks a link in one of the frames, that frame can navigate.
Developer guide
this guide provides information that will not only help you get started as a mozilla contributor, but that you'll find useful to refer to even if you are already an experienced contributor.
... searchfox another option for mozilla code searching.
... treeherder treeherder shows the status of the tree (whether or not it currently builds successfully).
Linux compatibility matrix
distribution kernel glibc glib gtk+2 gtk+3 pixman stdc++ gcc clang python3 released eol notes red backgrounds denote lack of compatibility with current versions of firefox.
... in the eol column, they denote distribution versions past their end of life.
... yellow backgrounds denote compatibility with esr78 green backgrounds denote compatibility with the current release (as of writing, 78) greener backgrounds denote compatibility with the current mozilla-central (as of writing, 80).
Site Identity Button
if the site identity button on your site shows something you do not expect (for example, an orange warning triangle when you expect a green padlock) you can find out the cause of the problem by looking in the web console in the firefox developer tools: ensure your web console is displaying messages in the 'security' category force-refresh the page on your site that is causing problems watch for any security messages that may appear a downgraded security ui will be due to one of these three problems: mixed content - while your page has been served over tls, but su...
...bresources loaded for your page have not.
... use of a weak cipher - in this case, you're using tls but a strong cipher was not available.
HTMLIFrameElement.download()
if this is not specified, the filename used will be the original filename, as specified in the url.
...if this is not specified there will be no referrer.
... examples var browser = document.queryselector('iframe'); var request = browser.download(foourl, { filename: 'foo.bin' }); request.onsuccess = function() { console.log("file downladed"); } request.onerror = function() { console.log("download error"); } specification not part of any specification.
HTMLIFrameElement.getMuted()
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.
...t.onsuccess = function() { if(request.result) { console.log('the browser is muted.'); } else { console.log('the browser is unmuted.'); } } promise version: var browser = document.queryselector('iframe'); browser.getmuted().then(function(muted) { if(muted) { console.log('the browser is muted.'); } else { console.log('the browser is unmuted.'); } }); specification not part of any specification.
HTMLIFrameElement.getStructuredData()
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.
... specification not part of any specification.
HTMLIFrameElement.getVisible()
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.
...'true' : 'false'); } specification not part of any specification.
HTMLIFrameElement.getVolume()
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.
...e callback version: var browser = document.queryselector('iframe'); var request = browser.getvolume(); request.onsuccess = function() { console.log('the current browser volume is ' + request.result); } promise version: var browser = document.queryselector('iframe'); browser.getvolume().then(function(volume) { console.log('the current browser volume is ' + volume); }); specification not part of any specification.
HTMLIFrameElement.goBack()
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.
... examples back.addeventlistener('touchend',function() { browser.goback(); }); specification not part of any specification.
HTMLIFrameElement.goForward()
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.
... examples fwd.addeventlistener('touchend',function() { browser.goforward(); }); specification not part of any specification.
HTMLIFrameElement.mute()
MozillaGeckoChromeAPIBrowser APImute
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.
... example var browser = document.queryselector('iframe'); browser.mute(); specification not in a specification.
HTMLIFrameElement.reload()
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.
... examples stopreload.addeventlistener('touchend',function() { if(stopreload.textcontent === 'x') { browser.stop(); } else { browser.reload(); } }); specification not part of any specification.
HTMLIFrameElement.sendTouchEvent()
note: this method is available for touch-enabled devices only.
... modifiers a number representing a key pressed at the same time the mouse button was clicked: 1 : alt 2 : ctrl 4 : shift 8 : meta 16 : alt gr 32 : caps lock 64 : fn 128 : num lock 256 : scroll 512 : symbol lock 1024 : win note: you can specify multiple key modifiers separated by a pipe symbol, for example 1 | 1014.
... examples var browser = document.queryselector('iframe'); browser.sendtouchevent("touchstart", [1], [x], [y], [2], [2], [20], [0.5], 1, 0); specification not part of any specification.
HTMLIFrameElement.setVolume()
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.
... example var browser = document.queryselector('iframe'); browser.setvolume(0.5); specification not part of any specification.
HTMLIFrameElement.stop()
MozillaGeckoChromeAPIBrowser APIstop
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.
... examples stopreload.addeventlistener('touchend',function() { if(stopreload.textcontent === 'x') { browser.stop(); } else { browser.reload(); } }); specification not part of any specification.
HTMLIFrameElement.unmute()
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.
... example var browser = document.queryselector('iframe'); browser.unmute(); specification not part of any specification.
ChromeWorker
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.
... addons must use absolute urls to load their workers, and those urls have to be using a chrome:// or resource:// protocol (file:// is not accepted).
-moz-window-dragging
the -moz-window-dragging css property specifies whether a window is draggable or not.
... the property was added in firefox 35 to solve intermittent problems related to firefox windows not being moveable when busy (bug 944836).
... no-drag the window is not draggable formal syntax drag | no-drag example toolbarpaletteitem { -moz-window-dragging: no-drag; } specifications this property is not part of any specification.
MozBeforePaint
gecko 2.0 adds a new method for performing javascript controlled animations that synchronize not only with one another, but also with css transitions and smil animations being performed within the same window.
... this allows multiple animations to remain in sync with one another within the context of a given window.
...this computes the current position for the animating box and updates the box's position on screen, and, if the animation sequence is not yet complete, calls window.requestanimationframe() to schedule the next animation frame to be drawn.
MozScrolledAreaChanged
note: while you can poll the values of document.scrollwidth and document.scrollheight to watch for changes to the document size, reading these properties can trigger document reflow, which can make them computationally expensive.
... bubblesread only boolean whether the event normally bubbles or not.
... cancelableread only boolean whether the event is cancellable or not.
Gecko's "Almost Standards" Mode
(see the devedge article "images, tables, and mysterious gaps" for a detailed explanation of how such layouts are treated in "standards" mode.) in slightly more detail, what differs in almost-standards mode is roughly this: inline boxes that have no non-whitespace text as a child and have no border, padding, or margin: do not influence the size of the line box (that is, their line-height is ignored) do not get a height (e.g., for their background) larger than that of their descendants, even if their font size is larger (if they have no descendants, they are zero-height positioned at their baseline) other than this one difference, "almost standards" and "standards" modes are exactly the same in terms of layout and o...
...authors outside of ibm do not need to worry about the custom doctype that will also trigger "almost standards" mode.
... note: this reprinted article was originally part of the devedge site.
Geckoview-Junit Tests
mozilla-central$ mach install --app org.mozilla.geckoview.test to run all tests: mozilla-central$ mach geckoview-junit to run just one class of tests: mozilla-central$ mach geckoview-junit <class> please note that unlike robocop tests, <class> needs to be specified using the fully qualified class name including the package, e.g.
...to disable a single test, edit the source code and insert junit's @ignore annotation before the existing @test annotation.
... @test fun contentcrashignored() { // cannot test x86 debug builds due to gecko's "ah_crap_handler" // that waits for debugger to attach during a sigsegv.
IPDL Best Practices
simply calling delete on a pointer to an actor is not enough.
...do not use them as data structures outside of ipdl, or wou will eventually find yourself in bad situations to implement proper memory management.
...reference counting protocol actors is tricky here is the easiest way to get it right the first time (lessons learned from the http channel and geolocation protocols): allocpprotocol calls addref deallocpprotocol calls release this ensures that the actor will not disappear from under ipdl, and that you won't get bizarre crashes at other times if ipdl deletes the protocol tree.
Integrated Authentication
mozilla does not have its own internal implementation of spnego.
...this is mainly due to the fact that ntlmssp does not provide a means to negotiate use of ntlmv2/lmv2.
...so, it is paramount that the browser does not freely exchange ntlm user credentials with any server that requests them.
AddonInstall
releasenotesuri nsiuri the uri of release notes for this install.
... void install( ) cancel() cancels the install process, it cannot be restarted after this.
... void cancel( ) addlistener() adds a new installlistener if the listener is not already registered to monitor this specific addoninstall.
AddonListener
addonlisteners can be registered with addaddonlistener() and will then receive notification of changes to the add-ons currently installed.
... these notifications come in the form of calls to methods on the listener object.
... a listener only needs to implement the methods corresponding to the events it cares about; missing methods will not cause any problems.
AddonUpdateChecker
error_unknown_format the update information was not in any known format.
... error_security_error the update information was not signed by the update key used for retrieval.
... void checkforupdates( in string id, in string type, in string updatekey, string url, in updatechecklistener listener ) parameters id the id of the add-on being checked for updates type the type of add-on being checked for updates updatekey an optional update key for the add-on url the url of the add-on's update manifest listener an observer to notify of results ...
Add-on Repository
results passed to the searchcallback object only include add-ons that are compatible with the current application and are not already installed or in the process of being installed.
...a new search will immediately fail if the addonrepository is already handling another search request.
...does nothing if there is no search in progress.
OSFile.jsm
smartphones, tablets) and because, regardless of the platforms, doing too much i/o penalizes not just your application but potentially all the applications running on the system, which is quite bad for the user experience.
... consequently, one of the key design choices of os.file is to provide operations that are low-level enough that they do not hide any i/o from the developer (which could cause the developer to perform more i/o than they think) and, since not all platforms have the same features, offer system-specific information that the developer can use to optimize his algorithms for a platform.
...from a worker thread in some cases, the main thread api for os.file is not appropriate as it would require too much message passing, or because the code that requires file i/o is already executed on a worker thread.
openLocationLastURL.jsm
if the user is not in private browsing mode, this automatically updates the value of the general.open_location.last_url preference.
... note: this module automatically handles private browsing mode for you.
... the value preserved across accesses is not preserved when the user exits private browsing mode.
Localizing extension metadata on addons.mozilla.org
the localizable data fields of an extension are: name homepage summary description eula privacy policy version notes developer comments when you submit a new extension to amo, the process is divided into several steps.
... getting translation help you are kindly advised not to use any automatic online translation, which can bring unpleasant low-quality output to users.
... 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.
Translation phase
note: if you are starting a new localization and decide to use an offline tool for localizing mozilla applications, you will need to become familiar with using mercurial (hg).
...please note the pontoon is not available for all web projects yet.
...then you may not be interested in using any of the tools listed above for your localizations.
What every Mozilla translator should know
l10n stands for localization = l + another 10 letters + n mailing lists and other resources there are several mailing lists to keep the track of what's going on, which are available as newsgroups, as well, both on news.mozilla.org and google groups: the main l10n list also available as mozilla.dev.l10n, .l10n in short.
...discussions of interest to the general mozilla developer community are at least notified here.
... to keep the track of what's going on, it's also a good idea to read the planet mozilla l10n when you have a problem use the above mailing lists the person in charge of the mozilla l10n is axel hecht (l10n at mozilla.com), pike on irc another interesting way of getting help is the irc channel #l10n at irc.mozilla.org useful tools the l10n dashboard pontoon narro translate toolkit koala 0.1 mozillatranslator mercurial the hg is organized into several repositories, sometimes called branches.
Basics
notice how the mathematics appear in the main flow of text and respond as you resize the window.
...the following example shows the i-th step of the multiplication of a matrix a by a vector x (notice how ai1 , ...
... you can also do other weird and risky things which are not portable, bongo warns, such as mixing mathml with other markups lizard + bongo = ∫ a b d x + mathml and javascript html content <p> and you can turn to javascript and the dom for dynamic operations.
Mozilla Port Blocking
background on 08/15/2001, cert issued a vulnerability note vu#476267 for a "cross-protocol" scripting attack, known as the html form protocol attack which allowed sending arbitrary data to most tcp ports.
..."access to the port number given has been disabled for security reasons." "establishing a connection to an unsafe or otherwise banned port was prohibited" "0x804b0013 (ns_error_port_access_not_allowed)" if your product or web site uses a port which is blocked by mozilla's default port blocking rules, you can either change the port of your service to a unblocked value (recommended if possible) or ask your mozilla users to enable the port.
... more information nsioservice.cpp gbadportlist bug 83401 vulnerability note vu#476267 dougt@netscape.com original document information author(s): doug turner last updated date: august 15, 2007 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details.
Mozilla projects on GitHub
this is a great place to start looking for any projects not listed below.
...it does not include everything since it's hard to keep track of all the smaller projects.
... asknot the what can i do for mozilla web site, which helps you figure out how you can contribute to mozilla.
mozilla::MonitorAutoEnter
methods wait() nsresult wait( in printervaltime interval = pr_interval_no_timeout ); wait on the underlying monitor until it is notifyed.
... notify() nsresult notify(void); notify one thread waiting on the underlying monitor.
... notifyall() nsresult notifyall(void); notify all threads waiting on the underlying monitor.
mozilla::Mutex
does not incur a runtime penalty in optimized builds.
... assertnotcurrentthreadowns() assert that the current thread does not own this mutex.
... does not incur a runtime penalty in optimized builds.
Intel Power Gadget
note: the power profiling overview is worth reading at this point if you haven't already.
...this is interesting, but again not useful for power profiling purposes.
... (an energia dashboard can be seen here; please note that the data has not been updated since early 2014.) version 3.0 (available on mac and windows, but not on linux) also exposes an api from which the same measurements can be extracted programmatically.
Preferences system
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 platforms where the window size does not change as the selected panel is changed (e.g.
... not using "toolbar" will cause the preferences dialog to only display one preference pane.
... example: var features = "chrome,titlebar,toolbar,centerscreen,modal"; window.opendialog(url, "preferences", features); bugzilla the component for bugs in the preferences bindings (but not in firefox/thunderbird options ui) is toolkit:preferences (file a bug list open bugs) ...
Debugging out-of-memory problems
out-of-memory exceptions from js setting memory.dump_reports_on_oom in about:config to true will cause the browser to automatically write about:memory dumps to a temp file printed to the browser console (note: not web console) when an oom crash is encountered.
... ideally, memory.dump_reports_on_oom would generate an about:memory dump, but it does not currently.
...note: replace "/storage/emulated/0/download/" in the reported file path with the device's download path (e.g.
Localization Use Cases
the javascript code hasn't changed yet, but there's another improvement that can be introduced, which is described below.
... asymmetry the example above could benefit from another of l20n's features: local variables.
... you'll notice that devicestoragehelper.showformatedsize passes a localized name of the unit to availablesize: function showformatedsize(element, l10nid, size) { // … var _ = navigator.mozl10n.get; element.textcontent = _(l10nid, { size: sizeinfo.size, unit: _('byteunit-' + sizeinfo.unit) }); } problem definition even though there's no need to localize the units in english at all, we still need to do it, because in other languages we might need to use localized names.
Leak And Bloat Tests
results printed on tinderbox output, these consist of: mail rlk reference count leaks mail lk total bytes malloc'ed and not free'd mail mh maximum heap size mail a allocations - number of calls to malloc and friends.
...s bloat/bloatcomposeoverlay.js bloat/bloatmainoverlay.js preference settings (used to provide a defined profile, see below): common/mailnewstestprefs.js python scripts (used to set up the profile and run the test): bloat/setupbloattest.py bloat/runtest.py common/setupcommonmailnews.py pre-defined profile initial setup: one pop3 account (mails tbd) one identity one smtp server defined (not used) future requirements/possibilities: one address book where pab has ~1000 entries large message folders imap nntp server and subscribed newsgroup.
...e", "tinderbox"); user_pref("mail.smtpservers", "smtp1"); user_pref("mail.startup.enabledmailcheckonce", true); user_pref("mailnews.start_page_override.mstone", "1.9pre"); user_pref("mail.shell.checkdefaultclient", false); // ensure os x and outlook/oe books are disabled user_pref("ldap_2.servers.osx.position", 0); user_pref("ldap_2.servers.oe.position", 0); preferences in generated profile, but not set: user_pref("mail.root.none", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail"); user_pref("mail.root.pop3", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail"); user_pref("mail.server.server1.directory", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail/local folders"); user_pref("mail.server.server2.directory", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail/tinderbox"); user_pref("mail.
Dynamic Library Linking
y linking types these data types are defined for dynamic library linking: prlibrary prstaticlinktable library linking functions the library linking functions are: pr_setlibrarypath pr_getlibrarypath pr_getlibraryname pr_freelibraryname pr_loadlibrary pr_unloadlibrary pr_findsymbol pr_findsymbolandlibrary finding symbols defined in the main executable program pr_loadlibrary cannot open a handle that references the main executable program.
... platform notes to use the dynamic library loading functions on some platforms, certain environment variables must be set at run time, and you may need to link your executable programs using special linker options.
... exporting symbols from the main executable program on some systems, symbols defined in the main executable program are not exported by default.
I/O Functions
you cannot read from or write to a pollable event.
...do not use pollable events for general thread synchronization; use condition variables instead.
...events are not queued, so there is no notion of an event count.
PLHashAllocOps
a pair of functions is used to allocate and tree the table, and another pair of functions is used to allocate and free the table entries.
... the freeentry function does not need to free the value of the entry.
... remark the key argument for the allocentry function does not seem to be useful.
PRThreadState
the time of release of the resources assigned to the thread cannot be determined in advance.
... threads created with a pr_unjoinable_thread state cannot be used as arguments to pr_jointhread.
... if a thread is created as a joinable thread, it continues to exist after returning from its root function until another thread joins it.
PRTimeParameters
if dst is not in effect, the tp_dst_offset component is 0.
...tp_dst_offset is 0, indicating that daylight saving time is not in effect.
...japan does not use daylight saving time, so the only time zone is japan standard time (jst).
PR_AcceptRead
this parameter is valid only if the function return does not indicate failure.
...this parameter is valid only if the function return does not indicate failure.
...does not include the size of the prnetaddr structures.
PR_Bind
if you do not care about the exact ip address assigned to the socket, set the inet.ip field of prnetaddr to pr_htonl(pr_inaddr_any).
... if you do not care about the tcp/udp port assigned to the socket, set the inet.port field of prnetaddr to 0.
... note that if pr_connect is invoked on a socket that is not bound, it implicitly binds an arbitrary address the socket.
PR_CEnterMonitor
if a match is found, then either the calling thread is already in the monitor (and this is a reentrant call) or another thread is holding the monitor's mutex.
...in the latter case, the calling thread is likely to find the monitor locked by another thread and waits for that thread to exit before continuing.
... note: pr_centermonitor and pr_cexitmonitor must be paired--that is, there must be an exit for every entry--or the object will never become available for any other thread.
PR EnumerateAddrInfo
this parameter is not checked for validity.
...on output, this structure is filled in by the runtime if the result of the call is not null.
...the principle input, the praddrinfo structure, is not modified.
PR_LOG
possible values are: pr_log_none = 0 pr_log_always = 1 pr_log_error = 2 pr_log_warning = 3 pr_log_debug = 4 pr_log_notice = pr_log_debug pr_log_warn = pr_log_warning pr_log_min = pr_log_debug pr_log_max = pr_log_debug _args a variable length argument list, as if to printf.
... returns nothing description this macro formats the specified arguments and writes the output to the log file, if logging is enabled for the specified module and level.
... this macro compiles to nothing if compile-time options are not specified to enable logging.
PR_OpenSharedMemory
syntax #include <prshm.h> nspr_api( prsharedmemory * ) pr_opensharedmemory( const char *name, prsize size, printn flags, printn mode ); /* define values for pr_opensharememory(...,create) */ #define pr_shm_create 0x1 /* create if not exist */ #define pr_shm_excl 0x2 /* fail if already exists */ parameters the function has the following parameters: name the name of the shared memory segment.
...if the segment does not exist, it is created and a pointer to the related prsharedmemory structure is returned.
...if the shared memory does not exist, null is returned with the error set to pr_file_not_found_error.
PR_SetConcurrency
the m x n model is not available on all host systems.
... on those where it is not available, pr_setconcurrency is ignored.
...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_SetThreadPrivate
description if the thread already has non-null private data associated with it, and if the destructor function for the index is known (not null), nspr calls the destructor function associated with the index before setting the new data value.
...if the swapped out value is not null, the destructor function is called.
...a client must not delete the referant object of a non-null private data without first eliminating it from the table.
PR_Writev
the value of this parameter must not be greater than pr_max_iovector_size.
...note that if pr_writev returns -1, part of the data may have been written before an error occurred.
... if the timeout parameter is not pr_interval_no_timeout and all the data cannot be written in the specified interval, pr_writev returns -1 with the error code pr_io_timeout_error.
PR_dtoa
*rve if not null this location is set to the address of the end of the result.
...if rve is not null, *rve is set to point to the end of the returned value.
... 6-9 same as modes 2 and 3, but do not try fast floating-point estimate (if applicable).
PR_strtod
se a pointer that, if not null, will be assigned the address of the last character scanned in the input string.
...if the parameter se is not null the location it references is also set.
...if the value of se is not (char **) null, pr_strtod stores a pointer to the character terminating the scan in *se.
Process Management and Interprocess Communication
nspr provides routines to create a new process and to wait for the termination of another process.
... nspr does not provide an equivalent of the unix fork().
... note that the functions described in this chapter are not available for macos or win16 operating systems.
Running NSPR tests
timetest passed tpd passed udpsrv passed vercheck passed version passed writev passed xnotify passed zerolen passed end mon mar 12 11:55:47 pdt 2007 how to determine if the test suite passed if all the tests reported passed as the results, the test suite passed.
... some tests, such as pipepong and sockpong, should not be run directly.
...this is not an issue if you run runtests.sh because runtests.sh knows not to run such test programs directly.
Certificate functions
d later cert_decodegeneralname mxr 3.4 and later cert_decodenameconstraintsextension mxr 3.10 and later cert_decodeocspresponse mxr 3.6 and later cert_decodeoidsequence mxr 3.2 and later cert_decodeprivkeyusageperiodextension mxr 3.10 and later cert_decodetruststring mxr 3.4 and later cert_decodeusernotice mxr 3.2 and later cert_dernametoascii mxr 3.4 and later cert_destroycertarray mxr 3.2 and later cert_destroycertificate mxr 3.2 and later cert_destroycertificatelist mxr 3.2 and later cert_destroycertificatepoliciesextension mxr 3.2 and later cert_destroycertificaterequest mxr 3.2 and later ...
... cert_destroycertlist mxr 3.2 and later cert_destroyname mxr 3.2 and later cert_destroyocspcertid mxr 3.6 and later cert_destroyocsprequest mxr 3.6 and later cert_destroyocspresponse mxr 3.7 and later cert_destroyoidsequence mxr 3.9 and later cert_destroyusernotice mxr 3.10 and later cert_destroyvalidity mxr 3.5 and later cert_dupcertificate mxr 3.2 and later cert_dupcertlist mxr 3.2 and later cert_enableocspchecking mxr 3.2 and later cert_encodealtnameextension mxr 3.7 and later cert_encodeandaddbitstrextension mxr 3.5 and later cert_encodeauthkeyid mxr 3.5 and later cert_encodebasicco...
...nstraintvalue mxr 3.5 and later cert_encodecertpoliciesextension mxr 3.12 and later cert_encodecrldistributionpoints mxr 3.5 and later cert_encodegeneralname mxr 3.4 and later cert_encodeinfoaccessextension mxr 3.12 and later cert_encodeinhibitanyextension mxr 3.12 and later cert_encodenoticereference mxr 3.12 and later cert_encodeocsprequest mxr 3.6 and later cert_encodepolicyconstraintsextension mxr 3.12 and later cert_encodepolicymappingextension mxr 3.12 and later cert_encodesubjectkeyid mxr 3.12 and later cert_encodeusernotice mxr 3.12 and later cert_extractpublickey mxr 3.2 and later cert_findce...
NSS Sample Code Sample_1_Hashing
this is an example program that demonstrates how to compute the hash of a file and save it to another file.
... * returns null if the name is not a supported algorithm */ static secoidtag hashnametooidtag(const char *hashname) { int i, nhashes = sizeof(hash_names); secoidtag hashtag = sec_oid_unknown; for (i = 0; i < nhashes; i++) { if (port_strcasecmp(hashname, hash_names[i].hashname) == 0) { hashtag = hash_names[i].oid; break; } } return hashtag; } /* * newline */ static vo...
... */ printashex(outfile, digest, len); } while (0); /* cleanup */ if (hashcontext != null) hash_destroy(hashcontext); return secsuccess; } /* * this sample computes the hash of a file and saves it * to another file.
sample1
a program to compute the hash of a file and save it to another file.
... * returns null if the name is not a supported algorithm */ static secoidtag hashnametooidtag(const char *hashname) { int i, nhashes = sizeof(hash_names); secoidtag hashtag = sec_oid_unknown; for (i = 0; i < nhashes; i++) { if (port_strcasecmp(hashname, hash_names[i].hashname) == 0) { hashtag = hash_names[i].oid; break; } } return hashtag; } /* newline...
... */ printashex(outfile, digest, len); } while (0); /* cleanup */ if (hashcontext != null) hash_destroy(hashcontext); return secsuccess; } /* * this sample computes the hash of a file and saves it to another file.
FC_CancelFunction
description parallel functions are not implemented.
... fc_cancelfunction is a legacy function that simply returns ckr_function_not_parallel.
... return value fc_cancelfunction always returns ckr_function_not_parallel.
FC_InitToken
syntax ck_rv fc_inittoken( ck_slot_id slotid, ck_char_ptr ppin, ck_ulong ulpinlen, ck_char_ptr plabel ); parameters fc_inittoken() has the following parameters: slotid the id of the token's slot ppin the password of the security officer (so) ulpinlen the length in bytes of the so password plabel points to the label of the token, which must be padded with spaces to 32 bytes and not be null-terminated description fc_inittoken() initializes a brand new token or re-initializes a token that was initialized before.
... note: the so password should be the empty string, i.e., ulpinlen argument should be 0.
... note: resetting the password clears all permanent secret and private keys.
NSC_InitToken
syntax ck_rv nsc_inittoken( ck_slot_id slotid, ck_char_ptr ppin, ck_ulong ulpinlen, ck_char_ptr plabel ); parameters nsc_inittoken() has the following parameters: slotid the id of the token's slot ppin the password of the security officer (so) ulpinlen the length in bytes of the so password plabel points to the label of the token, which must be padded with spaces to 32 bytes and not be null-terminated description nsc_inittoken() initializes a brand new token or re-initializes a token that was initialized before.
...(user certs are the certificates that have their associated private keys in the key database.) note: the so password should be the empty string, i.e., ulpinlen argument should be 0.
... note: resetting the password clears all permanent secret and private keys.
NSS Tools certutil-tasks
(bugfix) certificate entries require a serial number; one should be generated automatically if not provided.
... (bugfix) listing provate keys does not work: requires password authentication.
... (bugfix) listing certificate extensions has typos and does not provide much information.
Rhino documentation
requirements and limitations what you must have to run rhino; what rhino cannot do.
... downloads archive includes release notes for rhino releases optimization details on the various optimization levels.
... try this at jarvana.) an annotated outline of the programming interface to rhino (tip only).
Small Footprint
class generation library if you do not include optimizer or javaadapter, nor do you use policysecuritycontroller then you do not need rhino library for class file generation and you can remove all the classes from in org.mozilla.classfile package.
...rhino will continue to run, although it will not be able to execute any regular expression matches.
... 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.
Performance Hints
not only is it good programming practice, it can speed up your code by allowing the compiler to generate special code to access the variables.
... for example, you could rewrite function sum(a) { result = 0; for (i=0; i < a.length; i++) result += a[i]; return result; } as function sum(a) { var result = 0; for (var i=0; i < a.length; i++) result += a[i]; return result; } this is not equivalent code because the second version does not modify global variables result and i.
... however, if you don't intend for any other function to access these variables, then storing them globally is probably wrong anyway (what if you called another function that had a loop like the one in sum!).
Future directions
for the near future, we do not intend to provide a stable api, because too many things are changing.
...for these features: do not add vendor prefixes.
... nspr the plan is to make spidermonkey not depend on nspr.
Statistics API
the browser preference javascript.options.mem.notify controls emission of json encoded gc stats to an observer interface.
... var prefs = require("api-utils/preferences-service"); components.utils.import('resource://gre/modules/services.jsm'); function observer(subject, topic, json) { var data = json.parse(json); // process the data } prefs.set("javascript.options.mem.notify", true); services.obs.addobserver(observer, "garbage-collection-statistics", false); the toplevel json object contains these fields: timestamp: integer (microseconds) - time at which the gc ended, measured from epoch.
... note: this is the sum of all the slice durations, not end time - start time.
JS::PropertySpecNameIsSymbol
this article covers features introduced in spidermonkey 38 determine if the given jspropertyspec::name or jsfunctionspec::name value is actually a symbol code and not a string.
... syntax bool js::propertyspecnameissymbol(const char *name); name type description name const char * the pointer of the name, actually the uintptr_t type, and not a pointer to any string.
... description js::propertyspecnameissymbol determines if the given jspropertyspec::name or jsfunctionspec::name value is actually a symbol code and not a string, and returns true if so.
JSAutoByteString
this may fail if str is not linear.
... if jsautobytestring instance is initialized with jsautobytestring bytes; style, it does not own any string.
... note that the js_encodestring call in constructor and some encode* methods may fail and get null.
JSExtendedClass.wrappedObject
most classes do not implement wrappedobject.
...if it returns null or obj, then the js engine treats the object as though it were not a wrapper.
... wrapper objects typically have no prototype, do not allow setting __proto__, and inherit properties from the wrapped object rather than the prototype chain (see jsnewresolveop).
JSFunction
for other function objects - that is, functions created by running javascript code containing function declarations or function-expressions-the relationship between the jsfunction * and the jsobject * is not well-defined.
...as a result, some apis (such as js_callfunction) that operate on jsfunctions do not work properly with closures.
...if the application can't be sure that a given function jsobject is either native or jsapi-compiled, it must not use the affected apis.
JSGetObjectOps
thus jsclass (which pre-dates jsobjectops in the api) provides a low-level interface to class-specific code and data, while jsobjectops allows for a higher level of operation, which does not use the object's class except to find the class's jsobjectops struct, by calling clasp->getobjectops, and to finalize the object.
...most host objects do not need to implement the larger jsobjectops, and can share the common jsscope code and data used by the native (js_objectops, see jsobj.c) ops.
... further extension to preserve api compatibility: if this function returns a pointer to jsxmlobjectops.base, not to jsobjectops, then the engine calls extended hooks needed for e4x.
JSID_VOID
syntax const jsid jsid_void; const js::handleid jsid_voidhandle; // added in spidermonkey 31 description jsid_void does not occur in js scripts but may be used to indicate the absence of a valid jsid.
... a void jsid is not a valid id and only arises as an exceptional api return value, such as in js_nextproperty.
... embeddings must not pass jsid_void into jsapi entry points expecting a jsid and do not need to handle jsid_void in hooks receiving a jsid except when explicitly noted in the api contract.
JSObject
an object inherits properties, including methods, from its prototype (which is another object).
...an object's parent is another object, usually either the global object or an object that represents an activation record.
...the term own property refers to a property of an object that is not inherited from its prototype.
JSObjectOps.newObjectMap
jsobjectops is not a supported api.
...this documentation should be considered spidermonkey internals documentation, not api documentation.
... description note: the jsapi does not expose the data structure that would be necessary to develop new jsobjectmap subclasses.
JSObjectPrincipalsFinder
another example: when the function constructor is called, the javascript engine calls the object principals finder callback to obtain principals for the local scope object, to check that the caller has access to that object.
...therefore null does not mean an error was reported; in no event should an error be reported or an exception be thrown by this callback's implementation.
... the callback should not call jsprincipals_hold.
JSPRINCIPALS_HOLD
this argument must not be null.
...jsprincipals objects are not jsobjects.
... they are reference counted, not garbage collected.
JSReserveSlotsOp
description warning: jsapi applications should not use this hook.
... a class cannot freely use a reserveslots hook to reserve a different number of slots for each object.
...implementations of this hook should return the number of slots to reserve, not including any reserved by using jsclass_has_reserved_slots(n) in jsclass.flags.
JS_AddExternalStringFinalizer
callback syntax typedef void (*jsstringfinalizeop)(jscontext *cx, jsstring *str); name type description cx jscontext * pointer to a jscontext which the finalizer may use for certain very limited operations (not documented).
...after this callback, the js engine will not use that memory anymore and will not keep a pointer to it.
... the callback may not keep a reference to this jsstring, as its memory is about to be freed.
JS_BeginRequest
indicates to the js engine that the calling thread is entering a region of code that may call into the jsapi but does not block.
...it is therefore imperative that native code executing within an active request on cx not block, or simply take too long, outside the jsapi.
...in spidermonkey 1.8 and later, these functions are present, but do nothing, in non-js_threadsafe builds.
JS_DecompileFunctionBody
indent unsigned if it's not js_dont_pretty_print, js_decompilefunction returns pretty printed source code of the function.
...the source code generated by this function is accurate but unadorned and is not suitable for recompilation without providing the function's declaration.
...notes to decompile a complete function, including its body and declaration, call js_decompilefunction instead.
JS_DefineProperty
it differs from js_setproperty in that: it does not behave like ordinary property assignment in the javascript language; it allows the application to specify additional details (getter, setter, and attrs) governing the new property's behavior; it never calls a setter; it can call the jsclass.addproperty callback when js_setproperty would not, because it can replace an existing property.
...also note that certain jsapi functions, including js_lookupproperty, js_hasproperty, and property_attributes, can detect or examine a property without calling its getter.) if getter (or setter) is null, the new property will use the jsclass.getproperty (or jsclass.setproperty) callback from obj's class.
... if attrs contains the jsprop_getter (or jsprop_setter) flag, then getter (or setter) must point to a javascript function, not a c/c++ function.
JS_DefinePropertyWithTinyId
tiny ids only affect the ids passed to these hooks; the javascript engine does not use them as property names internally.
...per-property getters and setters do not suffer from this confusion: in the above example, obj.color would cause the javascript engine to call the getter for the color property, but obj[10] wouldn't.
...if the property already exists or cannot be created, they return js_false.
JS_ExecuteScriptVersion
obj must not be an array, an e4x xml object, a with object, or a proxy.
... in ecmascript terms, the script is executed in a new execution context, but that context is not initialized quite as described in any of the three cases in ecma 262-3 §10.2.
... to execute a script that has not been compiled, use js::evaluate instead.
JS_GetFunctionId
this can still return nullptr if a useful display name could not be inferred.
... examples the name returned by js_getfunctiondisplayid is the same as returned by js_getfunctionid if the function explicitly has a name listed in the source, or if not it is an intelligently guessed name for the function based on its context in the source.
...the returned string is guaranteed to live as long as fun, so the application often does not need to root the string.
JS_GetInstancePrivate
note that if obj is an instance of clasp, but there is no private data currently associated with the object, or the object cannot have private data, js_getinstanceprivate also returns null.
... if you pass a non-null argument vector, argv, to js_getinstanceprivate, and obj is not an instance of clasp, this function reports a class mismatch error before returning null.
... in this case, js_getinstanceprivate tests whether or not there is a function name associated with the argument vector, and if there is, reports the name in an error message using the js_reporterror function.
JS_GetParent
description js_getparent retrieves the parent object of obj, or null if obj does not have a parent.
...such an object should not be passed to any other jsapi function that could expose it to script code.
... the initial parent of an object created via the jsapi depends on the particular jsapi function (of which there are many that create objects, including but not limited to js_newobject, js_constructobject, js_defineobject, js_valuetoobject, js_newarrayobject, js_newscriptobject, js_newfunction, js_compilefunction, js_definefunction, js_definefunctions, and js_initclass).
JS_GetPropertyAttrsGetterAndSetter
flag indicating whether or not the specified property was located.
... the js_getter (or js_setter) attribute indicates that the property's getter (or setter) is a javascript function, not a c/c++ function.
... when this attribute is present, the value stored in getterp (or setterp) does not really point to a c/c++ function; it is a jsobject *, pointing to a javascript function, cast to type jspropertyop.
JS_GetReservedSlot
these fields are not directly exposed to scripts.
...(note that private values must not be exposed directly to javascript.
...they cannot be returned from functions, set as properties on objects, embedded in javascript arrays, and so on.) new objects' reserved slots are initialized to undefined.
JS_GetStringBytes
note: js_getstringbytes() and js_getstringbytesz() have both been removed as of javascript 1.8.5 (firefox 4).
...the application must not modify the contents of the array.
... note that for non-ascii strings, if js_cstringsareutf8 is false, these functions can return a corrupted copy of the contents of the string.
JS_GetStringChars
warnings: the array is not necessarily null-terminated.
... the program must not modify the array.
... the content of a js string is not guaranteed to be valid utf-16.
JS_InstanceOf
if non-null, report an error if obj is not of type clasp.
...if non-null, report an error if obj is not of type clasp.
... note that js_instanceof is not the equivalent of the javascript instanceof keyword, which examines constructor properties along the prototype chain.
JS_LookupElement
on success, *vp receives the stored value of obj[index], or undefined if the element does not exist.
... note: in the javascript language, numeric properties (also called "elements") are just ordinary properties whose names are numeric strings.
... js_lookupelement does not distinguish between a property with a value of undefined and a property that does not exist.
JS_NewDouble
this function is not very useful.
... warning: the argument d must not be a value that could fit in an integer jsval.
... if it is, js_newdouble creates a bad jsdouble that might behave as desired in some cases but not others.
JS_NewDoubleValue
this must not be a value that could fit in an integer jsval (see int_fits_in_jsval).
... warning: the argument d must not be a value that could fit in an integer jsval.
... if it is, js_newdoublevalue creates a bad jsval that might behave as desired in some cases but not others.
JS_NewGlobalObject
the constructor clasp-&gt;construct is not called.
... debugger api hook during global creation, we fire notifications to callbacks registered via the debugger api.
...when that happens, the global should not be in a half-baked state.
JS_NewObjectForConstructor
this function does not run the code of the constructor function--it just creates the object.
... if the constructor argument is not an object jsval, this function will assert (in debug builds).
... if the constructor does not have a prototype property, this function will return null and set an exception on cx.
JS_PreventExtensions
before then, js_preventextensions did not accept a succeeded argument; in those cases where *succeeded would be set to false, js_preventextensions would throw a typeerror and return false.
... the first case occurs when something went wrong internally, not necessarily because the object chose not to become non-extensible.
... var target = {}; var handler = { preventextensions: function(obj) { return false; } }; var obj = new proxy(target, handler); // bool succeeded; // bool rv = js_preventextensions(cx, obj, &succeeded); // // rv == true, succeeded == false note that as with most jsapi methods, *succeeded is only set if js_preventextensions returns true (that is, does not fail).
JS_SetErrorReporter
the error reporter callback must not reenter the jsapi.
... like all other spidermonkey callbacks, the error reporter callback must not throw a c++ exception.
... note that js_seterrorreporter has no facility to directly pass a user data pointer to the error reporting function.
JS_SetNativeStackQuota
added in spidermonkey 31 description js_setnativestackquota sets the size of the native stack that should not be exceeded.
... spidermonkey allows for a distinction between system code (such as gcs, which may incidentally be triggered by script but are not strictly performed on behalf of such script), trusted script (as determined by js_settrustedprincipals), and untrusted script.
... the stack quotas for each kind of code should be monotonically descending, and may be specified with this function.
JS_SetPrivate
it is especially useful for storing c/c++ data that should not be directly visible to scripts.
... if your class's private data contains any jsvals or other references to javascript objects, implement the jsclass.mark callback to ensure they are not prematurely reclaimed by the garbage collector.
...that object may already be using the private data field for something else; or there might not be a private data field in that object at all, in which case js_setprivate would overwrite an object property.
JS_TracerInit
this article covers features introduced in spidermonkey 1.8 note: in jsapi 12, the macro js_tracer_init has been replaced by the function js_tracerinit initialize a jstracer for object graph tracing.
... callback jstracecallback a callback, described below, which the tracing apis will call each time a pointer is found from one gc thing to another.
... kind uint32 one of the constants jstrace_object, jstrace_double, jstrace_string; or a tag denoting an internal implementation-specific traversal kind.
JS_ValueToObject
in any case, the result is not guaranteed to be the same object as v.
... (implementation note: the object's jsobjectops.defaultvalue method is called with hint=jstype_object.) the resulting object is subject to garbage collection unless the variable *objp is protected by a local root scope, an object property, or the js_addroot function.
... note that a local root scope is not sufficient to protect the resulting object in some cases involving the valueof method!
Stored value
properties with the jsprop_shared attribute do not have a stored value.
...properties of objects that have custom jsobjectops do not have a stored value.
...as long as an object is reachable, the stored values of its properties are reachable and will not be collected.
SpiderMonkey releases
this page lists spidermonkey release notes.
... note: standalone spidermonkey is not an official product.
... our continuous integration system does produce a tarball 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.
Running Automated JavaScript Tests
basic usage is: jstests.py path_to_js_shell or using mach: ./mach jstests note that mach will generally find the js shell itself; the --shell argument can be used to specify the location manually.
... another common use case is to run just one test, or all the tests in just one directory: jstests.py path_to_js_shell test_path_substring [ test_path_substring_2 ...
...for a smoke test or if you are not changing language-level functionality, you may wish to use jstests.py path_to_js_shell --exclude=test262 other options allow you to show the test command lines being run, command output and return codes, run tests named in a given file, exclude tests named in a given file, hide the progress bar, change the timeout, run skipped tests, print output in tinderbox format, run a test in the debugger,...
SavedFrame
if the asynchronous call was started in a descendant frame to which the requester of the property does not have access, this will be the generic string "async".
... if this is not an asynchronous call point, this will be null.
...if the frame responsible for the call is not accessible to the caller, this points to the youngest accessible ancestor of the real frame, if any.
compare-locales
compare-locales is a python script that helps localizers to check their work without running firefox or another application.
...the file names will be shown in a hierarchical form, so in the example above, your files are browser.dtd in ab-cd/browser/chrome/browser and migration.dtd in another directory level deeper.
... the output closes with a summary, giving the total counts of missing and obsolete strings and words, and some statistics on how many strings are changed or not, excluding access- and commandkeys.
Mozinfo
because information is not consolidated, checks are not done consistently, nor is it defined what we are checking for.
...mozinfo also exports: choices: a dictionary of possible values for os, bits, and processor main: the console_script entry point for mozinfo unknown: a singleton denoting a value that cannot be determined unknown has the string representation "unknown".
... unknown will evaluate as false in python: if not mozinfo.os: ...
Security and the jar protocol
note: support for the jar: protocol was disabled by default for use from web content beginning in firefox 45, but re-enabled again because it broke the experience of ibm inotes users.
... inotes has since been updated so that it no longer needs remote jars, so they have been disabled again in firefox 55.
...however, if a site allows file uploads, zip files are typically treated as relatively innocuous by web sites in that situation, since they're not executable.
Signing Mozilla apps for Mac OS X
the main options of note are: -s your-signing-identity lets you specify the signing certificate you want to sign the application with your-signing-identity is the name of your certificate.
...note that you cannot specify an identifier requirement if you do this, or otherwise you need to sign the outer application again with the identifier requirement.
...the folder will fail to validate if any of these cases occur (there may be other cases not listed here): if any files that were included in the signature have been removed or modified if any files have been added to a folder that should have all files signed the coderesources file this file is located in your application's bundle at contents/_codesignature/coderesources.
places.sqlite Database Troubleshooting
sqlite> .clone places.sqlite sqlite> pragma user_version; note the version number returned by the last pragma query.
... sqlite> .exit open a new shell for the new database: my_work_folder> sqlite3 places.sqlite sqlite> pragma integrity_check; if the result is not ok, the file cannot be recovered; stop here and please file a bug.
... nn must be replaced with the number we had noted previously: sqlite> pragma user_version = nn; let's update the page_size value: sqlite> pragma journal_mode = truncate; sqlite> pragma page_size = 32768; sqlite> vacuum; sqlite> pragma journal_mode = wal; sqlite> .exit copy the new places.sqlite to the profile folder, overwriting the existing one.
Aggregating the In-Memory Datasource
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.
... notes describing all of the vagaries of xpcom aggregation is beyond the scope of this document.
...it's risky because another implementation of the same object mightnot support those interfaces.
Generating GUIDs
warning: if you just want an id for your add-on, generating a guid is almost definitely not what you want to do.
...remember, these are identifiers, not e-mail addresses, and they're never resolved.
... note: if you do choose to use an email-style id for your add-on, you probably don't want it to be a real email address, since it might attract spam.
Preface
however, this book does not assume any prior knowledge of com - all of the basic com ideas will be introduced.
... despite what old documentation says, xpcom should not be used to make npapi plugins scriptable.
...in order to build it, your gecko sdk or mozilla source tree needs to be version 1.2 or later (xpcom interfaces were not fully frozen in prior releases).
Components.utils.Sandbox
wantcomponents a boolean indicating whether the components object is available or not in the sandbox.
...note that "-promise" is removed in firefox 37.
...however, sandboxes are often used when chrome wants to run script as another origin, possibly to interact with the page.
Components.utils.forceGC
another instance where it can be useful to force garbage collection is before cleaning out dead reference from a hash of weak javascript references.
... users should note that garbage collection is a very expensive operation and should only be forced when it is known to be absolutely necessary.
... note: nsidomwindowutils.garbagecollect() offers similar functionality but will trigger the cycle collector in addition to the garbage collector in the javascript engine.
Components.utils.getWeakReference
it might simply not have been garbage collected yet.
... note: in gecko 11.0, this method was changed to throw an exception if obj is null.
... var arr = []; arr.push(cu.getweakreference(window)); //now lets say this code runs in another block: for (var i=0; i<arr.length; i++) { if (arr[i].get() == window) { //found the window break; } } ...
Components.utils.import
note: prior to gecko 2.0, javascript code modules could only be loaded using file: or resource: urls.
... under boot2gecko, the scope is not optional.
... use of the return value is discouraged since it grants access to the module's internal properties which are not part of its public api.
Components.utils.unload
if the javascript code module has not yet been imported then this method will do nothing.
... you should not unload modules that are part of the application (anything under resource://gre/ or resource:/// or resource://app/) as these may be in use by other extensions and the application.
... example you can unload a module called mymodule.jsm using the following line of code: components.utils.unload("resource://myaddon/modules/mymodule.jsm"); note: currently components.utils.unload clears the global object of an unloaded module.
Components.utils.unwaiveXrays
for example, if privileged code accesses a dom object belonging to web content, it will by default see it using xray vision, meaning that among other things expando properties added to the object by content are not visible.
...the waivexrays operation is transitive: it waives xrays not just for the given object, but for all properties of the object (and their properties, and so on).
...the chrome code can then use unwaivexrays to restore xray protection: // chrome code // contentwindow is an xray var isxray = components.utils.isxraywrapper(gbrowser.contentwindow); // true // expandos are not visible in xrays var foo = gbrowser.contentwindow.foo; // undefined // you can waive xray vision for an object var waived = components.utils.waivexrays(gbrowser.contentwindow); isxray = components.utils.isxraywrapper(waived); // false foo = waived.foo; // "i'm an expando" // waiving is trans...
NS_NewNativeLocalFile
this path does not need to reference an existing file.
...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.
IAccessibleEditableText
other-licenses/ia2/accessibleeditabletext.idlnot scriptable this interface provides clipboard capability to text objects.
...note that even a read only text object can support the copy capability so this interface is not limited to editable objects.
...if the index is not valid the system clipboard text is not inserted.
IAccessibleHypertext
other-licenses/ia2/accessiblehypertext.idlnot scriptable this interface exposes information about hypertext in a document.
...hyperlinkindex the 0 based index of the hyperlink that is associated with this character index, or -1 if charindex is not on a link.
...s_false if there is nothing to return, [out] value is -1.
IAccessibleImage
other-licenses/ia2/accessibleimage.idlnot scriptable this interface represents images and icons.
...some examples are: the accessible name and description() are not enough to fully describe the image, for example when the accessible description() is used to define the behavior of an actionable image and the image itself conveys semantically significant information.
... return value s_false if there is nothing to return, [out] value is null.
IAccessibleTableCell
other-licenses/ia2/accessibletablecell.idlnot scriptable this interface gives access to the cells of a two-dimensional table.
...rowcolumnextents() gets the row and column indexes and extents of this cell accessible and whether or not it is selected.
...it is not mandatory to implement it.
imgICache
any images from windows in private browsing mode will not be present in the cache returned from a call with a null parameter).
... return value null if the url was not found in the cache.
... ns_error_not_available if a uri was unable to be removed from the cache.
imgIDecoder
this object also implements the imgidecoderobserver interface; you should queryinterface() it to that interface and call its notification methods while handling the decode operation.
... you should always pass null as the first two parameters of the notification apis.
... implementer's note: this method is defined by this interface in order to let the output stream efficiently copy the data from the input stream into its internal buffer (if any).
mozIPlacesAutoComplete
match_boundary_anywhere 1 match first on word boundaries, and if we do not get enough results, then match anywhere in each searchable term.
...note: pages will not be automatically unregistered when private browsing mode is entered or exited.
...note: pages will not be automatically unregistered when private browsing mode is entered or exited.
mozIStorageAggregateFunction
note this callback is executed on the thread that the statement or trigger is executing on.
... onfinal() this is called after all results have been obtained and notified via mozistorageaggregatefunction.
... note this callback is executed on the thread that the statement or trigger is executing on.
nsIAbCard
astring webpage1 astring used for the contact's work web page webpage2 astring used for the contact's home web page birthyear astring birthmonth astring birthday astring custom1 astring custom2 astring custom3 astring custom4 astring notes astring lastmodifieddate unsigned long popularityindex unsigned long popularityindex is bumped every time e-mail is sent to this recipient .
... copy() this function will copy all values from one card to another.
...if this bundle is not supplied, then the function will obtain the bundle itself.
nsIAccessible
relations many accessibles are linked with each other, for example, if one accessible gives the accessible name for another accessible (for example, html:label and html control) then these accessibles are related, please refer to relations documentation for more information.
...attributes many accessibles exposes attributes to provide more details that cannot be fit into existing api methods, please refer to attributes documentation for more information.
... indexinparent the 0-based index of this accessible in its parent's list of children, or -1 if this accessible does not have a parent.
nsIAccessibleDocument
note: renamed from document in gecko 2.0 iseditable boolean true if the document is live in an editor.
... false if the document is being displayed but not edited.
...guaranteed not to return null if the dom node is in a document.
nsIAccessibleEvent
event_hypertext_changed 0x0057 0x0053 focus has changed from one hypertext object to another, or focus moved from a non-hypertext object to a hypertext object, or focus moved from a hypertext object to a non-hypertext object.
... gecko 1.9.2 note this event is never sent in versions of gecko prior to 1.9.2, even though the constant existed.
... event_last_entry 0x005d 0x0057 help make sure event map does not get out-of-line.
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.
...this attribute will not be transferred through a redirect.
... inheritapplicationcache boolean true if the channel will ask its notification callbacks for an application cache if one is not explicitly provided.
nsIAuthPromptCallback
they must not call any method on this interface before nsiauthprompt2.asyncpromptauth() returns.
...note: any exceptions thrown from this method should be ignored.
... onauthcancelled() notification that the prompt was cancelled.
nsIAutoCompleteSearch
method overview void startsearch(in astring searchstring, in astring searchparam, in nsiautocompleteresult previousresult, in nsiautocompleteobserver listener); void stopsearch(); methods startsearch() search for a given string and notify a listener (either synchronously or asynchronously) of the result.
...can be empty if not needed.
...listener an nsiautocompleteobserver listener to notify when the search is complete.
nsIController
iscommandenabled() implement this method to indicate whether or not the specified command is enabled.
... 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.
nsIConverterOutputStream
the output stream passed to this method must not be null, or you will crash.
...implementations not supporting buffering may ignore this parameter.
... exceptions thrown ns_error_loss_of_significant_data if areplacementcharacter is not encodable in the selected character encoding and an attempt is made to write the character.
nsICookie2
(where 0 does not represent a session cookie).
...note: that expiry time will also be honored for session cookies; thus, whichever is the more restrictive of the two will take effect.
...note: this time may be approximate.
nsICycleCollectorListener
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().
...method overview void begin(); void begindescriptions(); void describegcedobject(in unsigned long long aaddress, in boolean amarked); void describerefcountedobject(in unsigned long long aaddress, in unsigned long aknownedges, in unsigned long atotaledges); void end(); void noteedge(in unsigned long long afromaddress, in unsigned long long atoaddress, in string aedgename); void noteobject(in unsigned long long aaddress, in string aobjectdescription); methods begin() void begin(); parameters none.
...noteedge() void noteedge( in unsigned long long afromaddress, in unsigned long long atoaddress, in string aedgename ); parameters afromaddress atoaddress aedgename noteobject() void noteobject( in unsigned long long aaddress, in string aobjectdescription ); parameters aaddress aobjectdescription ...
nsIDOMFileException
note: gecko's implementation of this interface presently differs from the working draft of the file api specification.
... constants constant value description not_found_err 0 the specified file wasn't found.
... not_readable_err 1 the specified file wasn't readable.
nsIDOMGeoPositionAddress
this information may or may not be available, depending on the geolocation service being used.
...note: this needs to be moved into the dom reference.
... historical note, which is likely of no interest to most readers: the types of the attributes below all changed from string to domstring in gecko 1.9.2 beta 5.
nsIDOMHTMLSourceElement
it does not specify anything on its own.
...note that dynamically manipulating this value after the page has loaded has no effect on the containing element; instead, change the src attribute of that element (audio or video) instead.
... 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.
nsIDOMMouseScrollEvent
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.
... canbubblearg specifies whether or not the created event will bubble.
... cancelablearg specifies whether or not the created event can be canceled.
nsIDOMParser
note: if you're a web developer, please refer to the domparser documentation instead.
...to create a domparser when the constructor is not available (e.g., from a js xpcom component, a js module, or an xpcshell test), use: var parser = components.classes["@mozilla.org/xmlextras/domparser;1"] .createinstance(components.interfaces.nsidomparser); // optionally, call parser.init(principal, documenturi, baseuri); principals, document and base uri note: this section covers changes introduced to domparser in gecko 1.9.
... (this section is only relevant to firefox extensions--not to web content.) to create a document, the parser needs to specify a principal (see security check basics), a base uri (see document.baseuriobject), and a documenturi.
nsIDOMProgressEvent
method overview void initprogressevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in boolean lengthcomputablearg, in unsigned long long loadedarg, in unsigned long long totalarg); deprecated since gecko 22.0 attributes attribute type description lengthcomputable boolean specifies whether or not the total size of the transfer is known.
... canbubblearg specifies whether or not the created event will bubble.
... cancelablearg specifies whether or not the created event can be canceled.
nsIDOMSimpleGestureEvent
(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.
...(xxx not implemented on mac) default behavior: some operating systems support default behaviors for gesture events when they are not handled by the application.
... note: on mac os x, the units used for magnification gestures by the underlying operating system api are not documented at this time; typical values appear to be in the range 0.0 to 100.0, but currently you can only rely on the value being either positive or negative.
nsIDOMStorageItem
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) gecko 1.9.1 note starting in gecko 1.9.1 (firefox 3.5), this is only used for session storage; previously, it was also used for global storage.
...note: all items, regardless of whether they were stored for an http page or an https page, are visible from https pages.
... however, http pages can only see items stored from http pages, and will not see items stored from https pages.
nsIDOMXPathResult
the nodes may not necessarily be in the same order that they appear in the document.
...the nodes may not necessarily be in the same order that they appear in the document.
...the node is not necessarily the first node in the document that matches the expression used in the evaluator.
nsIDOMXULElement
gets or creates a box object for the element; browser, editor, iframe, listbox, menu, menupopup, scrollbox, tooltip and tree elements receive specialized box objects allowing access to additional properties not normally available from script.
...focus() attempts to set focus to the element; will not work for example for disabled elements.
...getelementsbyattribute() searches the dom subtree for elements with the given attribute that are not in a namespace.
nsIDispatchSupport
js/src/xpconnect/idl/nsidispatchsupport.idlnot scriptable please add a summary to this article.
...classexists returns containing pr_false if the class is not registered.
...boolean isclasssafetohost( in jscontextptr cx, in nscidref cid, in boolean capscheck, out boolean classexists ); parameters cx cid capscheck classexists returns containing pr_false if the class is not registered.
nsIDownloadHistory
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.
...this cannot be null.
...if the start time is not given, the current time is used.
nsIEditor
editorapi.outputtostring('text/html', 8); // xml: all in xml with _moz_dirty="" in new tags, html tags are in upper case // application/xhtml+xml format do the same editorapi.outputtostring('text/xml', 2); // the body is not recognized, everything is printed void outputtostream(in nsioutputstream astream, in astring formattype, in acstring charsetoverride, in unsigned long flags); listener methods void addeditorobserver(in nsieditorobserver observer);obsolete since gecko 18 void seteditorobserver(in editactionlistener observer); void removeeditorobserver(in nsieditoro...
...emoveeditactionlistener(in nsieditactionlistener listener); void adddocumentstatelistener(in nsidocumentstatelistener listener); void removedocumentstatelistener(in nsidocumentstatelistener listener); debug methods void dumpcontenttree(); void debugdumpcontent() ; void debugunittests(out long outnumtests, out long outnumtestsfailed); [notxpcom] boolean ismodifiablenode(in nsidomnode anode); constants load flags constant value description enone 0 enext 1 eprevious 2 enextword 3 epreviousword 4 etobeginningofline 5 etoendofline 6 attributes attribute type descr...
...returns true if we have a document that is not marked read-only.
nsIEventListenerInfo
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview nsisupports getdebugobject(); astring tosource(); attributes attribute type description allowsuntrusted boolean indicates whether or not the event listener allows untrusted events.
... capturing boolean indicates whether or not the event listener is in capture mode.
... insystemeventgroup boolean indicates whether or not the event listener is in the system event group.
nsIFeedProgressListener
programs using the feed content access api do not have to implement any of these callbacks; they are optional, but allow you to provide feedback during the parsing process.
...if the document is a standalone item or entry, the handlefeedatfirstentry() method will not already have been called, and the received nsifeedentry will have a null parent value.
... note: if the feed type is one of the entry or item-only types, this event will never be called.
nsIFileInputStream
note: using this flag results in the file not being opened during the call to init.
... this means that any errors that might happen when this flag is not set would happen during the first read.
... also, the file is not locked when init is called, so it might be deleted before we try to read from it.
nsIFileView
inherits from: nsisupports last changed in gecko 1.7 note: nsifileview is linux-only interface.
... 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.
nsIGlobalHistory2
note: docshell will not filter out uri schemes like chrome:, data:, about: and view-source:.
... aredirect whether the uri was redirected to another location; this is true for the original uri which is redirected.
...uris that are not already in global history will not be added.
nsIInterfaceRequestor
the main difference is that interfaces returned are not required to provide a way back to the object implementing nsiinterfacerequestor.
...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.
... exceptions thrown ns_error_no_interface the requested interface is not available.
nsIJumpListItem
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.).
... methods equals() compare this item to another.
... compares the type and other properties specific to this item's type: separator - type link - type, uri, title shortcut - type, handler application boolean equals( in nsijumplistitem item ); parameters item another nsijumplistitem to compare to.
nsIMIMEInputStream
not allowed to be changed once the stream has been started to be read.
...may not be called once the stream has been started to be read.
...may not be called once the stream has been started to be read.
nsIMessageBroadcaster
throws ns_error_not_initialized if the sender is not initialized.
... for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up.
... throws ns_error_failure when the message receiver cannot be found.
nsIMessageListenerManager
an alternative method to listen for death of frame script is to use a message-manager-disconnect observer; see observer notifications :: message manager.
... void removemessagelistener(in astring messagename, in nsimessagelistener listener); removemessagelistener() does not remove a message listener added via addweakmessagelistener(); use removeweakmessagelistener() for that.
... void removeweakmessagelistener(in astring messagename, in nsimessagelistener listener); removeweakmessagelistener() does not remove a message listener added via addmessagelistener(); use removemessagelistener() for that.
nsIMessageSender
throws ns_error_not_initialized if the sender is not initialized.
... for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up.
... throws ns_error_failure when the message receiver cannot be found.
nsIMessenger
file adestfolder); nsimsgmessageservice messageservicefromuri(in acstring auri); nsimsgdbhdr msghdrfromuri(in acstring auri); acstring getmsguriatnavigatepos(in long apos); acstring getfolderuriatnavigatepos(in long apos); void getnavigatehistory(out unsigned long acurpos, out unsigned long acount, [array, size_is(acount)] out string ahistory); note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindow.
... alistener an nsiurllistener to be notified when the file is saved.
...unfortunately, you must call this before navigating to a position, because calling this has the side effect of making us adjust our current history position, and not adding the loaded message to the history queue.
nsIMicrosummaryGenerator
needspagecontent boolean whether or not this generator needs page content to generate a microsummary.
... microsummaries generated by xslt templates need page content, while those which represent the actual microsummary do not.
...note: in the future, this may be expanded to support rich text content.
nsIMsgCustomColumnHandler
the interface inherits from nsitreeview, however when you're implementing a custom handler in javascript its not necessary to implement all of nsitreeview's methods.
...example implementation an example javascript implementation that does nothing: var columnhandler = { iseditable: function(arow, acol) {return false;}, cyclecell: function(arow, acol) { }, getcelltext: function(arow, acol) { }, getsortstringforrow: function(ahdr) { return ""; }, isstring: function() {return true;}, getcellproperties: function(arow, acol, aprops) { }, getrowproperties: function(arow, aprops) { }, getimagesrc: ...
...it does not affect whether getcelltext vs.
nsIMsgFilter
throws an exception if the action is not priority attribute nsmsgpriorityvalue priority; targetfolderuri // target folder..
... throws an exception if the action is not move to folder attribute acstring targetfolderuri; label // target label.
... throws an exception if the action is not label attribute nsmsglabelvalue label; junkscore attribute long junkscore; strvalue attribute autf8string strvalue; customid // action id if type is custom attribute acstring customid; customaction // custom action associated with customid // (which must be set prior to reading this attribute) readonly attribute nsimsgfiltercustomaction customaction; methods addterm() void nsimsgfilter::addterm ( in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, in boolean booleanand, in acstring arbitraryheader ) getterm() void nsimsgfilter::getterm ( in long termindex, in nsmsgsearchattribvalue attrib, in...
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.
... throws an exception if the action is not label attribute nsmsglabelvalue label; // junkscore throws an exception if the action type is not junkscore attribute long junkscore; attribute autf8string strvalue; // action id if type is custom attribute acstring customid; // custom action associated with customid // (which must be set prior to reading this attribute) readonly attribute nsimsgfiltercustomaction customaction; }; ...
nsINetworkLinkService
for example, the link is down during dhcp configuration (unless there is another usable interface already configured).
... if the link status is not currently known, we generally assume that it is up.
... note: as of gecko 8.0, all operating systems currently return link_type_unknown.
nsIProcess2
1.0 66 introduced gecko 1.9.1 obsolete gecko 1.9.2 inherits from: nsiprocess last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) gecko 1.9.2 note this interface was removed in gecko 1.9.2 and its method added to nsiprocess.
... observer optional an observer that will be notified when the process exits.
...the observer will be notified on the main thread.
nsIProperties
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.
... return value true if the property exists, false if the property does not exist.
nsIPropertyBag
the window scope is not always accessible so the window.navigator cannot be accessed.
... goodies obtained from window.navigator are: appcodename:"mozilla" appname:"netscape" appversion:"5.0 (windows)" battery:batterymanager buildid:"20140529161749" cookieenabled:true donottrack:"yes" geolocation:geolocation language:"en-us" mimetypes:mimetypearray mozalarms:null mozapps:xpcwrappednative_nohelper mozcameras:cameramanager mozconnection:mozconnection mozcontacts:contactmanager mozid:null mozkeyboard:xpcwrappednative_nohelper mozpay:null mozpermissionsettings:null mozphonenumberservice:phonenumberservice mozpower:mozpowermanager moztcpsocket:null online:true oscpu:"windows nt 5.1" platform:"win32" plugins:pluginarray product:"gecko" productsub:"20100101" useragent:"mozilla/5.0 (windows nt 5.1; rv:30.0) gecko/20100101 firefox/30.0" vendor:"" vendorsub:"" __proto__:navigatorprototype...
...services.appinfo.os simply tells us winnt only, this is not helpful to differentiate between windows xp, vista, 7, etc.
nsIPushService
} ); receiving push messages subscriptions created from privileged code use xpcom observer notifications instead of service worker events.
... you can use the global nsiobserverservice to listen for these notifications.
...if the subscription is lost, and your code isn't listening for this notification, you won't be able to receive messages until you create a new subscription.
nsIResumableChannel
exceptions thrown ns_error_not_resumable if this load is not resumable.
...the request will not start until asyncopen or open is called.
...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.
nsISHistoryListener
docshell/shistory/public/nsishistorylistener.idlscriptable an interface you can implement to receive notifications about activities that occur in session history, and optionally cancel them.
... inherits from: nsisupports last changed in gecko 1.7 a session history listener is notified when pages are added to, removed from, and loaded from session history.
...note: you can't cancel this operation.
nsISSLErrorListener
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) note: the recipient of this ssl status notification should not block.
... method overview boolean notifysslerror(in nsiinterfacerequestor socketinfo, in print32 error, in autf8string targetsite); methods notifysslerror() called in case of an ssl error.
... boolean notifysslerror( in nsiinterfacerequestor socketinfo, in print32 error, in autf8string targetsite ); parameters socketinfo a network communication context that can be used to obtain more information about the active connection.
nsISimpleEnumerator
hasmoreelements() called to determine whether or not the enumerator has any elements that can be returned via getnext().
... this method is generally used to determine whether or not to initiate or continue iteration over the enumerator, though it can be called without subsequent getnext() calls.
... does not affect internal state of enumerator.
nsISocketProvider
anonymous_connect 1 << 1 when setting this flag, the socket will not apply any credentials when establishing a connection.
... for example, an ssl connection would not send any client-certificates if this flag is set.
... methods native code only!addtosocket this function is called to allow the socket provider to layer a prfiledesc (a file descriptor) on top of another prfiledesc.
nsIStringEnumerator
hasmore() called to determine whether or not the enumerator has any strings that can be returned via getnext().
... this method is generally used to determine whether or not to initiate or continue iteration over the enumerator, though it can be called without subsequent getnext() calls.
... does not affect internal state of enumerator.
nsISyncMessageSender
throws ns_error_not_initialized if the sender is not initialized.
... for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up.
... throws ns_error_failure when the message receiver cannot be found.
nsITaskbarTabPreview
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.
...if a preview is not registered, the api call to set its sibling (via the move() method) will fail silently.
... move() relocates the preview relative to another tab preview from the same window.
nsIThreadEventFilter
the nsithreadeventfilter interface may be implemented to determine whether or not an event may be accepted by a nested event queue; see nsithreadinternal.pusheventqueue() for more information.
... last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview boolean acceptevent(in nsirunnable event);violates the xpcom interface guidelines methods violates the xpcom interface guidelines acceptevent() this method is called to determine whether or not an event may be accepted by a nested event queue.
... (see nsithreadinternal.pusheventqueue()) warning: this method must not make any calls on the thread object.
nsIThreadPoolListener
the nsithreadpoollistener interface represents objects that listen to notifications generated by the nsithreadpool.
...the notification happens on the newly created thread.
...the notification happens on the thread that is about to be destroyed.
nsIToolkitProfile
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) you should not create these objects yourself; to obtain them, use the nsitoolkitprofileservice interface to create and obtain them.
... note: the unlocker object cannot be returned to javascript as the error causes an exception to be thrown.
...void remove( in boolean removefiles ); parameters removefiles indicates whether or not the profile directory should be removed when the profile is removed from the profile list.
nsIURIFixup
exceptions thrown ns_error_unknown_protocol when we can not get a protocol handler service for the uri scheme.
...returns a well formed uri or nsnull if it cannot.
...note that it is the caller's responsibility to check whether keywords are enabled and whether akeyword is a sensible keyword.
nsIURLParser
out parameters of the methods are all optional (that is the caller may pass-in a null value if the corresponding results are not needed).
... signed out parameters may hold a value of -1 if the corresponding result is not part of the string being parsed.
...c speclen schemepos schemelen authoritypos authoritylen pathpos pathlen parseuserinfo() userinfo = <username>:<password> void parseuserinfo( in string userinfo, in long userinfolen, out unsigned long usernamepos, out long usernamelen, out unsigned long passwordpos, out long passwordlen ); parameters userinfo userinfolen usernamepos usernamelen passwordpos passwordlen notes starting in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6), this no longer treats the semicolon as a "parameter string" marker.
nsIUpdate
ideally, this page is not the release notes but some other page that summarizes the differences between this update and the previous, which also links to the release notes.
...if the update is not in the "failed" state, this value is zero.
...this allows the user to never receive a notification for that specific update version again.
nsIUpdateTimerManager
callback an nsitimercallback object that is notified when the interval expires.
... remarks note that the timer is not precise, and that the default minimum interval is 2 minutes.
...this can be an empty string if the default interval should not be overridden.
nsIWebBrowserChrome
this flag is only meaningful if chrome_openas_chrome is set; content windows should not be dependent.
... chrome_modal 536870912 the modal style bit just affects the way the window looks and does not mean it's actually modal.
...return value note: the function error code returned by this corresponds to the status value specified in exitmodaleventloop.
nsIXMLHttpRequest
note: if you're a web developer or a mozilla add-on developer, please refer to the xmlhttprequest documentation instead.
... 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.
... conclusion: do not use event listeners on xmlhttprequest from c++, unless you're aware of all the security implications.
nsIXULAppInfo
can be an empty string, if id is not set.
...must not be null or an empty string.
...can be an empty string if vendor is not set.
nsIXULBrowserWindow
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.
...this may be used, for example, to redirect links into new tabs or windows when it's not desirable to replace the content in the current tab (such as when the link is clicked in an app tab).
...isapptab whether or not the link being clicked is in an app tab.
nsIXULSortService
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void insertcontainernode(in nsirdfcompositedatasource db, in nsrdfsortstate sortstateptr, in nsicontent root, in nsicontent trueparent, in nsicontent container, in nsicontent node, in boolean anotify); native code only!
...void insertcontainernode( in nsirdfcompositedatasource db, in nsrdfsortstate sortstateptr, in nsicontent root, in nsicontent trueparent, in nsicontent container, in nsicontent node, in boolean anotify ); parameters db sortstateptr root trueparent container node anotify sort() sort the contents of the widget containing anode using asortkey as the comparison key, and asorthints as how to sort.
...asorthints one or more hints as to how to sort: ascending: sort the contents in ascending order descending: sort the contents in descending order comparecase: perform case sensitive comparisons integer: treat values as integers, non-integers are compared as strings twostate: do not allow the natural (unordered state) see also nsixultemplatequeryprocessor ...
nsIZipReaderCache
preadercache); method overview nsizipreader getinnerzip(in nsifile zipfile, in autf8string zipentry); nsizipreader getinnerzip(in nsifile zipfile, in string zipentry); obsolete since gecko 10 nsizipreader getzip(in nsifile zipfile); void init(in unsigned long cachesize); methods getinnerzip() returns a (possibly shared) cached nsizipreader for a zip inside another zip.
...if the zip reader for the given file is not in the cache, a new nsizipreader is opened (see nsizipreader.open()).
...note: if nsizipreader.close has been called on the shared nsizipreader, this method will return the closed nsizipreader nsizipreader getzip( in nsifile zipfile ); parameters zipfile the zip file.
nsPIPromptService
embedding/components/windowwatcher/public/nspipromptservice.idlscriptable this interface is for the dialog implementers, not for other developers.
...note that the second is always password field.
...if this is not 0, the all buttons are disabled when the dialog is shown.
XPCOM reference
if you're working on a module in the mozilla codebase that's compiled with the mozilla_internal_api flag set, some of these apis -- the string functions and classes in particular -- are not the ones you should be using.
...this macro is meant for critical errors; like assertions, ns_errors should not be reachable.ns_if_addrefmacrons_if_releasemacrons_releasemacrons_warningmacronsgetmoduleprocthis function prototype provides the xpcom entry-point into a module.nsiabcard/thunderbird3the nsiabcard interface is used to represent and manipulate cards in the address book.
...it is (as far as i can tell) not currently used anywhere in thunderbird.nsmsgviewcommandtypethe nsmsgviewcommandtype interface contains constants used for commands in thunderbird.
Warnings
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.
...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.
XPCOM Thread Synchronization
quick reference: difference between nsautolock api and new api old construction note: this is deprecated code that is shown only to compare with approved code.
... } old usage note: this is deprecated code that is shown only to compare with approved code.
... concurrentmethod() { nsautolock al(mlock); nsautomonitor am(mmonitor); if (needexpensivecomputation()) { nsautounlock au(mlock); } am.wait(); pr_notifycondvar(mcvar); } new usage using namespace mozilla; concurrentmethod() { mutexautolock al(mlock); monitorautoenter am(mmonitor); if (needexpensivecomputation()) { mutexautounlock au(mlock); } am.wait(); mcvar->notify(); } mozilla synchronization api reference the mozilla:: namespace exports the following synchronization primitives.
Using the Gecko SDK
(note: nspr is the one exception to this rule.
... all nspr functions are frozen by default and are not marked as such in the respective header files.) the glue library exists to make common tasks easier.
...if your component does not use any of the glue classes or functions, then you do not need to link against the glue library.
XPCOM ABI
error console (accessible through tools | error console) and evaluate the following javascript code: components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulruntime) .xpcomabi if either the cpu architecture or the c++ compiler are unknown, the application wouldn't have an xpcom abi string and attempts to get it will result in error ns_error_not_available.
... note: platforms this is not an exhaustive list of possible cpu architectures and compiler abis.
... note: target_xpcom_abi in the mozilla build system, the variable storing the xpcom abi is named target_xpcom_abi.
XPCOM category image-sniffing-services
however, such decoders relied on servers sending correct mime types; images sent with incorrect mime types would not be correctly displayed.
...if mozilla's built-in image code cannot identify an image, then any xpcom components implementing the nsicontentsniffer interface may register under the "image-sniffing-services" category, and will be queried to determine the mime type of the image being downloaded.
... note: this category was removed.
wrappedJSObject
this article focuses on the latter kind of wrappers, which hide any properties or methods on the component that are not part of the supported interfaces as declared in xpidl.
...in this example we use getservice, but as long as we get the reference from xpcom, our component gets wrapped by xpconnect in the same way: var comp = components.classes["@myself.com/my-component;1"].getservice(); if we try to call the hello() method we defined in our component implementation, we get: > comp.hello(); typeerror on line 1: comp.hello is not a function this happens because, as we mentioned earlier, comp is not the helloworld js object itself, but an xpconnect wrapper around it: > dump(comp); [xpconnect wrapped nsisupports] the idea of these wrappers is to make the javascript-implemented xpcom components look just like any other xpcom component to the user.
... nsixpcsecuritymanager allows access (see the source code comments for details; this is usually not an issue for mozilla extensions and applications) this means that in order to access the js object implementing our component directly, we must modify the component.
xptcall FAQ
the varargs stuff goes part way, but is just not enough.
...mozilla will not run properly without a functioning port of xptcall.
...any platform that does not do xptcall is in trouble.
pyxpidl
the newer utility has the advantage of not needing any code to be compiled in order to use it, and let us remove a bunch of old code from the tree.
... xpidl option description pyxpidl equivalent -a emit annotations to typelib n/a (feature removed) -w turn on warnings n/a (this is now the default and can't be turned off) -v verbose mode (nyi) n/a (feature removed) -t creates a typelib of a specific version number n/a (feature removed, and probably never actually worked) -i add an entry to start of include path for #include "nsifoo.idl" -i (...
...sn't just the base name, but needs to include the extension; for example -o /tmp/nsifoo.idl) -e specify an explicit output file name (-e /tmp/nsifoo.idl for example) n/a (this is subsumed by -o now) -d write dependencies (requires -e) -d (unchanged) -m specify output mode n/a (feature removed; use header.py or typelib.py specifically) it's worth noting that the old output mode options for generating documentation and java interfaces (-m doc and -m java) have no equivalents in pyxpidl.
Spam filtering
to analyze a message for spam, we need the entire message, not just the headers.
... currently, spam filtering is does not work for news, but it would be possible to add support for this.
... 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 mark as not junk no op junk mark as junk no op junk mark as not junk remove tokens from bad, add tokens to good ...
The libmime module
any methods or class variables which this class does not wish to override will be automatically inherited from the parent class (by virtue of its class-initialization function having been run first.) each class object will only be initialized once.
...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.
... static void foobar_finalize (mimeobject *object) { ((mimeobjectclass*)&mime_superclass)->finalize(object); // right parentclass.whatnot.object.finalize(object); // (works...) object->class->superclass->finalize(object); // wrong!!
Toolkit version format
if at some point a version part of one version string is greater than the corresponding version part of another version string, then the first version string is greater than the other one.
...note, that since missing version parts are treated as if they were 0, the following version strings are equal: 1, 1.0, 1.0., 1.0.0, and even 1.0...
... older version formats firefox and thunderbird 1.0 used a simpler version format, namely major[.minor[.release[.build]]][+] where [..] denotes an optional component, and major, minor, release, and build are all non-negative integers.
Using tab-modal prompts
note: this part of the documentation is outdated.
...['@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: ' + check.value + '\ninput value:...
... ' + input.value]); note: because the prompts are shown in a tab, if the tab is closed while the prompt is open it will throw an exception.
Virtualenv
site-packages should mostly be for system-installed python and not python that you are installing as a user.
...if you do not have pip or easy_install, you will need to download from pypi or clone from the github virtualenv repository, extract from the tarball (in the pypi case), and run python setup.py install.
...when using this method, be aware that the parts of package installation invoked via setup.py, such as console-script creation and dependency resolution, will not be invoked.
Working with ArrayBuffers
method 2: manually handled another strategy is to handle it manually, as illustrated by the following code example: var casted = ctypes.cast(pixelbuffer.address(), ctypes.uint8_t.array(myimgdata.data.length).ptr).contents; // myimgdat.data.length is imgwidth * imgheight *4 because per pixel there is r, g, b, a numbers /** method a **/ for (var nindex = 0; nindex < casted.length; nindex = nindex + 4) { // casted.length is same...
... (var nindex = 0; nindex < cast.length; nindex = nindex + 4) { // casted.length is same as myimgdat.data.length var r = casted[nindex]; var g = casted[nindex + 1]; var b = casted[nindex + 2]; var a = casted[nindex + 3]; normalarr.push(r); normalarr.push(g); normalarr.push(b); normalarr.push(a); } myimgdat.data.set(normalarr); the preceding example, however, does not take advantage of method 1, but instead manually goes through the array and sets the imagedata array.
...notice that the following example does not cast the pixelbuffer.
Library
this parameter should not be provided if the api is an exported data symbol.
...these should not be provided if the api is an exported data symbol rather than a function.
... alternative syntax another use for ctypes.declare is to get non-function/non-methods from libraries.
PointerType
note: ctypes.void_t.size is undefined.
... note: this is never ctypes.void_t or an array type with an unspecified length.
... pointertype cdata method_overview bool isnull() methods inherited from cdata cdata address() string tosource() string tostring() pointertype cdata methods isnull() determines whether or not the pointer's value is null.
Browser Side Plug-in API - Plugins
warning: you must only call these from the main thread; calling them from other threads is not supported and may have unpredictable results.
... npn_geturlnotify requests creation of a new stream with the contents of the specified url; gets notification of the result.
... npn_posturlnotify posts data to a url, and receives notification of the result.
Preferences System
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 platforms where the window size does not change as the selected panel is changed (e.g.
... not using "toolbar" will cause the preferences dialog to only display one preference pane.
... example: var features = "chrome,titlebar,toolbar,centerscreen,modal"; window.opendialog(url, "preferences", features); bugzilla the component for bugs in the preferences bindings (but not in firefox/thunderbird options ui) is toolkit:preferences (file a bug list open bugs) ...
DOM Property Viewer - Firefox Developer Tools
enabling the dom property viewer the dom property viewer is not enabled by default.
...if a property has more elements than this, you'll see a "more..." annotation, and will need to click the property to see all elements.
... a lock icon indicates that a property is not writable.
Source map errors - Firefox Developer Tools
note: if you're new to source maps, you can learn more about them in how to use a source map.
... the error tells us that the source map is not json data — so we're serving the wrong file.
... the fix here is to make sure the file is being served and is accessible to the browser invalid source map the source map data can be invalid — either simply not a json file at all, or with an incorrect structure.
Page inspector 3-pane mode - Firefox Developer Tools
note: at narrower browser window widths, the tabs appear below the css rules pane.
... having the css rules in their own pane is very useful because it allows you to not only inspect your html and edit the css applied to it, but also see the effect this has on css features such as computed styles and grids in real time.
... note: the 3-pane inspector is already enabled in nightly/developer edition before firefox 62.
CSS Grid Inspector: Examine grid layouts - Firefox Developer Tools
note: the examples shown in the screenshots appearing in this article are jen simmons' futurismo and variations on a grid experiments, and a live named grid area example from rachel andrew.
... note: the layout view can be found underneath the layout tab on the right-hand pane of the page inspector.
... note: your grid preferences such as overlay color and display settings choices are persisted across page loads for each separate page.
Animation inspector example: Web Animations API - Firefox Developer Tools
html content <div class="channel"> <img src="https://udn.realityripple.com/samples/e6/a96484b5c3.png" id="icon"/> <span id="note">firefox developer edition</span> </div> css content .channel { padding: 2em; margin: 0.5em; box-shadow: 1px 1px 5px #808080; margin: 1.5em; } .channel > * { vertical-align: middle; line-height: normal; } #icon { width: 50px; height: 50px; filter: grayscale(100%); } #note { margin-left: 1em; font: 1.5em "open sans",arial,sans-serif; overflow: hidden; white-space: nowrap; display: inline-block; opacity: 0; width: 0; } javascript content var iconkeyframeset = [ { transform: 'scale(1)', filter: 'grayscale(100%)'}, { filter: 'grayscale(100...
...%)', offset: 0.333}, { transform: 'scale(1.5)', offset: 0.666 }, { transform: 'scale(1.5)', filter: 'grayscale(0%)'} ]; var notekeyframeset = [ { opacity: '0', width: '0'}, { opacity: '1', width: '300px'} ]; var iconkeyframeoptions = { duration: 750, fill: 'forwards', easing: 'ease-in', enddelay: 100 } var notekeyframeoptions = { duration: 500, fill: 'forwards', easing: 'ease-out', delay: 150 } var icon = document.getelementbyid("icon"); var note = document.getelementbyid("note"); var iconanimation = icon.animate(iconkeyframeset, iconkeyframeoptions); var noteanimation = note.animate(notekeyframeset, notekeyframeoptions); iconanimation.pause(); noteanimation.pause(); var firsttime = true; function animatechannel(e) { if (e.button != 0) { return; } if ...
...(e.target.id != "icon") { return; } if (firsttime) { iconanimation.play(); noteanimation.play(); firsttime = false; } else { iconanimation.reverse(); noteanimation.reverse(); } } document.addeventlistener("click", animatechannel); ...
Frame rate - Firefox Developer Tools
the x-axis is time over the profile period, and there are three annotations: the maximum frame rate, the average frame rate, and the lowest frame rate.
...this would certainly cause a noticeable stutter for any animations that were playing in the page.
... the frame rate graph is correlated with the waterfall summary directly above it, and there we can see that the first two drops in the frame rate are correlated with orange bars, which denote time spent executing javascript.
Taking screenshots - Firefox Developer Tools
by default, the screenshot icon is not enabled.
... 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.
... note: thanks to eric meyer for his enthusiasm for our screenshot feature, and help!
Toolbox - Firefox Developer Tools
this is what it looks like when it's docked: the window itself is split into two parts: a toolbar along the top, and a main pane underneath: note: since firefox 62, you can drag and drop tabs in the main toolbar of the toolbox to reorder your tools as you wish (bug 1226272).
...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).
... the following tools are not included in the toolbar by default, but you can add them in the settings: highlight painted area 3d view (note that this is not available in firefox 40) scratchpad grab a color from the page take a screenshot of the entire page: take a screenshot of the complete web page and saves it in your downloads directory toggle rulers for the page measure a portion of the page: measure a part of the website by selecting areas within the page toolbox controls finally ...
Web Audio Editor - Firefox Developer Tools
notice: this tool has been deprecated and will soon be removed from firefox.
... opening the web audio editor the web audio editor is not enabled by default in firefox 32.
...if, instead, you've connected a node to an audioparam in another node, then the connection is shown as a dashed line between the nodes, and is labeled with the name of the audioparam: inspecting and modifying audionodes if you click on a node, it's highlighted and you get a node inspector on the right hand side.
AbortSignal.aborted - Web APIs
the aborted read-only property returns a boolean that indicates whether the dom request(s) the signal is communicating with is/are aborted (true) or not (false).
...later on we check whether or not it the signal has been aborted using the aborted property, and send an appropriate log to the console.
...console.log('request has been aborted') : console.log('request not aborted'); specifications specification status comment domthe definition of 'onabort' in that specification.
AddressErrors.regionCode - Web APIs
syntax var regioncodeerror = addresserrors.regioncode; value if the value specified in the paymentaddress object's regioncode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
... if the regioncode value was validated successfully, this property is not included in the addresserrors object.
... usage notes the region code is derived from the iso 3166-2 country subdivision name standard.
AesCtrParams - Web APIs
nonces don't have to be secret, but they must not be reused with the same key.
... essentially: the nonce should ensure that counter blocks are not reused from one message to the next, while the counter should ensure that counter blocks are not reused within a single message.
... note: see appendix b of the nist sp800-38a standard for more information.
Ambient Light Events - Web APIs
light events when the light sensor of a device detects a change in the light level, it notifies the browser of that change.
... when the browser gets such a notification, it fires a devicelightevent event that provides information about the exact light intensity (in lux units).
...if ('ondevicelight' in window) { window.addeventlistener('devicelight', function(event) { var body = document.queryselector('body'); if (event.value < 50) { body.classlist.add('darklight'); body.classlist.remove('brightlight'); } else { body.classlist.add('brightlight'); body.classlist.remove('darklight'); } }); } else { console.log('devicelight event not supported'); } specifications specification status comment ambient light sensorthe definition of 'ambient light events' in that specification.
AnimationEffect.getComputedTiming() - Web APIs
if the keyframeeffect is not associated with an animation, its value is null.
...returns null if the animation is not running or its keyframeeffect isn't associated with an animation.
...returns null if the animation is not running or its keyframeeffect isn't associated with an animation.
AudioBuffer.copyFromChannel() - Web APIs
if not specified, a value of 0 (the beginning of the buffer) is assumed by default.
... example this example creates a new audio buffer, then copies the samples from another channel into it.
... var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); var anotherarray = new float32array(length); myarraybuffer.copyfromchannel(anotherarray, 1, 0); specification specification status comment web audio apithe definition of 'copyfromchannel' in that specification.
AudioBuffer.copyToChannel() - Web APIs
example var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); var anotherarray = new float32array; // copy channel data from second channel of myarraybuffer.
... myarraybuffer.copyfromchannel(anotherarray,1,0); // copy data from anotherarray to first channel of myarraybuffer.
...myarraybuffer.copytochannel (anotherarray,0,0); specification specification status comment web audio apithe definition of 'copytochannel' in that specification.
AudioBufferSourceNode.AudioBufferSourceNode() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetaudiobuffersourcenode() constructorchrome full support 55notes full support 55notes notes before version 59, the default values were not supported.edge full support ≤79firefox full support 53ie no support noopera full support 42safa...
... webview android full support 55notes full support 55notes notes before version 59, the default values were not supported.chrome android full support 55notes full support 55notes notes before version 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ?
... samsung internet android full support 6.0notes full support 6.0notes notes before samsung internet 7.0, the default values were not supported.legend full support full support no support no support compatibility unknown compatibility unknownsee implementation notes.see implementation notes.
AudioConfiguration - Web APIs
'' : 'not ') + 'supported, ' + (result.smooth ?
... '' : 'not ') + 'smooth, and ' + (result.powerefficient ?
... '' : 'not ') + 'power efficient.' }); specifications specification status comment media capabilitiesthe definition of 'audioconfiguration' in that specification.
AudioListener.dopplerFactor - Web APIs
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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.setOrientation() - Web APIs
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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.setPosition() - Web APIs
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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioParam.setTargetAtTime() - Web APIs
the decay rate as defined by the timeconstant parameter is exponential; therefore the value will never reach target completely, but after each timestep of length timeconstant, the value will have approached target by another 1-e-1≈63.2%1 - e^{-1} \approx 63.2%.
...however, for mathematical reasons, that method does not work if the current value or the target value is 0.
... choosing a good timeconstant as mentioned above, the value changes exponentially, with each timeconstant bringing you another 63.2% toward the target value.
AudioParam.setValueCurveAtTime() - Web APIs
rangeerror the specified starttime is either negative or a non-finite value, or duration is not a finite, strictly positive number.
... usage notes when the parameter's value finishes following the curve, its value is guaranteed to match the last value in the set of values specified in the values parameter.
... note: some early implementations of the web audio api did not ensure this to be the case, causing unexpected results.
AudioTrack.enabled - Web APIs
the audiotrack property enabled specifies whether or not the described audio track is currently enabled for use.
... if the track is disabled by setting enabled to false, the track is muted and does not produce audio.
... note: this example assumes that there is only one of each kind of track in the video, but this is not necessarily the case.
AudioTrack - Web APIs
properties enabled a boolean value which controls whether or not the audio track's sound is enabled.
...returns null if the track was not created by a sourcebuffer or the sourcebuffer has been removed from the mediasource.sourcebuffers attribute of its parent media source.
... usage notes to get an audiotrack for a given media element, use the element's audiotracks property, which returns an audiotracklist object from which you can get the individual tracks contained in the media: var el = document.queryselector("video"); var tracks = el.audiotracks; you can then access the media's individual tracks using either array syntax or functions such as foreach().
AudioWorkletNode - Web APIs
although the interface is available outside secure contexts, the baseaudiocontext.audioworklet property is not, thus custom audioworkletprocessors cannot be defined outside them.
... the audioworkletnode interface does not define any methods of its own.
...note that this should be done in a separate file.
AudioWorkletProcessor() - Web APIs
syntax the audioworkletprocessor and classes that derive from it cannot be instantiated directly from a user-supplied code.
...note that there are default values for the first two properties, so even if there are no options object passed to the audioworkletnode constructor, the options object passed by the node to the audioworkletprocessor constructor will exist and at minimum have numberofinputs and numberofoutputs.
...note that this should be done in a separate file.
AudioWorkletProcessor.parameterDescriptors (static getter) - Web APIs
the property is not a part of the audioworkletprocessor interface, but, if defined, it is called internally by the audioworkletprocessor constructor to create a list of custom audioparam objects in the parameters property of the associated audioworkletnode.
...note that this should be done in a separate file.
...parameters['customgain'][i] : parameters['customgain'][0]) // note: a parameter contains an array of 128 values (one value for each of 128 samples), // however it may contain a single value which is to be used for all 128 samples // if no automation is scheduled for the moment.
AuthenticatorAssertionResponse.authenticatorData - Web APIs
the bits are as follows, where "bit 0" is the least significant bit and all bits not specifically mentioned below are "reserved for future use": bit 0, user presence (up) - if set, authenticator validated that the user was present through some test of user presence (tup), such as touching a button on the authenticator.
...this is a sequence of bytes with the following format: aaguid (16 bytes) - authenticator attestation globally unique identifier, a unique number that identifies the model of the authenticator (not the specific instance of the authenticator) so that a relying party can understand the characteristics of the authenticator by looking up its metadata statement.
... examples var options = { challenge: new uint8array(26), // will be another value, provided by the relying party server timeout: 60000 }; navigator.credentials.get({ publickey: options }) .then(function (assertionpkcred) { var authenticatordata = assertionpkcred.response.authenticatordata; // maybe try to convert the authenticatordata to see what's inside // send response and client extensions to the server so that it can // go on with the authe...
AuthenticatorAssertionResponse.signature - Web APIs
note: an authenticatorassertionresponse instance is available on publickeycredential.response after calling navigator.credentials.get().
... note: this property may only be used in top-level contexts and will not be available in an <iframe> for example.
... examples var options = { challenge: new uint8array(26), // will be another value, provided by the relying party server timeout: 60000 }; navigator.credentials.get({ publickey: options }) .then(function (assertionpkcred) { var signature = assertionpkcred.response.signature; // send response and client extensions to the server so that it can // go on with the authentication }).catch(function (err) { console.error(err); }); specifications ...
AuthenticatorAttestationResponse - Web APIs
note: this interface is restricted to top-level contexts.
... use from within an <iframe> element will not have any effect.
...the array may be empty if the information is not available.
BaseAudioContext.createPanner() - Web APIs
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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
BasicCardRequest.supportedNetworks - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsupportednetworkschrome 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).
... webview android no support nochrome android full support 57firefox android 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).
... samsung internet android full support 7.0legend full support full support no support no support compatibility unknown compatibility unknownsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
BasicCardResponse.billingAddress - Web APIs
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).
... webview android no support nochrome android full support 57firefox android 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).
... samsung internet android full support 7.0legend full support full support no support no support compatibility unknown compatibility unknownsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
BasicCardResponse.cardNumber - Web APIs
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).
... webview android no support nochrome android full support 57firefox android 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).
... samsung internet android full support 7.0legend full support full support no support no support compatibility unknown compatibility unknownsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
BasicCardResponse.cardSecurityCode - Web APIs
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).
... webview android no support nochrome android full support 57firefox android 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).
... samsung internet android full support 7.0legend full support full support no support no support compatibility unknown compatibility unknownsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
BasicCardResponse.cardholderName - Web APIs
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).
... webview android no support nochrome android full support 57firefox android 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).
... samsung internet android full support 7.0legend full support full support no support no support compatibility unknown compatibility unknownsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
BasicCardResponse.expiryMonth - Web APIs
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).
... webview android no support nochrome android full support 57firefox android 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).
... samsung internet android full support 7.0legend full support full support no support no support compatibility unknown compatibility unknownsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
BasicCardResponse.expiryYear - Web APIs
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).
... webview android no support nochrome android full support 57firefox android 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).
... samsung internet android full support 7.0legend full support full support no support no support compatibility unknown compatibility unknownsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
Blob.slice() - Web APIs
WebAPIBlobslice
end optional an index into the blob indicating the first byte that will *not* be included in the new blob (i.e.
... the byte exactly at this index is not included).
...the original blob is not altered.
BroadcastChannel() - Web APIs
note: this feature is available in web workers.
... example // create a new channel listening to the "internal_notification" channel.
... var bc = new broadcastchannel('internal_notification'); bc.postmessage('new listening connected!'); specifications specification status comment html living standardthe definition of 'broadcastchannel()' in that specification.
Broadcast Channel API - Web APIs
note: this feature is available in web workers.
...an example string message: // example of sending of a very simple message bc.postmessage('this is a test message.'); any kind of object can be sent, not just a domstring.
... the messaging protocol is not defined and the different browsing contexts need to implement it themselves; there is no negotiation nor requirement from the specification.
CSSRuleList - Web APIs
note that being indirect-modify (changeable but only having read-methods), rules are not added or removed from the list directly, but instead here, only via its parent stylesheet.
... in fact, .insertrule() and .deleterule() are not even methods of cssrulelist, but only of cssstylesheet.
... if however, for some reason the list does need to be modified but has no parent stylesheet (perhaps being a livecopy of a list that does), it cannot just be assigned one (as it has no such property), and neither can it be assigned to one (as stylesheet.cssrules is read-only), but it must unfortunately be inserted into one, rule by rule, and unless combining lists, after any existing list therein is deleted, rule by rule.
CSSStyleDeclaration.setProperty() - Web APIs
if not specified, treated as the empty string.
... note: value must not contain "!important" -- that should be set using the priority parameter.
...if not specified, treated as the empty string.
CSSStyleSheet.addRule() - Web APIs
if index is not specified, the next index after the last item currently in the list is used (that is, the value of cssstylesheet.cssrules.length).
... note that due to somewhat estoteric rules about where you can legally insert rules, it's possible that an exception may be thrown.
... usage notes this method is implemented by browsers by constructing a string using the template literal `${selector}{${styleblock}}`, then passing it into the standard insertrule() method.
Managing screen orientation - Web APIs
rait) { #toolbar { width: 100%; } } /* for landscape, we want the tool bar stick on the left */ @media screen and (orientation: landscape) { #toolbar { position: fixed; width: 2.65em; height: 100%; } p { margin-left: 2em; } li + li { margin-top: .5em; } } and here's the result portrait landscape note: the orientation media query actually applies based on the orientation of the browser window (or iframe) not the orientation of the device.
... screen.lockorientation('landscape'); note: a screen lock is web application dependent.
... if application a is locked to landscape and application b is locked to portrait, switching from application a to b or b to a will not fire an orientationchange event because both applications will keep the orientation they had.
Cache.add() - Web APIs
WebAPICacheadd
note: add() will overwrite any key/value pair previously stored in the cache that matches the request.
... exceptions exception happens when typeerror the url scheme is not http or https.
... the response status is not in the 200 range (i.e., not a successful response.) this occurs if the request does not return successfully, but also if the request is a cross-origin no-cors request (in which case the reported status is always 0.) examples this code block waits for an installevent to fire, then calls waituntil() to handle the install process for the app.
Cache.addAll() - Web APIs
WebAPICacheaddAll
note: addall() will overwrite any key/value pairs previously stored in the cache that match the request, but will fail if a resulting put() operation would overwrite a previous cache entry stored by the same addall() method.
... exceptions exception happens when typeerror the url scheme is not http or https.
... the response status is not in the 200 range (i.e., not a successful response.) this occurs if the request does not return successfully, but also if the request is a cross-origin no-cors request (in which case the reported status is always 0.) examples this code block waits for an installevent to fire, then runs waituntil() to handle the install process for the app.
Cache.keys() - Web APIs
WebAPICachekeys
note: requests with duplicate urls but different headers can be returned if their responses have the vary header set on them.
... ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching.
...note that this option is ignored by cache.keys().
Cache.match() - Web APIs
WebAPICachematch
ignorevary: a boolean that when set to true tells the matching operation not to perform vary header matching — i.e.
... 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]).
...if fetch() returns a valid http response with an response code in the 4xx or 5xx range, the catch() will not be called.
Cache.matchAll() - Web APIs
WebAPICachematchAll
ignorevary: a boolean that when set to true tells the matching operation not to perform vary header matching — i.e.
... if the url matches you will get a match regardless of the response object having a vary header or not.
... 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]).
CanvasRenderingContext2D.arcTo() - Web APIs
note: be aware that you may get unexpected results when using a relatively large radius: the arc's connecting line will go in whatever direction it must to meet the specified radius.
... examples how arcto works one way to think about arcto() is to imagine two straight segments: one from the starting point to a first control point, and another from there to a second control point.
...note that the arc's second control point and the point specified by lineto() are the same, which produces a totally smooth corner.
CanvasRenderingContext2D.imageSmoothingEnabled - Web APIs
the imagesmoothingenabled property of the canvasrenderingcontext2d interface, part of the canvas api, determines whether scaled images are smoothed (true, default) or not (false).
... note: you can adjust the smoothing quality with the imagesmoothingquality property.
... syntax ctx.imagesmoothingenabled = value; options value a boolean indicating whether to smooth scaled images or not.
CanvasRenderingContext2D.putImageData() - Web APIs
this method is not affected by the canvas transformation matrix.
... note: image data can be retrieved from a canvas using the getimagedata() method.
... errors thrown notsupportederror thrown if any of the arguments is infinite.
Manipulating video using canvas - Web APIs
then addeventlistener() is called to begin watching the video element so that we obtain notification when the user presses the play button on the video.
... processor.timercallback = function timercallback() { if (this.video.paused || this.video.ended) { return; } this.computeframe(); let self = this; settimeout(function() { self.timercallback(); }, 0); }, the first thing the callback does is check to see if the video is even playing; if it's not, the callback returns immediately without doing anything.
... note that you can simply pass the video element into the context's drawimage() method to draw the current video frame into the context.
Hit regions and accessibility - Web APIs
« previousnext » the <canvas> element on its own is just a bitmap and does not provide information about any drawn objects.
... canvas content is not exposed to accessibility tools like semantic html is.
...the hit region api allows you to define an area of your canvas and provides another possibility to expose interactive content on a canvas to accessibility tools.
Canvas tutorial - Web APIs
this can, for instance, be used to draw graphs, combine photos, or create simple (and not so simple) animations.
... 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.
Canvas API - Web APIs
const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.fillstyle = 'green'; ctx.fillrect(10, 10, 150, 100); result reference htmlcanvaselement canvasrenderingcontext2d canvasgradient canvasimagesource canvaspattern imagebitmap imagedata renderingcontext textmetrics offscreencanvas path2d imagebitmaprenderingcontext note: the interfaces related to the webglrenderingcontext are referenced under webgl.
... libraries the canvas api is extremely powerful, but not always simple to use.
... note: see the webgl api for 2d and 3d libaries that use webgl.
Channel Messaging API - Web APIs
the channel messaging api allows two separate scripts running in different browsing contexts attached to the same document (e.g., two iframes, or the main document and an iframe, two documents via a sharedworker, or two workers) to communicate directly, passing messages between one another through two-way channels (or pipes) with a port at each end.
... note: this feature is available in web workers.
...for instance a port, when is sent, cannot be used anymore by the original context.
ChildNode.before() - Web APIs
WebAPIChildNodebefore
exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy.
...e.log(parent.outerhtml); // "<div>text<p></p></div>" inserting an element and text var parent = document.createelement("div"); var child = document.createelement("p"); parent.appendchild(child); var span = document.createelement("span"); child.before(span, "text"); console.log(parent.outerhtml); // "<div><span></span>text<p></p></div>" childnode.before() is unscopable the before() method is not scoped into the with statement.
... with(node) { before("foo"); } // referenceerror: before is not defined polyfill you can polyfill the before() method in internet explorer 9 and higher with the following code: // from: https://github.com/jserz/js_piece/blob/master/dom/childnode/before()/before().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('before')) { return; } object.defineproperty(item, 'before', { configurable: true, enumerable: true, writable: true, value: function before() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfra...
ChildNode.replaceWith() - Web APIs
exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy.
... examples using replacewith() var parent = document.createelement("div"); var child = document.createelement("p"); parent.appendchild(child); var span = document.createelement("span"); child.replacewith(span); console.log(parent.outerhtml); // "<div><span></span></div>" childnode.replacewith() is unscopable the replacewith() method is not scoped into the with statement.
... with(node) { replacewith("foo"); } // referenceerror: replacewith is not defined polyfill you can polyfill the replacewith() method in internet explorer 10+ and higher with the following code: function replacewithpolyfill() { 'use-strict'; // for safari, and ie > 10 var parent = this.parentnode, i = arguments.length, currentnode; if (!parent) return; if (!i) // if there are no arguments parent.removechild(this); while (i--) { // i-- decrements i and returns the value of i before the decrement currentnode = arguments[i]; if (typeof currentnode !== 'object'){ currentnode = this.ownerdocument.createtextnode(currentnode); } else if (currentnode.parentnode){ currentnode.parentnode.removechild(currentnode); ...
ClipboardItem() - Web APIs
note: image format support varies by browser.
... note: to work with text see the clipboard.readtext() and clipboard.writetext() methods of the clipboard interface.
... note: you can only pass in one clipboard item at a time.
ClipboardItem.getType() - Web APIs
the gettype() method of the clipboarditem interface returns a promise that resolves with a blob of the requested mime type or an error if the mime type is not found.
... exceptions domexception the type does not match a known mime type.
... typeerror no parameter is specified or the type is not that of the clipboarditem.
ClipboardItem - Web APIs
note: to work with text see the clipboard.readtext() and clipboard.writetext() methods of the clipboard interface.
... note: you can only pass in one clipboard item at a time.
... gettype() returns a promise that resolves with a blob of the requested mime type, or an error if the mime type is not found.
Console.group() - Web APIs
WebAPIConsolegroup
note: this feature is available in web workers.
...(chrome 59 tested) does not work with console.groupend().
... note: from gecko 9 until gecko 51, the groupcollapsed() method was the same as group().
Console.table() - Web APIs
WebAPIConsoletable
note that (in firefox) console.table is limited to displaying 1000 rows (first row is the labeled index).
... note: this feature is available in web workers.
.../ an array of arrays var people = [["john", "smith"], ["jane", "doe"], ["emily", "jones"]] console.table(people); // an array of objects function person(firstname, lastname) { this.firstname = firstname; this.lastname = lastname; } var john = new person("john", "smith"); var jane = new person("jane", "doe"); var emily = new person("emily", "jones"); console.table([john, jane, emily]); note that if the array contains objects, then the columns are labeled with the property name.
ContentIndex.add() - Web APIs
WebAPIContentIndexadd
return value returns a promise that resolves with undefined exceptions typeerror if the service worker's registration is not present or the service worker does not contain a fetchevent.
... if the id, title, description or url are missing, not of type string, or an empty string.
... if icons images are not of image type.
Content Index API - Web APIs
concepts and usage as it stands, offline web content is not easily discoverable by users.
... indexed entries do not automatically expire.
...it is not fired when the contentindex.delete method is called.
ConvolverNode - Web APIs
note: for more information on the theory behind linear convolution, see the convolution article on wikipedia.
... convolvernode.normalize a boolean that controls whether the impulse response from the buffer will be scaled by an equal-power normalization when the buffer attribute is set, or not.
... note: you will need to find an impulse response to complete the example below.
Crypto - Web APIs
WebAPICrypto
note: this feature is available in web workers.
... usage notes you should avoid using the web crypto api on insecure contexts, even though the crypto interface is present on insecure contexts, as is the window.crypto property.
... in addition, the crypto method getrandomvalues() is available on insecure contexts, but the subtle property is not.
CustomElementRegistry.whenDefined() - Web APIs
exceptions exception description syntaxerror if the provided name is not a valid custom element name, the promise rejects with a syntaxerror.
... <menu-item>item n</menu-item> </nav-menu> </nav> const container = document.getelementbyid('menu-container'); const placeholder = container.queryselector('.menu-placeholder'); // fetch all the children of menu that are not yet defined.
... const undefinedelements = container.queryselectorall(':not(:defined)'); const promises = [...undefinedelements].map( button => customelements.whendefined(button.localname) ); // wait for all the children to be upgraded, // then remove the placeholder.
CustomElementRegistry - Web APIs
customelementregistry.get() returns the constuctor for the named custom element, or undefined if the custom element is not defined.
...note how we use the customelementregistry.define() method to define the custom element after creating its class.
...t.createelement('span'); text.textcontent = count; // append it to the shadow root shadow.appendchild(text); // update count when element content changes setinterval(function() { var count = 'words: ' + countwords(wcparent); text.textcontent = count; }, 200) } } // define the new element customelements.define('word-count', wordcount, { extends: 'p' }); note: the customelementregistry is available through the window.customelements property.
DOMHighResTimeStamp - Web APIs
also note the section below on reduced time precision controlled by browser preferences to avoid timing attacks and fingerprinting.
... if during the process of unloading the previous document which was loaded in the window, a confirmation dialog was displayed to let the user confirm whether or not to leave the previous page, the time origin is the time at which the user confirmed that navigating to the new page was acceptable.
... usage notes you can get the current timestamp value—the time that has elapsed since the context was created—by calling the performance method now().
DOMMatrixReadOnly.scale() - Web APIs
if not supplied, this defaults to the value of scalex.
...the original matrix is not modified.
... note: at time of writing, firefox still supports an older version of the specification that accepts either one or three values.
DOMParser - Web APIs
WebAPIDOMParser
note: xmlhttprequest can parse xml and html directly from a url-addressable resource, returning a document in its response property.
... application/xml xmldocument application/xhtml+xml xmldocument image/svg+xml xmldocument examples parsing xml once you have created a parser object, you can parse xml from a string using the parsefromstring() method: let parser = new domparser() let doc = parser.parsefromstring(stringcontainingxmlsource, "application/xml") error handling note that if the parsing process fails, the domparser does not throw an exception, but instead returns an error document: <parsererror xmlns="http://www.mozilla.org/newlayout/xml/parsererror.xml"> (error description) <sourcetext>(a snippet of the source xml)</sourcetext> </parsererror> the parsing errors are also reported to the error console, with the document uri (see below) as the source of...
... if the mime type is text/xml, the result will be an xmldocument if the mime type is image/svg+xml, the result will be an svgdocument if the mime type is text/html, the result will be an htmldocument let parser = new domparser() let doc = parser.parsefromstring(stringcontainingxmlsource, "application/xml") // returns a document, but not an svgdocument nor an htmldocument parser = new domparser(); doc = parser.parsefromstring(stringcontainingsvgsource, "image/svg+xml") // returns a svgdocument, which also is a document.
DOMTokenList.replace() - Web APIs
return value a boolean value, which is true if oldtoken was successfully replaced, or false if not.
... note: in older browsers, replace() returns void.
... first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; let result = classes.replace("c", "z"); console.log(result); if (result) { span.textcontent = classes; } else { span.textcontent = 'token not replaced successfully'; } the output looks like this: polyfill the following polyfill will add the replace method to the domtokenlist class.
DataTransfer.addElement() - Web APIs
this element will be the element to which drag and dragend events are fired, and not the defaut target (the node that was dragged).
... note: this method is gecko-specific.
... return value void example this example shows the use of the addelement() method function change_drag_node(event, node) { var dt = event.datatransfer; dt.addelement(node); } specifications this method is not defined in any web standard.
DataTransfer.clearData() - Web APIs
if data for the given type does not exist, this method does nothing.
... this method does not remove files from the drag operation, so it's possible for there still to be an entry with the type "files" left in the object's datatransfer.types list if there are any files included in the drag.
...if this parameter is an empty string or is not provided, the data for all types is removed.
DataTransfer.mozUserCancelled - Web APIs
the datatransfer.mozusercancelled property is used in the dragend event handler to determine if the user canceled the drag or not.
... note: this property is gecko-specific.
... function dragend_handler(event) { var dragdata = event.datatransfer; console.log("mozusercancelled = " + dragdata.mozusercancelled); } specifications this property is not defined in any web standard.
DataTransferItemList.remove() - Web APIs
if the index is less than zero or greater than one less than the length of the list, the list will not be changed.
... exceptions invalidstateerror the drag data store is not in read/write mode, so the item can't be removed.
... recommendation not included in w3c html5 recommendation ...
DelayNode() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdelaynode() constructorchrome full support 55notes full support 55notes notes before version 59, the default values were not supported.edge full support ≤79firefox full support 53ie no support noopera full support 42safa...
... webview android full support 55notes full support 55notes notes before version 59, the default values were not supported.chrome android full support 55notes full support 55notes notes before version 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ?
... samsung internet android full support 6.0notes full support 6.0notes notes before samsung internet 7.0, the default values were not supported.legend full support full support no support no support compatibility unknown compatibility unknownsee implementation notes.see implementation notes.
DisplayMediaStreamConstraints.video - Web APIs
a value of false is not permitted and will throw a typeerror.
... cursor a constraindomstring which specifies whether or not to include the mouse cursor in the generated track, and if so, whether or not to hide it while not moving.
... logicalsurface a constrainboolean value which may contain a single boolean value or a set of them, indicating whether or not to allow the user to choose source surfaces which do not directly correspond to display areas.
DisplayMediaStreamConstraints - Web APIs
the displaymediastreamconstraints dictionary is used to specify whether or not to include video and/or audio tracks in the mediastream to be returned by getdisplaymedia(), as well as what type of processing must be applied to the tracks.
... properties audio a boolean or mediatrackconstraints value; if a boolean, this value simply indicates whether or not to include an audio track in the mediastream returned by getdisplaymedia().
...a value of false is not permitted, and results in a typeerror being thrown.
Document.createNSResolver() - Web APIs
notes adapts any dom node to resolve namespaces so that an xpath expression can be easily evaluated relative to the context of the node where it appeared within the document.
... note, xpath defines qnames without prefix to match only elements in the null namespace.
...to match default elements in a non-null namespace, you either have to refer to a particular element using a form such as *namespace-uri()=http://www.w3.org/1999/xhtml and name()=p[@id='_myid'] (this approach works well for dynamic xpath expressions where the namespaces might not be known) or use prefixed name tests, and create a namespace resolver mapping the prefix to the namespace.
Document.hasFocus() - Web APIs
WebAPIDocumenthasFocus
when viewing a document, an element with focus is always the active element in the document, but an active element does not necessarily have focus.
... for example, an active element within a popup window that is not the foreground doesn't have focus.
...p id="log">awaiting focus check.</p> <button onclick="openwindow()">open a new window</button> javascript function checkpagefocus() { let body = document.queryselector('body'); let log = document.getelementbyid('log'); if (document.hasfocus()) { log.textcontent = 'this document has the focus.'; body.style.background = '#fff'; } else { log.textcontent = 'this document does not have the focus.'; body.style.background = '#ccc'; } } function openwindow() { window.open('https://developer.mozilla.org/', 'mdn', 'width=640,height=320,left=150,top=150'); } // check page focus every 300 milliseconds setinterval(checkpagefocus, 300); result specification specification status comment html living standardthe definition of 'document.hasfoc...
Document.lastStyleSheetSet - Web APIs
if the current style sheet set has not been changed by setting document.selectedstylesheetset, the returned value is null.
... note: this value doesn't change when document.enablestylesheetsforset() is called.
... example let lastsheetset = document.laststylesheetset; if (!lastsheetset) { lastsheetset = 'style sheet not yet changed'; } else { console.log('the last style sheet set is: ' + lastsheetset); } ...
Document.queryCommandEnabled() - Web APIs
the document.querycommandenabled() method reports whether or not the specified editor command is enabled by the browser.
... notes for 'cut' and 'copy' commands the method only returns true when called from a user-initiated thread.
... the 'paste' command return false not only if the feature is unavailable, but also if the script calling it has insufficient privileges to perform the action.
Document: scroll event - Web APIs
bubbles yes cancelable no interface event event handler property onscroll note: in ios uiwebviews, scroll events are not fired while scrolling is taking place; they are only fired after the scrolling has completed.
...safari and wkwebviews are not affected by this bug.
... note, however, that input events and animation frames are fired at about the same rate, and therefore the optimization below is often unnecessary.
DocumentOrShadowRoot.elementFromPoint() - Web APIs
if the element at the specified point belongs to another document (for example, the document of an <iframe>), that document's parent element is returned (the <iframe> itself).
... if the method is run on another document (like an <iframe>'s subdocument), the coordinates are relative to the document where the method is being called.
... html <p id="para1">some text here</p> <button onclick="changecolor('blue');">blue</button> <button onclick="changecolor('red');">red</button> the html provides the paragraph whose color will be affected, as well as two buttons: one to change the color to blue, and another to change the color to red.
DocumentType - Web APIs
documenttype.notations read only a namednodemap with notations declared in the dtd.
... every node in this map implements the notation interface.
... removed the internalsubset, entities, and notation properties.
Events and the DOM - Web APIs
the event interface itself is described, as well as the interfaces for event registration on nodes in the dom, and event listeners, and several longer examples that show how the various event interfaces relate to one another.
... note: internet explorer 6–8 didn't support this method, offering a similar eventtarget.attachevent api instead.
...concerns of content/structure and behavior are not well-separated, making a bug harder to find.
Examples of web and XML development using the DOM - Web APIs
note that the table itself has an onclick event handler that ought to display a message when the table is clicked.
...addeventlistener("click", stopevent, false); } </script> </head> <body onload="load();"> <table id="t-daddy" onclick="alert('hi');"> <tr id="tbl1"> <td id="c1">one</td> </tr> <tr> <td id="c2">two</td> </tr> </table> </body> </html> example 6: getcomputedstyle this example demonstrates how the window.getcomputedstyle method can be used to get the styles of an element that are not set using the style attribute or with javascript (e.g., elt.style.backgroundcolor="rgb(173, 216, 230)").
... cells to an existing table: <table id="table0"> <tr> <td>row 0 cell 0</td> <td>row 0 cell 1</td> </tr> </table> <script> var table = document.getelementbyid('table0'); var row = table.insertrow(-1); var cell, text; for (var i = 0; i < 2; i++) { cell = row.insertcell(-1); text = 'row ' + row.rowindex + ' cell ' + i; cell.appendchild(document.createtextnode(text)); } </script> notes a table's innerhtml property should never be used to modify a table, although you can use it to write an entire table or the content of a cell.
DragEvent - Web APIs
WebAPIDragEvent
the user initiates a drag by placing a pointer device (such as a mouse) on the touch surface and then dragging the pointer to a new location (such as another dom element).
... constructors although this interface has a constructor, it is not possible to create a useful datatransfer object from script, since datatransfer objects have a processing and security model that is coordinated by the browser during drag-and-drops.
... dragover this event is fired continuously when an element or text selection is being dragged and the mouse pointer is over a valid drop target (every 50 ms when mouse is not moving else much faster between 5 ms (slow movement) and 1ms (fast movement) approximately.
DynamicsCompressorNode() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdynamicscompressornode() constructorchrome full support 55notes full support 55notes notes before chrome 59, the default values were not supported.edge full support ≤79firefox full support 53ie no support noopera full support 42safar...
... webview android full support 55notes full support 55notes notes before version 59, the default values were not supported.chrome android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ?
... samsung internet android full support 6.0notes full support 6.0notes notes before samsung internet 7.0, the default values were not supported.legend full support full support no support no support compatibility unknown compatibility unknownsee implementation notes.see implementation notes.
EffectTiming - Web APIs
these properties are all optional, although without setting a duration the animation will not play.
...although this is technically optional, keep in mind that your animation will not run if this value is 0.
...this is primarily of use when sequencing animations based on the end time of another animation.
Element: DOMMouseScroll event - Web APIs
bubbles yes cancelable yes interface mousescrollevent if you want to prevent the default action of mouse wheel events, it's not enough to handle only this event on gecko because if scroll amount by a native mouse wheel event is less than 1 line (or less than 1 page when the system setting is by page scroll), other mouse wheel events may be fired without this event.
... note: trusted events are never sent with a value of 0 for detail.
... note: if the platform's native mouse wheel events only provide scroll distance by pixels, or if the speed can be customized by the user, the value is computed using the line height of the nearest scrollable ancestor element of the event's target.
Element.clientLeft - Web APIs
clientleft does not include the left margin or the left padding.
... note: this property will round the value to an integer.
... note: when an element has display: inline, clientleft returns 0 regardless of the element's border.
Element: contextmenu event - Web APIs
any right-click event that is not disabled (by calling the event's preventdefault() method) will result in a contextmenu event being fired at the targeted element.
...as a result, the first paragraph will do nothing when right-clicked, while the second paragraph will show the standard context menu offered by your browser.
... html <p id="nocontextmenu">the context menu has been disabled on this paragraph.</p> <p>but it has not been disabled on this one.</p> javascript nocontext = document.getelementbyid('nocontextmenu'); nocontext.addeventlistener('contextmenu', e => { e.preventdefault(); }); result specifications specification status comment html living standardthe definition of 'contextmenu' in that specification.
Element: cut event - Web APIs
WebAPIElementcut event
note though that cancelling the default action will also prevent the document from being updated.
... the handler cannot read the clipboard data.
... it's possible to construct and dispatch a synthetic cut event, but this will not affect the system clipboard or the document's contents.
Element.getAttribute() - Web APIs
if the given attribute does not exist, the value returned will either be null or "" (the empty string); see non-existing attributes for details.
... non-existing attributes essentially all web browsers (firefox, internet explorer, recent versions of opera, safari, konqueror, and icab, as a non-exhaustive list) return null when the specified attribute does not exist on the specified element; this is what the current dom specification draft specifies.
...consequently, you should use element.hasattribute() to check for an attribute's existence prior to calling getattribute() if it is possible that the requested attribute does not exist on the specified element.
Element.getAttributeNode() - Web APIs
example // html: <div id="top" /> let t = document.getelementbyid("top"); let idattr = t.getattributenode("id"); alert(idattr.value == "top") notes when called on an html element in a dom flagged as an html document, getattributenode lower-cases its argument before proceeding.
... the attr node inherits from node, but is not considered a part of the document tree.
... dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribu...
Element.id - Web APIs
WebAPIElementid
if the id value is not the empty string, it must be unique in a document.
...another common case is to use an element's id as a selector when styling the document with css.
... note: identifiers are case-sensitive, but you should avoid creating ids that differ only in the capitalization.
Element.insertAdjacentElement() - Web APIs
exceptions exception explanation syntaxerror the position specified is not a recognised value.
... typeerror the element specified is not a valid element.
... visualization of position names <!-- beforebegin --> <p> <!-- afterbegin --> foo <!-- beforeend --> </p> <!-- afterend --> note: the beforebegin and afterend positions work only if the node is in a tree and has an element parent.
Element.insertAdjacentText() - Web APIs
exceptions exception explanation syntaxerror the position specified is not a recognised value.
... visualization of position names <!-- beforebegin --> <p> <!-- afterbegin --> foo <!-- beforeend --> </p> <!-- afterend --> note: the beforebegin and afterend positions work only if the node is in a tree and has an element parent.
...note that the existing text node is not added to — further text nodes are created containing the new additions.
Element.querySelector() - Web APIs
the entire hierarchy of elements is considered when matching, including those outside the set of elements including baseelement and its descendants; in other words, selectors is first applied to the whole document, not the baseelement, to generate an initial list of potential elements.
... find a specific element with specific values of an attribute in this first example, the first <style> element which either has no type or has type "text/css" in the html document body is returned: var el = document.body.queryselector("style[type='text/css'], style:not([type])"); the entire hierarchy counts this example demonstrates that the hierarchy of the entire document is considered when applying selectors, so that levels outside the specified baseelement are still considered when locating matches.
... html <div> <h5>original content</h5> <p> inside paragraph <span>inside span</span> inside paragraph </p> </div> <div> <h5>output</h5> <div id="output"></div> </div> javascript var baseelement = document.queryselector("p"); document.getelementbyid("output").innerhtml = (baseelement.queryselector("div span").innerhtml); result the result looks like this: notice how the "div span" selector still successfully matches the <span> element, even though the baseelement's child nodes do not include the div element (it is still part of the specified selector).
Element.scrollWidth - Web APIs
the element.scrollwidth read-only property is a measurement of the width of an element's content, including content not visible on the screen due to overflow.
...the width is measured in the same way as clientwidth: it includes the element's padding, but not its border, margin or vertical scrollbar (if present).
... hidden; white-space: nowrap; text-overflow: ellipsis; } #adiv { width: 100px; } button { margin-bottom: 2em; } </style> </head> <body> <div id="adiv"> foobar-foobar-foobar-foobar </div> <button id="abutton"> check for overflow </button> <div id="anotherdiv"> foobar-foobar-foobar-foobar </div> <button id="anotherbutton"> check for overflow </button> </body> <script> var buttonone = document.getelementbyid('abutton'), buttontwo = document.getelementbyid('anotherbutton'), divone = document.getelementbyid('adiv'), divtwo = document.getelementbyid('anotherdiv'); //check to determine if an overflow i...
Element.setAttributeNode() - Web APIs
example this example copies the align attribute from one element to another.
... html <div id="one" align="left">one</div> <div id="two">two</div> javascript let d1 = document.getelementbyid('one'); let d2 = document.getelementbyid('two'); let a = d1.getattributenode('align'); d2.setattributenode(a.clonenode(true)); // returns: 'left' alert(d2.attributes[1].value); notes if the attribute named already exists on the element, that attribute is replaced with the new one and the replaced one is returned.
... dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'setattributenode()' in that specification.
Element.setAttributeNodeNS() - Web APIs
mozilla.org/ns/specialspace" // myns:special-align="utterleft">one</div> // <div id="two">two</div> var myns = "http://www.mozilla.org/ns/specialspace"; var d1 = document.getelementbyid("one"); var d2 = document.getelementbyid("two"); var a = d1.getattributenodens(myns, "special-align"); d2.setattributenodens(a.clonenode(true)); alert(d2.attributes[1].value) // returns: `utterleft' notes if the specified attribute already exists on the element, then that attribute is replaced with the new one and the replaced one is returned.
... note that if you try to set without cloning the node, mozilla gives an ns_error_dom_inuse_attribute_err "attribute already in use" error, as the dom requires cloning for attr to be reused (unlike other nodes which can be moved).
... dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'document.setattributenodens' in that specification.
Element: webkitmouseforcewillbegin event - Web APIs
this offers the opportunity to tell the system not to trigger any default force touch actions if and when the click turns into a force touch event.
... to instruct macos not to engage any default force touch actions if the user apply enough pressure to activate a force touch event, call preventdefault() on the webkitmouseforcewillbegin event object.
... specifications not part of any specification.
FeaturePolicy.allowsFeature() - Web APIs
example the following example queries whether or not the document is allowed to use camera api by the feature policy.
... please note that camera api might be restricted by the permissions api, if the user did not grant the corresponding permission yet.
... // first, get the feature policy object const featurepolicy = document.featurepolicy // then query feature for specific const allowed = featurepolicy.allowsfeature("camera") if (allowed){ console.log("fp allows camera.") } else { console.log("fp does not allows camera.") } specifications specification status comment feature policythe definition of 'allowsfeature' in that specification.
FeaturePolicy - Web APIs
featurepolicy methods featurepolicy.allowsfeature returns a boolean that indicates whether or not a particular feature is enabled in the specified context.
...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.
...note that features appearing on this list might still be behind a user permission.
FetchEvent - Web APIs
this constructor is not typically used.
... fetchevent.preloadresponse read only a promise for a response, or undefined if this fetch is not a navigation, or navigation preload is not enabled.
...used to notify the browser of tasks that extend beyond the returning of a response, such as streaming and caching.
Fetch API - Web APIs
WebAPIFetch API
it returns a promise that resolves to the response to that request, whether it is successful or not.
... 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.
File.fileName - Web APIs
WebAPIFilefileName
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.
... syntax var name = instanceoffile.filename; value a string specification not part of any specification.
File.type - Web APIs
WebAPIFiletype
g, containing the media type(mime) indicating the type of the file, for example "image/png" for png images example <input type="file" multiple onchange="showtype(this)"> function showtype(fileinput) { var files = fileinput.files; for (var i = 0; i < files.length; i++) { var name = files[i].name; var type = files[i].type; alert("filename: " + name + " , type: " + type); } } note: based on the current implementation, browsers won't actually read the bytestream of a file to determine its media type.
... it is assumed based on the file extension; a png image file renamed to .txt would give "text/plain" and not "image/png".
...developers are advised not to rely on this property as a sole validation scheme.
FileReaderSync.readAsBinaryString() - Web APIs
note: this method is deprecated in favor of readasarraybuffer().
... exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g.
... notreadableerror is raised when the resource cannot be read due to a permission problem, like a concurrent lock.
FileReaderSync.readAsText() - Web APIs
if not present, the method will apply a detection algorithm for it.
... exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g.
... notreadableerror is raised when the resource cannot be read due to a permission problem, like a concurrent lock.
FileRequest.onprogress - 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.
... example // assuming 'request' which is a filerequest object request.onprogress = function (status) { var progress = document.queryselector('progress'); progress.value = status.loaded; progress.max = status.total; } specification not part of any current specification.
FileSystemDirectoryReader.readEntries() - Web APIs
note that to read all files in a directory, readentries needs to be called repeatedly until it returns an empty array.
...not for use in new websites.deprecated.
... not for use in new websites.
FileSystemDirectoryReader - Web APIs
because this is a non-standard api, whose specification is not currently on a standards track, it's important to keep in mind that not all browsers implement it, and those that do may implement only small portions of it.
...not for use in new websites.deprecated.
... not for use in new websites.uses a non-standard name.uses a non-standard name.requires a vendor prefix or different name for use.requires a vendor prefix or different name for use.
FileSystemEntry.getMetadata() - Web APIs
errors fileerror.not_found_err the filesystementry refers to an item which doesn't exist.
...not for use in new websites.deprecated.
... not for use in new websites.
FileSystemEntry.isDirectory - Web APIs
the read-only isdirectory property of the filesystementry interface is true if the entry represents a directory (meaning it's a filesystemdirectoryentry) and false if it's not.
... you should not assume that any entry which isn't a directory is a file or vice-versa.
... syntax var isdirectory = filesystementry.isdirectory; value a boolean indicating whether or not the filesystementry is a directory.
FileSystemEntry.isFile - Web APIs
the read-only isfile property of the filesystementry interface is true if the entry represents a file (meaning it's a filesystemfileentry) and false if it's not.
... you should not assume that any entry which isn't a file is a directory or vice-versa.
... syntax var isfile = filesystementry.isfile; value a boolean indicating whether or not the filesystementry is a file.
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.
... currently being applied to the trackpad/touchscreen constants these constants are useful for determining the relative intensity of the pressure indicated by mouseevent.webkitforce: mouseevent.webkit_force_at_mouse_down read only minimum force necessary for a normal click mouseevent.webkit_force_at_force_mouse_down read only minimum force necessary for a force click specifications not part of any specification.
FormData() - Web APIs
WebAPIFormDataFormData
note: this feature is available in web workers.
... <label for="username">enter name:</label> <input type="text" id="username" name="username"> </div> <div> <label for="useracc">enter account number:</label> <input type="text" id="useracc" name="useracc"> </div> <div> <label for="userfile">upload file:</label> <input type="file" id="userfile" name="userfile"> </div> <input type="submit" value="submit!"> </form> note: only successful form controls are included in a formdata object, i.e.
... those with a name, not disabled and checked (radio buttons and checkboxes) or selected (one or more options within a select).
FormData.append() - Web APIs
WebAPIFormDataappend
the append() method of the formdata interface appends a new value onto an existing key inside a formdata object, or adds the key if it does not already exist.
... note: this method is available in web workers.
... note: if you specify a blob as the data to append to the formdata object, the filename that will be reported to the server in the "content-disposition" header used to vary from browser to browser.
FormData.set() - Web APIs
WebAPIFormDataset
the set() method of the formdata interface sets a new value for an existing key inside a formdata object, or adds the key/value if it does not already exist.
... note: this method is available in web workers.
... note: if you specify a blob as the data to append to the formdata object, the filename that will be reported to the server in the "content-disposition" header used to vary from browser to browser.
FormData - Web APIs
WebAPIFormData
note: this feature is available in web workers.
... methods formdata.append() appends a new value onto an existing key inside a formdata object, or adds the key if it does not already exist.
... formdata.set() sets a new value for an existing key inside a formdata object, or adds the key/value if it does not already exist.
Gamepad.buttons - Web APIs
WebAPIGamepadbuttons
each entry in the array is 0 if the button is not pressed, and non-zero (typically 1.0) if the button is pressed.
...the values are normalized to the range 0.0 – 1.0, with 0.0 representing a button that is not pressed, and 1.0 representing a button that is fully pressed.
... syntax readonly attribute gamepadbutton[] buttons; example the following code is taken from my gamepad api button demo (you can view the demo live, and find the source code on github.) note the code fork — in chrome navigator.getgamepads needs a webkit prefix and the button values are stores as an array of double values, whereas in firefox navigator.getgamepads doesn't need a prefix, and the button values are stored as an array of gamepadbutton objects; it is the gamepadbutton.value or gamepadbutton.pressed properties of these we need to access, depending on what type of buttons they are.
GamepadButton - Web APIs
note: this is the case in firefox gecko 28 and later; chrome and earlier firefox versions still return an array of double values when this property is accessed.
...the values are normalized to the range 0.0 —1.0, with 0.0 representing a button that is not pressed, and 1.0 representing a button that is fully pressed.
... example the following code is taken from my gamepad api button demo (you can view the demo live, and find the source code on github.) note the code fork — in chrome navigator.getgamepads needs a webkit prefix and the button values are stored as an array of double values, whereas in firefox navigator.getgamepads doesn't need a prefix, and the button values are stored as an array of gamepadbutton objects; it is the gamepadbutton.value or gamepadbutton.pressed properties of these we need to access, depending on what type of buttons they are.
GlobalEventHandlers.ontouchcancel - Web APIs
note: this attribute has not been formally standardized.
... it is specified in the touch events – level 2 draft specification and not in touch events recommendation.
... this attribute is not widely implemented.
GlobalEventHandlers.ontouchend - Web APIs
note: this attribute has not been formally standardized.
... it is specified in the touch events – level 2 draft specification and not in touch events recommendation.
... this attribute is not widely implemented.
GlobalEventHandlers.ontouchmove - Web APIs
note: this attribute has not been formally standardized.
... it is specified in the touch events – level 2 draft specification and not in touch events recommendation.
... this attribute is not widely implemented.
GlobalEventHandlers.ontouchstart - Web APIs
note: this attribute has not been formally standardized.
... it is specified in the touch events – level 2 draft specification and not in touch events recommendation.
... this attribute is not widely implemented.
GlobalEventHandlers.ontransitioncancel - Web APIs
note: elapsedtime does not include time prior to the transition effect beginning; that means that the value of transition-delay doesn't affect the value of elapsedtime, which is zero until the delay period ends and the animation begins.
...tionend = function(event) { box.innerhtml = "done!"; } box.onclick = function() { box.style.display = 'none'; timeout = window.settimeout(appear, 2000); function appear() { box.style.display = 'block'; } } box.ontransitioncancel = function(event) { console.log('transitioncancel fired after ' + event.elapsedtime + ' seconds.'); } result the resulting content looks like this: notice what happens when you hover your mouse cursor over the box, then move it away.
... also note the log that appears in the javascript console when you click the box, or move the cursor away before the transition has run to completion.
GlobalEventHandlers.ontransitionend - Web APIs
another is if the display attribute is set to none.
... elapsedtime does not include time prior to the transition effect beginning; that means that the value of transition-delay doesn't affect the value of elapsedtime, which is zero until the delay period ends and the animation begins.
... let box = document.queryselector(".box"); box.ontransitionrun = function(event) { box.innerhtml = "zooming..."; } box.ontransitionend = function(event) { box.innerhtml = "done!"; } result the resulting content looks like this: notice what happens when you hover your mouse cursor over the box, then move it away.
HTMLAnchorElement.download - Web APIs
if the name is not a valid file name in the underlying os, the browser will adjust it.
... note: this value might not be used for download.
... this value cannot be used to determine whether the download will occur.
HTMLAnchorElement.referrerPolicy - Web APIs
syntax refstr = anchorelt.referrerpolicy; anchorelt.referrerpolicy = refstr; values "no-referrer" meaning that the referer: http header will not be sent.
... "unsafe-url" meaning that the referrer will include the origin and the path (but not the fragment, password, or username).
... examples var elt = document.createelement("a"); var linktext = document.createtextnode("my link"); elt.appendchild(linktext); elt.href = "https://developer.mozilla.org/"; elt.referrerpolicy = "no-referrer"; var div = document.getelementbyid("divaround"); div.appendchild(elt); // when clicked, the link will not send a referrer header.
HTMLAreaElement.referrerPolicy - Web APIs
syntax refstr = areaelt.referrerpolicy; areaelt.referrerpolicy = refstr; values "no-referrer" meaning that the referer: http header will not be sent.
... "unsafe-url" meaning that the referrer will include the origin and the path (but not the fragment, password, or username).
... examples <img usemap="#maparound" width="100" height="100" src="/img/logo@2x.png" /> <map id="mymap" name="maparound" />> var elt = document.createelement("area"); elt.href = "/img2.png"; elt.shape = "rect"; elt.referrerpolicy = "no-referrer"; elt.coords = "0,0,100,100"; var map = document.getelementbyid("mymap"); map.appendchild(elt); // when clicked, the area's link will not send a referrer header.
HTMLCanvasElement.captureStream() - Web APIs
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.
... exceptions notsupportederror the value of framerate is negative.
...send it to another computer using an rtcpeerconnection // pc is an rtcpeerconnection created elsewhere pc.addstream(stream); specifications specification status comment media capture from dom elementsthe definition of 'htmlcanvaselement.capturestream()' in that specification.
HTMLCanvasElement.mozOpaque - Web APIs
it lets the canvas know whether or not translucency will be a factor.
...for example, you could conditionally set it to true if mimetype == 'image/jpeg', or similar, to gain performance in your application when translucency is not needed.
... var canvas = document.getelementbyid('canvas'); console.log(canvas.mozopaque); // true // deactivate it canvas.mozopaque = false; specifications not part of any standard.
HTMLElement.lang - Web APIs
WebAPIHTMLElementlang
note that this attribute, though valid at the individual element level described here, is most often specified for the root element of the document.
... this also only works with the lang attribute and not with xml:lang.
... example // this snippet compares the base language and // redirects to another url based on language if (document.documentelement.lang === "en") { window.location.href = "some_document.html.en"; } else if (document.documentelement.lang === "ru") { window.location.href = "some_document.html.ru"; } specification specification status comment document object model (dom) level 2 html specificationthe definition of 'lang' in that specification...
HTMLElement: transitionend event - Web APIs
in the case where a transition is removed before completion, such as if the transition-property is removed or display is set to none, then the event will not be generated.
... if the transitioncancel event is fired, the transitionend event will not fire.
... if the transitioncancel event is fired, the transitionend event will not fire.
HTMLFormElement.requestSubmit() - Web APIs
exceptions typeerror the specified submitter is not a submit button.
... notfounderror the specified submitter isn't a member of the form on which requestsubmit() was called.
... usage notes the obvious question is: why does this method exist, when we've had the submit() method since the dawn of time?
HTMLFormElement: submit event - Web APIs
bubbles yes (although specified as a simple event that doesn't bubble) cancelable yes interface submitevent event handler property globaleventhandlers.onsubmit note that the submit event fires on the <form> element itself, and not on any <button> or <input type="submit"> inside it.
...the event is not sent to the form when calling the form.submit() method directly.
... note: trying to submit a form that does not pass validation triggers an invalid event.
HTMLHyperlinkElementUtils - Web APIs
properties note: this interface doesn't inherit any property.
... htmlhyperlinkelementutils.host this is a usvstring containing the host, that is the hostname, and then, if the port of the url is not empty (which can happen because it was not specified or because it was specified to be the default port of the url's scheme), a ':', and the port of the url.
... methods note: this interface doesn't inherit any method.
HTMLImageElement.border - Web APIs
you should not use this property!
...the border property or its longhand properties to not only set the thickness of the border but to potentially apply a wide variety of other styling options to it.
...the default value of border is 0 usage notes do not use border.
HTMLImageElement.loading - Web APIs
usage notes timing of the load event the load event is fired when the document has been fully processed.
... images whose loading attribute is set to lazy but are located within the visual viewport immediately upon initial page load are loaded as soon as the layout is known, but their loads do not delay the firing of the load event.
... that means that when load fires, it's possible that any lazy-loaded images located in the visual viewport may not yet be visible.
HTMLImageElement.naturalHeight - Web APIs
this is the height the image is if drawn with nothing constraining its height; if you don't specify a height for the image, or place the image inside a container that either limits or expressly specifies the image height, it will be rendered this tall.
... if the intrinsic height is not available—either because the image does not specify an intrinsic height or because the image data is not available in order to obtain this information, naturalheight returns 0.
... css .box { width: 200px; height: 200px; } .image { width: 100%; } .output { padding-top: 2em; } the main thing of note in the css above is that the style used for the container the image will be drawn in is 200px wide, and the image will be drawn to fill its width (100%).
HTMLImageElement.naturalWidth - Web APIs
this is the width the image is if drawn with nothing constraining its width; if you neither specify a width for the image nor place the image inside a container that limits or expressly specifies the image width, this is the number of css pixels wide the image will be.
... if the intrinsic width is not available—either because the image does not specify an intrinsic width or because the image data is not available in order to obtain this information, naturalwidth returns 0.
... css .box { width: 200px; height: 200px; } .image { width: 100%; } .output { padding-top: 2em; } the main thing of note in the css above is that the style used for the container the image will be drawn in is 200px wide, and the image will be drawn to fill its width (100%).
HTMLImageElement.srcset - Web APIs
if the condition descriptor is not provided (in other words, the image candidate provides only a url), the candidate is used as the fallback if none of the other candidates match.
...you must not, however, provide multiple image candidate strings that specify the same descriptor.
...notice that the candidates may use different image types.
HTMLLinkElement - Web APIs
the htmllinkelement interface represents reference information for external resources and the relationship of those resources to a document and vice-versa (corresponds to <link> element; not to be confused with <a>, which is represented by htmlanchorelement).
... note: currently the w3c html 5.2 spec states that rev is no longer obsolete, whereas the whatwg living standard still has it labeled obsolete.
...note that currently firefox only supports preloading of cacheable resources.
HTMLMediaElement.autoplay - Web APIs
note: sites which automatically play audio (or videos with an audio track) can be an unpleasant experience for users, so it should be avoided when possible.
... note: some browsers offer users the ability to override autoplay in order to prevent disruptive audio or video from playing without permission or in the background.
... do not rely on autoplay actually starting playback and instead use play event.
msClearEffects - 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.
... return value this method does not return a value.
HTMLMediaElement.msInsertAudioEffect() - 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.
... return value this method does not return a value.
HTMLMediaElement.seekToNextFrame() - Web APIs
you should not use this method in production code, because its implementation may change—or be removed outright—without notice.
... if there is no video on the media element, or the media isn't seekable, nothing happens.
... specifications not part of any specification.
HTMLMediaElement.srcObject - Web APIs
note: as of march 2020, only safari supports setting objects other than mediastream.
... usage notes older versions of the media source specification required using createobjecturl() to create an object url then setting src to that url.
... 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 ...
HTMLScriptElement.referrerPolicy - Web APIs
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.
...if a higher-level policy is not available, the empty string is treated as being equivalent to no-referrer-when-downgrade.
HTMLSelectElement.add() - Web APIs
if this parameter is null (or the index does not exist), the new element is appended to the end of the collection.
...it throws a domerror of the type hierarchyrequesterror if the passed item is an ancestor of the htmlselectelement and no longer throws if the before parameter is not found.
... obsolete the method now throws an not_found_err exception if the item of the before parameter is not a child of this element.
HTMLTableRowElement.insertCell() - Web APIs
note: insertcell() inserts the cell directly into the row.
... the cell does not need to be appended separately with node.appendchild() as would be the case if document.createelement() had been used to create the new <td> element.
... you can not use insertcell() to create a new <th> element though.
HTMLTableSectionElement - Web APIs
this property was optional and was not very well supported.
...this property was optional and was not very well supported.
...if the given position is not given or is -1, it appends the row to the end of section.
HTMLVideoElement.msFrameStep() - 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.
... return value this method does not return a value.
HTMLVideoElement.msInsertVideoEffect() - 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.
... return value this method does not return a value.
HTMLVideoElement.msIsLayoutOptimalForPlayback - 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.
... you can listen to the onmsvideooptimallayoutchanged event to be notified when the msislayoutoptimalforplayback property changes.
msSetVideoRectangle - 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.
... return value this method does not return a value.
HTMLVideoElement.msZoom - 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.
... if the native aspect ratio of a video frame, which is defined by the videowidth and videoheight attributes, does not match the aspect ratio of the video tag, which is defined by the width and height attributes, the video is rendered with letterbox or pillarbox format.
HTMLVideoElement.videoHeight - Web APIs
if the element's readystate is htmlmediaelement.have_nothing, then the value of this property is 0, because neither video nor poster frame size information is yet available.
... if at any time the intrinsic size of the media changes and the element's readystate isn't have_nothing, a resize event will be sent to the <video> element.
... let v = document.getelementbyid("myvideo"); v.addeventlistener("resize", ev => { let w = v.videowidth; let h = v.videoheight; if (w && h) { v.style.width = w; v.style.height = h; } }, false); note that this only applies the change if both the videowidth and the videoheight are non-zero.
HTMLVideoElement.videoWidth - Web APIs
if the element's readystate is htmlmediaelement.have_nothing, then the value of this property is 0, because neither video nor poster frame size information is yet available.
... if at any time the intrinsic size of the media changes and the element's readystate isn't have_nothing, a resize event will be sent to the <video> element.
... let v = document.getelementbyid("myvideo"); v.addeventlistener("resize", ev => { let w = v.videowidth; let h = v.videoheight; if (w && h) { v.style.width = w; v.style.height = h; } }, false); note that this only applies the change if both the videowidth and the videoheight are non-zero.
Headers.get() - Web APIs
WebAPIHeadersget
if the given name is not the name of an http header, this method throws a typeerror.
... returns a bytestring sequence representing the values of the retrieved header or null if this header is not set.
... example creating an empty headers object is simple: var myheaders = new headers(); // currently empty myheaders.get('not-set'); // returns null you could add a header to this using headers.append, then retrieve it using get(): myheaders.append('content-type', 'image/jpeg'); myheaders.get('content-type'); // returns "image/jpeg" if the header has multiple values associated with it, the byte string will contain all the values, in the order they were added to the headers object: myheaders.append('accept-encoding', 'deflate'); myheaders.append('accept-encoding', 'gzip'); myheaders.get('accept-encoding'); // returns "deflate,gzip" note: headers.getall used to have this functionality, with headers.get returning only the first value added to the headers object.
IDBCursor.advance() - Web APIs
WebAPIIDBCursoradvance
note: this feature is available in web workers.
...advance() works in a similar way to idbcursor.continue, except that it allows you to jump multiple records at a time, not just always go onto the next record.
... note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo.
IDBCursor.continuePrimaryKey() - Web APIs
note: this feature is available in web workers.
... dataerror the key parameter may have any of the following conditions: the key is not a valid key.
... invalidaccesserror the cursor's direction is not prev or next.
IDBCursor.delete() - Web APIs
WebAPIIDBCursordelete
note: this feature is available in web workers.
... the cursor does not require us to select the data based on a key; we can just grab all of it.
... also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo.
IDBCursor.key - Web APIs
WebAPIIDBCursorkey
note: this feature is available in web workers.
... the cursor does not require us to select the data based on a key; we can just grab all of it.
... also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo.
IDBCursor.primaryKey - Web APIs
note: this feature is available in web workers.
...within each iteration we log the primary key of the cursor to the console, something like this (its the album title in each case, which is our primarykey): hemispheres the cursor does not require us to select the data based on a key; we can just grab all of it.
... also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo.
IDBCursorWithValue.value - Web APIs
note: this feature is available in web workers.
... the cursor does not require us to select the data based on a key; we can just grab all of it.
... also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo.
IDBCursorWithValue - Web APIs
note: this feature is available in web workers.
...the cursor does not require us to select the data based on a key; we can just grab all of it.
... also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo.
IDBDatabase.close() - Web APIs
WebAPIIDBDatabaseclose
the connection is not actually closed until all transactions created using this connection are complete.
... note: this feature is available in web workers.
... // create event handlers for both success and failure of dbopenrequest.onerror = function(event) { note.innerhtml += "<li>error loading database.</li>"; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += "<li>database initialised.</li>"; // store the result of opening the database in the db variable.
IDBDatabase.deleteObjectStore() - Web APIs
note: this feature is available in web workers.
... exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction callback.
...has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) notfounderror you are trying to delete an object store that does not exist.
IDBDatabase.name - Web APIs
WebAPIIDBDatabasename
note: this feature is available in web workers.
...for a full example, see our to-do notifications app (view example live).
... // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being // opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBDatabase.onabort - Web APIs
note: this feature is available in web workers.
... dbopenrequest.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function() { note.innerhtml += '<li>error opening database.</li>'; }; db.onabort = function() { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes",...
... { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); note.innerhtml += '<li>object store created.</li>'; }; specifications specification status comment indexed database api 2.0the definition of 'onabort' in that specification.
IDBDatabase.onclose - Web APIs
note: this feature is available in web workers.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonclosechrome full support 31notes full support 31notes notes approxedge full support ≤18firefox full support 50ie ?
... yessafari ios full support 10.3samsung internet android full support 2.0legend full support full support compatibility unknown compatibility unknownsee implementation notes.see implementation notes.
IDBEnvironment - Web APIs
note: this feature is available in web workers.
...not for use in new websites.deprecated.
... not for use in new websites.requires a vendor prefix or different name for use.requires a vendor prefix or different name for use.
IDBIndex.getKey() - Web APIs
WebAPIIDBIndexgetKey
note that this doesn't return the whole record as idbindex.get does.
... note: this feature is available in web workers.
...we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key.
IDBIndex.keyPath - Web APIs
WebAPIIDBIndexkeyPath
if null, this index is not auto-populated.
... note: this feature is available in web workers.
...we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key.
IDBIndex.locale - Web APIs
WebAPIIDBIndexlocale
the locale read-only property of the idbindex interface returns the locale of the index (for example en-us, or pl) if it had a locale value specified upon its creation (see createindex()'s optionalparameters.) note that this property always returns the current locale being used in this index, in other words, it never returns "auto".
...we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key.
... + '<td>' + cursor.value.company + '</td>' + '<td>' + cursor.value.email + '</td>' + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification not currently part of any specification.
IDBKeyRange.includes() - Web APIs
note: this feature is available in web workers.
... exceptions this method may raise a domexception of the following type: attribute description dataerror the supplied key was not a valid key.
...for browsers that do not support it, the following polyfill can be used.
IDBKeyRange.lower - Web APIs
WebAPIIDBKeyRangelower
note: this feature is available in web workers.
...here we declare keyrangevalue = idbkeyrange.upperbound("f", "w", true, true); — a range that includes everything between "f" and "w" but not including them — since both the upper and lower bounds have been declared as open (true).
... note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.lower); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor)...
IDBKeyRange.only() - Web APIs
WebAPIIDBKeyRangeonly
note: this feature is available in web workers.
... exceptions this method may raise a domexception of the following types: exception description dataerror the value parameter passed was not a valid key.
... note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.only("a"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { ...
IDBKeyRange.upper - Web APIs
WebAPIIDBKeyRangeupper
note: this feature is available in web workers.
...here we declare keyrangevalue = idbkeyrange.upperbound("f", "w", true, true); — a range that includes everything between "f" and "w" but not including them — since both the upper and lower bounds have been declared as open (true).
... note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.upper); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor)...
IDBKeyRange.upperBound() - Web APIs
note: this feature is available in web workers.
... exceptions this method may raise a domexception of the following type: exception description dataerror the value parameter passed was not a valid key.
... note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.upperbound("f"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = func...
IDBKeyRange - Web APIs
note: this feature is available in web workers.
...if we used idbkeyrange.bound("a", "f", true, true);, then the range would not include "a" and "f", only the values between them.
... note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("a", "f"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; } specifications specification sta...
IDBObjectStore.getAll() - Web APIs
that method provides a cursor if the record exists, and no cursor if it does not.
...if nothing is passed, this will default to a key range that selects all the records in this object store.
... a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included.
IDBObjectStore.index() - Web APIs
note: this feature is available in web workers.
... notfounderror there is no index with the given name (case-sensitive) in the database.
...we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key.
IDBRequest.onerror - Web APIs
note: this feature is available in web workers.
...for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result ...
...var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back // into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; objectstoretitlerequest.onerror = function() { // if an error occurs with the request, log what it is console.log("there has been an error with retrieving your data: " + objectstoretitlerequest.error); // todo what about event parameter into onerror()?
IDBRequest.onsuccess - Web APIs
note: this feature is available in web workers.
...for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlere...
...quest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item back // into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment indexed database api 2.0the definition of 'onsuccess' in that specification.
IDBRequest.readyState - Web APIs
note: this feature is available in web workers.
... example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request.
...for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // log the source of this reques...
IDBRequest.source - Web APIs
WebAPIIDBRequestsource
note: this feature is available in web workers.
... example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request.
...for a full working example, see our to-do notifications app (view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as its title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // log the source of this request c...
IDBVersionChangeRequest.setVersion() - Web APIs
some not up-to-date browsers still implement this method.
...not for use in new websites.deprecated.
... not for use in new websites.
IDBVersionChangeRequest - Web APIs
warning: the latest specification does not include this interface anymore as the idbdatabase.setversion() method has been removed.
...not for use in new websites.deprecated.
... not for use in new websites.requires a vendor prefix or different name for use.requires a vendor prefix or different name for use.
KeyboardEvent.code - Web APIs
be aware, however, that you can't use the value reported by keyboardevent.code to determine the character generated by the keystroke, because the keycode's name may not match the actual character that's printed on the key or that's generated by the computer when the key is pressed.
...that makes it impossible to use the value of code to determine what the name of the key is to users if they're not using an anticipated keyboard layout.
... window.addeventlistener("keydown", function(event) { if (event.defaultprevented) { return; // do nothing if event already handled } switch(event.code) { case "keys": case "arrowdown": // handle "back" updateposition(-moverate); break; case "keyw": case "arrowup": // handle "forward" updateposition(moverate); break; case "keya": case "arrowleft": // handle "turn left" angle -= turnrate; break; case "keyd": ...
KeyboardEvent.metaKey - Web APIs
the keyboardevent.metakey read-only property returning a boolean that indicates if the meta key was pressed (true) or not (false) when the event occurred.
... note: on macintosh keyboards, this is the ⌘ command key.
... at least as of firefox 48, the ⊞ windows key is not considered the "meta" key.
LockedFile.abort() - Web APIs
WebAPILockedFileabort
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.
... note: when an ongoing operation is canceled, there is no rollback (it is not a database transaction), therefore the file can be corrupted if the canceled operation was performing some writing.
LockedFile.active - Web APIs
WebAPILockedFileactive
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.
... the active property allows to know if the lockedfile object is still usable (true) or not (false).
LockedFile.readAsText() - 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.
...by default, utf-8 is assumed if this parameter is not specified.
LockedFile - 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.
... lockedfile.active read only a flag indicating if the file can be accessed (true) or not (false).
MSCandidateWindowHide - 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.
... 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.
MSCandidateWindowShow - 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.
... 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.
MSCandidateWindowUpdate - 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.
... 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.
MSGraphicsTrust - 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.
... inheritance hierarchy the msgraphicstrust does not inherit from any class or interface.
MediaCapabilitiesInfo - Web APIs
'' : 'not ') + 'supported, ' + // can the media, as configured, be decoded by the user agent (result.smooth ?
... '' : 'not ') + 'smooth, and ' + // is it smooth?
...'' : 'not ') + 'power efficient.') // is it power efficient?
MediaDeviceInfo.kind - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetkindchrome full support 55notes full support 55notes notes for earlier versions, this interface is available through the 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 support nowebview android full support 55notes full support 55notes notes for earlier versions, this interface is available through the adapter.js polyfillchrome android full support 55notes full support 55notes notes for earlier versions, this interface is available through the adapter.js polyfillfirefox android full support 39opera android n...
...o support nonotes no support nonotes notes this property can be used in opera by using the adapter.js polyfill.safari ios no support nosamsung internet android full support 6.0notes full support 6.0notes notes for earlier versions, this interface is available through the adapter.js polyfilllegend full support full support no support no supportsee implementation notes.see implementation notes.
MediaError.message - Web APIs
this is not simply a generic description of the mediaerror.code property's value, but instead goes deeper into the specifics of this particular error and its circumstances.
...r; 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 med...
... the error's code attribute is checked to determine a generic error message to display, and, if message is not empty, it's appended to provide additional details.
MediaRecorder.pause() - Web APIs
if not, continue to the next step.
... exceptions invalidstateerror the mediarecorder is currently "inactive"; you can't pause recording if it's not active.
... if you call pause() while already paused, it silently does nothing.
MediaRecorder.start() - Web APIs
note: if the browser is unable to start recording or continue recording, it will raise a domerror event, followed by a mediarecorder.dataavailable event containing the blob it has gathered, followed by the mediarecorder.stop event.
... invalidstateerror the mediarecorder is not in the inactive state; you can't start recording media if it's already being recorded.
... 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.
Media Session action types - Web APIs
this action may or may not be available, depending on the platform and user agent, or may be disabled due to subscription level or other circumstances.
... let skiptime = 10; // time to skip in seconds navigator.mediasession.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.isTypeSupported() - Web APIs
if the returned value is false, then the user agent is certain that it cannot access media of the specified format.
...this is not a guarantee, however, and your code must be prepared for the possibility that the media will not play correctly if at all.
... a value of false is a guarantee that media of the given type will not play, however.
MediaStreamConstraints - Web APIs
properties some combination—but not necessarily all—of the following properties will exist on the object.
... track constraints audio either a boolean (which indicates whether or not an audio track is requested) or a mediatrackconstraints object providing the constraints which must be met by the audio track included in the returned mediastream.
... video either a boolean (which indicates whether or not a video track is requested) or a mediatrackconstraints object providing the constraints which must be met by the video track included in the returned mediastream.
MediaStreamTrack: unmute event - Web APIs
the unmute event is sent to a mediastreamtrack when the track's source is once again able to provide media data after a period of not being able to do so.
... bubbles no cancelable no interface event event handler property onunmute note: the condition that most people think of as "muted" (that is, a user-controllable way to silence a track) is actually managed using the mediastreamtrack.enabled property, for which there are no events.
... examples in this example, event handlers are established for the mute and unmute events in order to detect when the media is not flowing from the source for the mediastreamtrack stored in the variable musictrack.
MediaStreamTrackAudioSourceNode() - Web APIs
another way to create a mediastreamtrackaudiosourcenode is to call theaudiocontext.createmediastreamtracksource() method, specifying the mediastreamtrack from which you want to obtain audio.
... exceptions notsupportederror the specified context is not an audiocontext.
...true, video: false }).then(function(stream) { let options = { mediastreamtrack: stream.getaudiotracks()[0]; } let source = new mediastreamtrackaudiosourcenode(audioctx, options); source.connect(audioctx.destination); }).catch(function(err) { console.log('the following gum error occured: ' + err); }); } else { console.log('new getusermedia not supported on your browser!'); } specifications specification status comment web audio apithe definition of 'mediastreamtrackaudiosourcenode()' in that specification.
MediaStream Image Capture API - Web APIs
in addition to capturing data, it also allows you to retrieve information about device capabilities such as image size, red-eye reduction and whether or not there is a flash and what they are currently set to.
... let zoom = document.queryselector('#zoom'); const capabilities = track.getcapabilities(); // check whether zoom is supported or not.
...though a mediastream holds several types of tracks and provides multiple methods for retrieving them, the imagecapture constructor will throw a domexception of type notsupportederror if mediastreamtrack.kind is not "video".
MediaTrackSupportedConstraints.frameRate - Web APIs
if the constraint isn't supported, it's not included in the list, so this value will never be false.
... javascript let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().framerate) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } html <div id="result"> </div> css #result { font: 14px "arial", sans-serif; } result the output, showing if your browser supports the framerate constraint, is: while this example is trivial, you can replace the simple output of "supported" vs.
... "not supported" with code to provide alternative methods for presenting the audiovisual information you want to share with the user or otherwise work with.
Media Source API - Web APIs
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 <source> tags may well be a simple and adequate solution.
... live profile content can introduce latency due to its transcoding and broadcasting, so dash is not suitable for real time communication like webrtc is.
... trackdefault provides a sourcebuffer with kind, label, and language information for tracks that do not contain this information in the initialization segments of a media chunk.
MerchantValidationEvent() - Web APIs
you should not have to create these events yourself; instead, just handle the merchantvalidation event.
... 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.
MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN - 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.
... specifications not part of any specification.
MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN - 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.
... specifications not part of any specification.
MouseEvent.altKey - Web APIs
WebAPIMouseEventaltKey
the mouseevent.altkey read-only property is a boolean that indicates whether the alt key was pressed or not when a given mouse event occurs.
... note: on macintosh keyboards, this key is also known as the option key.
... syntax var altkeypressed = instanceofmouseevent.altkey return value a boolean, where true indicates that the key is pressed, and false indicates that the key is not pressed.
MouseEvent.ctrlKey - Web APIs
the mouseevent.ctrlkey read-only property is a boolean that indicates whether the ctrl key was pressed or not when a given mouse event occurs.
... note: on macintosh keyboards, this key is the control key.
... syntax var ctrlkeypressed = instanceofmouseevent.ctrlkey return value a boolean, where true indicates that the key is pressed, and false indicates that the key is not pressed.
MouseEvent.metaKey - Web APIs
the mouseevent.metakey read-only property is a boolean that indicates whether the meta key was pressed or not when a given mouse event occurs.
... note: on macintosh keyboards, this key is the command key (⌘).
... syntax var metakeypressed = instanceofmouseevent.metakey return value a boolean, where true indicates that the key is pressed, and false indicates that the key is not pressed.
MouseEvent.mozInputSource - 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.
... specifications not part of any specification.
MouseEvent.webkitForce - 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.
... specifications not part of any specification.
msPlayToSource - 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.
... msplaytosource is used in the sourcerequested handler -- get the playtosource object from an audio, video, or img element using the msplaytosource property and pass it to e.setsource, then set the playtosource.next property to the msplaytosource of another element for continual playing.
msSetMediaProtectionManager - 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.
... return value this method does not return a value.
MutationObserver - Web APIs
methods disconnect() stops the mutationobserver instance from receiving further notifications until and unless observe() is called again.
... observe() configures the mutationobserver to begin receiving notifications through its callback function when dom changes matching the given options occur.
... takerecords() removes all pending notifications from the mutationobserver's notification queue and returns them in a new array of mutationrecord objects.
MutationObserverInit.characterDataOldValue - Web APIs
the mutationobserverinit dictionary's optional characterdataoldvalue property is used to specify whether or not the mutationrecord.oldvalue property for dom mutations should be set to the previous value of text nodes which changed.
... if you set the mutationobserverinit.characterdata property to true but don't set characterdataoldvalue to true as well, the mutationrecord will not include information describing the prior state of the text node's contents.
... syntax var options = { characterdataoldvalue: true | false } value a boolean value indicating whether or not to set the mutationrecord's oldvalue property to be a string containing the value of the character node's contents prior to the change represented by the mutation record.
MutationObserverInit.childList - Web APIs
the mutationobserverinit dictionary's optional childlist property indicates whether or not to monitor the specified node or nodes for the addition or removal of new child nodes.
... if childlist is false (the default), adding or removing new nodes does not trigger mutation callbacks.
... syntax var options = { childlist: true | false } value a boolean value indicating whether or not to invoke the callback function when new nodes are added to or removed from the section of the dom being monitored..
NDEFReader - Web APIs
ndefreader.onreading an event handler for reading event, that notifies about availability of a new reading.
... ndefreader.onerror an event handler for error event which is called to notify that an error occured during reading.
... ndefreader.scan() called to activate the reader (after ensuring hardware and ua compatibility and obtaining permission from the user) or get an error explaining why feature is not available.
Navigator.getUserMedia() - Web APIs
while technically not deprecated, this old callback version is marked as such, since the specification strongly encourages using the newer promise returning version.
...note that this is the deprecated way of doing it: see the examples section under the mediadevices.getusermedia() for modern examples.
...udio: 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.mediaCapabilities - Web APIs
'' : 'not ') + 'supported, ' + (result.smooth ?
... '' : 'not ') + 'smooth, and ' + (result.powerefficient ?
... '' : 'not ') + 'power efficient.') }); specifications specification status comment media capabilities draft initial definition ...
Navigator.registerContentHandler() - Web APIs
note: web sites may only register content handlers for themselves.
... for security reasons, it's not possible for an extension or web site to register content handlers targeting other sites.
... 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.
NavigatorID.appVersion - Web APIs
note: do not rely on this property to return the correct browser version.
... example alert('your browser version is reported as ' + navigator.appversion); notes the window.navigator.useragent property may also contain the version number (for example "mozilla/5.0 (windows; u; win98; en-us; rv:0.9.2) gecko/20010725 netscape 6/6.1"), but you should be aware of how easy it is to change the user agent string and "spoof" other browsers, platforms, or user agents, and also how cavalier the browser vendor themselves are with these properties.
...this lead to the current situation, where browsers had to return fake values from these properties in order not to be locked out of some websites.
NavigatorID - Web APIs
do not rely on this property to return a useful value.
...do not rely on this property to return a useful value.
...not available in workers.
NetworkInformation - Web APIs
the networkinformation interface provides information about the connection a device is using to communicate with the network and provides a means for scripts to be notified if the connection type changes.
... the networkinformation interfaces cannot be instantiated.
... note: this feature is available in web workers.
Node.localName - Web APIs
WebAPINodelocalName
syntax name = element.localname name is the local name as a string (see notes below for details) example (must be served with xml content type, such as text/xml or application/xhtml+xml.) <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> <head> <script type="application/javascript"><![cdata[ function test() { var text = document.getelementbyid('text'); var circle = document.getelementbyid('circle'); text.value = "<svg:circle> has:\n" + "localname = '" + circle.localname + "'\n" + "namespaceuri = '" + circle.name...
...spaceuri + "'"; } ]]></script> </head> <body onload="test()"> <svg:svg version="1.1" width="100px" height="100px" viewbox="0 0 100 100"> <svg:circle cx="50" cy="50" r="30" style="fill:#aaa" id="circle"/> </svg:svg> <textarea id="text" rows="4" cols="55"/> </body> </html> notes the local name of a node is that part of the node's qualified name that comes after the colon.
...for example, in the qualified name ecomm:partners, partners is the local name and ecomm is the prefix: <ecomm:business id="soda_shop" type="brick_n_mortar" xmlns:ecomm="http://example.com/ecomm"> <ecomm:partners> <ecomm:partner id="1001">tony's syrup warehouse </ecomm:partner> </ecomm:partners> </ecomm:business> note: in gecko 1.9.2 and earlier, the property returns the upper-cased version of the local name for html elements in html doms (as opposed to xhtml elements in xml doms).
Node.nodePrincipal - Web APIs
note: this property exists on all nodes (html, svg, mathml, xul, etc.), but only if the script trying to use it has chrome privileges.
... notes this property is read-only; attempting to write to it will throw an exception.
... specifications not in any specification.
Node.textContent - Web APIs
WebAPINodetextContent
note: textcontent and htmlelement.innertext are easily confused, but the two properties are different in important ways.
... note: to get all of the text and cdata data for the whole document, one could use document.documentelement.textcontent.
...sometimes people use innerhtml to retrieve or write text inside an element, but textcontent has better performance because its value is not parsed as html.
NodeFilter.acceptNode() - Web APIs
the nodefilter.acceptnode() method returns an unsigned short that will be used to tell if a given node must be accepted or not by the nodeiterator or treewalker iteration algorithm.
...the children of rejected nodes are not visited by the nodeiterator or treewalker object; this value is treated as "skip this node and all its children".
...this is treated as "skip this node but not its children".
OVR_multiview2.framebufferTextureMultiviewOVR() - Web APIs
exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer.
... attachment is not one of the accepted attachment points.
... a gl.invalid_value error is thrown if level is not 0.
OfflineAudioContext.resume() - Web APIs
the promise resolves immediately because the offlineaudiocontext does not require the audio hardware.
... if the context is not currently suspended or the rendering has not started, the promise is rejected with invalidstateerror.
... invalidstateerror if the context is not currently suspended or the rendering has not started.
OfflineAudioContext.startRendering() - Web APIs
at this point we create another audio context, create an audiobuffersourcenode inside it, and set its buffer to be equal to the promise audiobuffer.
... note: for a working example, see our offline-audio-context-promise github repo (see the source code too.) // define online and offline audio context var audioctx = new audiocontext(); var offlinectx = new offlineaudiocontext(2,44100*40,44100); source = offlinectx.createbuffersource(); // use xhr to load an audio track, and // decodeaudiodata to decode it and offlineaudiocontext to render it function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; sourc...
...ted successfully'); var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var song = audioctx.createbuffersource(); song.buffer = renderedbuffer; song.connect(audioctx.destination); play.onclick = function() { song.start(); } }).catch(function(err) { console.log('rendering failed: ' + err); // note: the promise should reject when startrendering is called a second time on an offlineaudiocontext }); }); } request.send(); } // run getdata to start the process off getdata(); specifications specification status comment web audio apithe definition of 'startrendering()' in that specification.
OrientationSensor - Web APIs
this interface cannot be used directly.
...this is not something that would ever be shown to a user.
... model.quaternion.fromarray(sensor.quaternion).inverse(); }); sensor.addeventlistener('error', error => { if (event.error.name == 'notreadableerror') { console.log("sensor is not available."); } }); sensor.start(); permissions example using orientation sensors requires requsting permissions for multiple device sensors.
PannerNode.PannerNode() - Web APIs
the default is 1, and negative values are not allowed.
...the default is 10000, and non-positive values are not allowed.
...the default is 1, and negative values are not allowed.
PannerNode.distanceModel - Web APIs
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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
PannerNode.panningModel - Web APIs
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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
PannerNode.rolloffFactor - Web APIs
syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.rollofffactor = 1; value a number whose range depends on the distancemodel of the panner as follows (negative values are not allowed): "linear" the range is 0 to 1.
... example this example demonstrates how different rollofffactor values affect how the volume of the test tone decreases with increasing distance from the listener: const context = new audiocontext(); // all our test tones will last this many seconds const note_length = 4; // this is how far we'll move the sound const z_distance = 20; // this function creates a graph for the test tone with a given rollofffactor // and schedules it to move away from the listener along the z (depth-wise) axis // at the given start time, resulting in a decrease in volume (decay) const scheduletesttone = (rollofffactor, starttime) => { const osc = new oscillatornode(con...
...text); const panner = new pannernode(context); panner.rollofffactor = rollofffactor; // set the initial z position, then schedule the ramp panner.positionz.setvalueattime(0, starttime); panner.positionz.linearramptovalueattime(z_distance, starttime + note_length); osc.connect(panner) .connect(context.destination); osc.start(starttime); osc.stop(starttime + note_length); }; // this tone should decay fairly quickly scheduletesttone(1, context.currenttime); // this tone should decay slower than the previous one scheduletesttone(0.5, context.currenttime + note_length); // this tone should decay only slightly scheduletesttone(0.1, context.currenttime + note_length * 2); after running this code, the resulting waveforms should look something like this: specifications ...
PannerNode.setOrientation() - Web APIs
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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
PannerNode.setPosition() - Web APIs
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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
PannerNode.setVelocity() - Web APIs
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.
... the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.currenttime); panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
ParentNode.append() - Web APIs
WebAPIParentNodeappend
exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy.
...ding text let parent = document.createelement("div") parent.append("some text") console.log(parent.textcontent) // "some text" appending an element and text let parent = document.createelement("div") let p = document.createelement("p") parent.append("some text", p) console.log(parent.childnodes) // nodelist [ #text "some text", <p> ] parentnode.append() is unscopable the append() method is not scoped into the with statement.
... let parent = document.createelement("div") with(parent) { append("foo") } // referenceerror: append is not defined polyfill you can polyfill the append() method in internet explorer 9 and higher with the following code: // source: https://github.com/jserz/js_piece/blob/master/dom/parentnode/append()/append().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('append')) { return; } object.defineproperty(item, 'append', { configurable: true, enumerable: true, writable: true, value: function append() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var is...
ParentNode.prepend() - Web APIs
exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy.
...v"); parent.append("some text"); parent.prepend("headline: "); console.log(parent.textcontent); // "headline: some text" appending an element and text var parent = document.createelement("div"); var p = document.createelement("p"); parent.prepend("some text", p); console.log(parent.childnodes); // nodelist [ #text "some text", <p> ] parentnode.prepend() is unscopable the prepend() method is not scoped into the with statement.
... var parent = document.createelement("div"); with(parent) { prepend("foo"); } // referenceerror: prepend is not defined polyfill you can polyfill the prepend() method if it's not available: // source: https://github.com/jserz/js_piece/blob/master/dom/parentnode/prepend()/prepend().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('prepend')) { return; } object.defineproperty(item, 'prepend', { configurable: true, enumerable: true, writable: true, value: function prepend() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof ...
PasswordCredential - Web APIs
note: this interface is restricted to top-level contexts and cannot be used from an <iframe>.
...not for use in new websites.deprecated.
... not for use in new websites.
PaymentAddress.toJSON() - Web APIs
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.
...to change preferences in chrome, visit chrome://flags.firefox android full support 62notes disabled full support 62notes disabled notes available only in nightly builds.
...rt nosafari ios full support yessamsung internet android no support nolegend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentRequest.PaymentRequest() - Web APIs
if a value is not supplied, the browser will construct one.
...if this sequence is blank, it indicates the merchant cannot ship to the current shipping address.
...for example, in english speaking countries you would say "pizza delivery" not "pizza shipping".
PaymentRequest.abort() - Web APIs
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).
...no support noopera no support nosafari full support 11.1webview android no support nochrome android full support 53firefox android 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).
...android no support nosafari ios full support 11.3samsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentRequest.prototype.id - Web APIs
WebAPIPaymentRequestid
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetidchrome full support 61edge full support 16firefox 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).
...no support noopera no support nosafari full support 11.1webview android no support nochrome android full support 60firefox android 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).
... nosafari ios full support 11.3samsung internet android full support 8.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentRequest.onshippingaddresschange - Web APIs
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).
...no support noopera no support nosafari full support 11.1webview android no support nochrome android full support 53firefox android 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).
...android no support nosafari ios full support 11.3samsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentRequest.onshippingoptionchange - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonshippingoptionchangechrome 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).
...no support noopera no support nosafari full support 11.1webview android no support nochrome android full support 53firefox android 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).
...android no support nosafari ios full support 11.3samsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentRequest.shippingOption - Web APIs
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).
...no support noopera no support nosafari full support 11.1webview android no support nochrome android full support 53firefox android 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).
...android no support nosafari ios full support 11.3samsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentResponse.details - Web APIs
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 chrome, visit chrome://flags.firefox android 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).
... android no support nosafari ios full support yessamsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentResponse.payerEmail - Web APIs
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 chrome, visit chrome://flags.firefox android 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).
... android no support nosafari ios full support yessamsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentRequest.payerName - Web APIs
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).
... no support noopera no support nosafari full support yeswebview android no support nochrome android full support 58firefox android 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).
... android no support nosafari ios full support yessamsung internet android full support 7.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentResponse.requestId - Web APIs
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).
... no support noopera no support nosafari full support yeswebview android no support nochrome android full support 60firefox android 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).
... nosafari ios full support yessamsung internet android full support 8.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentResponse.shippingAddress - Web APIs
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 chrome, visit chrome://flags.firefox android 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).
... android no support nosafari ios full support yessamsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentResponse.shippingOption - Web APIs
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 chrome, visit chrome://flags.firefox android 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).
... android no support nosafari ios full support yessamsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
Payment processing concepts - Web APIs
if the merchant doesn't successfully validate, it's not allowed to use the payment handler.
...note this function must go through the merchant server, because a client typically does not access the validation url itself.
... thus, it's important to note that the user agent never sends a merchantvalidation event, unless the user agent itself implements a payment handler.
Payment Request API - Web APIs
it is not a new way for paying for things; rather, it's a way for users to select their preferred way of paying for things, and make that information available to a merchant.
... note: the api is available inside cross-origin <iframe> elements only if they have had the allowpaymentrequest attribute set on them.
... basiccarderrors an object providing any error messages associated with the fields in the basiccardresponse object that are not valid.
performance.clearResourceTimings() - Web APIs
note: this feature is available in web workers.
... example function load_resource() { var image = new image(); image.src = "https://developer.mozilla.org/static/img/opengraph-logo.png"; } function clear_performance_timings() { if (performance === undefined) { log("browser does not support web performance"); return; } // create a resource timing performance entry by loading an image load_resource(); var supported = typeof performance.clearresourcetimings == "function"; if (supported) { console.log("run: performance.clearresourcetimings()"); performance.clearresourcetimings(); } else { console.log("performance.clearresourcetimings() not supported"); return; } // getentrie...
...performance data buffer not cleared!"); } specifications specification status comment resource timing level 1the definition of 'clearresourcetimings()' in that specification.
performance.getEntriesByName() - Web APIs
note: this feature is available in web workers.
...if the type argument is not specified, only the name will be used to determine the entries to return.
...performance.mark not supported"); return; } // create some performance entries via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); performance.mark("begin"); do_work(100000); performance.mark("end"); do_work(200000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } // use ge...
performance.now() - Web APIs
WebAPIPerformancenow
note: this feature is available in web workers.
... syntax t = performance.now(); example const t0 = performance.now(); dosomething(); const t1 = performance.now(); console.log(`call to dosomething took ${t1 - t0} milliseconds.`); unlike other timing data available to javascript (for example date.now), the timestamps returned by performance.now() are not limited to one-millisecond resolution.
... starting with firefox 79, high resolution timers can be used if you cross-origin isolate your document using the cross-origin-opener-policy and cross-origin-embedder-policy headers: cross-origin-opener-policy: same-origin cross-origin-embedder-policy: require-corp these headers ensure a top-level document does not share a browsing context group with cross-origin documents.
performance.setResourceTimingBufferSize() - Web APIs
note: this feature is available in web workers.
... 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() = not supported"); } } specifications specification status comment resource timing level 1the definition of 'setresourcetimingbuffersize()' in that specification.
PerformanceEntry.name - Web APIs
note: this feature is available in web workers.
...performance.mark not supported"); return; } // create some performance entries via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) ...
...{ var properties = ["name", "entrytype", "starttime", "duration"]; var methods = ["tojson"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in obj; if (supported) log("..." + properties[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported = typeof obj[methods[i]] == "function"; if (supported) { var js = obj[methods[i]](); log("..." + methods[i] + "() = " + json.stringify(js)); } else { log("..." + methods[i] + " = not supported"); } } } specifications specification status comment performance timeline level 2the definition of 'na...
PerformanceEntry.toJSON() - Web APIs
note: this feature is available in web workers.
...performance.mark not supported"); return; } // create some performance entries via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) { var properties = ["name"...
..., "entrytype", "starttime", "duration"]; var methods = ["tojson"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in obj; if (supported) log("..." + properties[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported = typeof obj[methods[i]] == "function"; if (supported) { var js = obj[methods[i]](); log("..." + methods[i] + "() = " + json.stringify(js)); } else { log("..." + methods[i] + " = not supported"); } } } specifications specification status comment performance timeline level 2the definition of 'tojson' in that specification.
PerformanceEventTiming - Web APIs
performanceeventtiming.target returns the associated event's last target, if it is not removed.
... // keep track of whether (and when) the page was first hidden, see: // https://github.com/w3c/page-visibility/issues/29 // note: ideally this check would be performed in the document <head> // to avoid cases where the visibility state changes before this code runs.
... po.observe({ type: 'first-input', buffered: true, }); } catch (e) { // do nothing if the browser doesn't support this api.
PerformanceLongTaskTiming - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetperformancelongtasktiming experimentalchrome full support 58edge full support ≤79firefox no support nonotes no support nonotes notes see bug 1348405.ie ?
... webview android full support 58chrome android full support 58firefox android no support nonotes no support nonotes notes see bug 1348405.opera android full support yessafari ios ?
...expect behavior to change in the future.see implementation notes.see implementation notes.
PerformanceResourceTiming.redirectStart - Web APIs
if there are http redirects when fetching the resource and if any of the redirects are not from the same origin as the current document, but the timing allow check algorithm passes for each redirected resource, this property returns the starting time of the fetch that initiates the redirect; otherwise, zero is returned.
... note: this feature is available in web workers.
..." + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'redirectstart' in that specification.
PerformanceResourceTiming - Web APIs
ormanceresourcetiming" target="_top"><rect x="201" y="1" width="250" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="326" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceresourcetiming</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} note: this feature is available in web workers.
... performanceresourcetiming.workerstartread only returns a domhighrestimestamp immediately before dispatching the fetchevent if a service worker thread is already running, or immediately before starting the service worker thread if it is not already running.
... if the resource is not intercepted by a service worker the property will always return 0.
Permissions - Web APIs
this is not currently supported in any browser.
...this is not currently supported in any browser.
... opera android full support 30safari ios no support nosamsung internet android full support 4.0notifications permissionchrome full support 43edge full support 79firefox ?
Permissions API - Web APIs
concepts and usage historically different apis handle their own permissions inconsistently — for example the notifications api allows for explicit checking of permission status and requesting permission, whereas the geolocation api doesn't (which causes problems if the user denied the initial permission request).
... 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.
Point - Web APIs
WebAPIPoint
it is non-standard, not broadly compatible, and should not be used.
... although it is not directly related to this defunct interface, you are probably looking for dompoint, which is part of the geometry interfaces module level 1 specification.
...it is not present in the current working draft of the css transforms level 1 specification.
Using Pointer Events - Web APIs
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.
... <canvas id="canvas" width="600" height="600" style="border:solid black 1px; touch-action:none"> your browser does not support canvas element.
... 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; } specifications specification status comment pointer events – level 2the definition of 'pointerevent' in that specification.
PopStateEvent - Web APIs
note: just calling history.pushstate() or history.replacestate() won't trigger a popstate event.
... note: browsers used to handle the popstate event differently on page load, but now they behave the same.
...e 1", "?page=1"); history.pushstate({page: 2}, "title 2", "?page=2"); history.replacestate({page: 3}, "title 3", "?page=3"); history.back(); // alerts "location: http://example.com/example.html?page=1, state: {"page":1}" history.back(); // alerts "location: http://example.com/example.html, state: null history.go(2); // alerts "location: http://example.com/example.html?page=3, state: {"page":3} note that even though the original history entry (for http://example.com/example.html) has no state object associated with it, a popstate event is still fired when we activate that entry after the second call to history.back().
ProgressEvent() - Web APIs
in other words, it tells if the progress is measurable or not.
...when downloading a resource using http, this only represent the part of the content itself, not headers and other overhead.
...when downloading a resource using http, this only represent the content itself, not headers and other overhead.
ProgressEvent - Web APIs
in other words, it tells if the progress is measurable or not.
...when downloading a resource using http, this only represent the part of the content itself, not headers and other overhead.
...when downloading a resource using http, this only represent the content itself, not headers and other overhead.
Proximity Events - Web APIs
note: obviously, the api requires the device to have a proximity sensor, which are mostly available only on mobile devices.
... 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.
PublicKeyCredentialCreationOptions.authenticatorSelection - Web APIs
the former describes an authenticator which is bound to the client and which is generally not removable.
...the values may be: "required": user verification is required, the operation will fail if the response does not have the uv flag (as part of the authenticatordata property of authenticatorattestationresponse.attestationobject) "preferred": user verification is prefered, the operation will not fail if the response does not have the uv flag (as part of the authenticatordata property of authenticatorattestationresponse.attestationobject) "discouraged": user verification should not be employed as to minimi...
... note: see publickeycredential.isuserverifyingplatformauthenticatoravailable() which resolves to true when a user-verifiying platform authenticator is available.
PublicKeyCredentialRequestOptions.allowCredentials - Web APIs
note: publickeycredentialcreationoptions.excludecredentials may be used during the creation of the credentials in order to avoid creating new credentials for an existing user with existing public key credential.
...the value of the strings may be: "usb": the authenticator can be contacted via a removable usb link "nfc": the authenticator may be used over nfc (near field communication) "ble": the authenticator may be used over ble (bluetooth low energy) "internal": the authenticator is specifically bound to the client device (cannot be removed).
... if the authenticator does not contain any of these public key credentials, the client will throw a domexception "notallowederror".
PublicKeyCredentialRequestOptions.rpId - Web APIs
for example, if you are browsing on foo.example.com, the rpid value may be "example.com" but not "bar.org" or "baz.example.com".
...if it is not explicitely provided, the user agent will use the value of the current origin's domain.
... note: an analogous option exists for the creation operation (navigators.credentials.create()), see the id property of publickeycredentialcreationoptions.rp.
PushManager.hasPermission() - Web APIs
full support 17firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support service workers and the push api.ie no support noopera full support 29safari no support nowebview android ...
... no support nochrome android full support 42firefox android full support 48notes full support 48notes notes push enabled by default.opera android full support 29safari ios no support nosamsung internet android full support 4.0legend full support full support no support no supportexperimental.
...expect behavior to change in the future.see implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PushManager.supportedContentEncodings - Web APIs
full support 17firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support service workers and the push api.ie no support noopera full support 47safari no support nowebview android ...
... no support nochrome android full support 60firefox android full support 48notes full support 48notes notes push enabled by default.opera android full support 44safari ios no support nosamsung internet android full support 4.0legend full support full support no support no supportexperimental.
...expect behavior to change in the future.see implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
RTCDataChannel.send() - Web APIs
data sent before connecting is buffered if possible (or an error occurs if it's not possible), and is also buffered if sent while the connection is closing or closed.
...specifications exist to define how to automatically fragment large messages, but not all browsers implement them, and those that do have various additional restrictions.
...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.
RTCDtlsTransport.state - Web APIs
its value is one of the following: new the initial state when dtls has not started negotiating yet.
... closed the transport has been closed intentionally as the result of receipt of a close_notify alert, or calling rtcpeerconnection.close().
...new": case "connecting": results.connectionpending++; break; case "connected": results.connected++; break; case "closed": results.closed++; break; case "failed": results.failed++; break; default: results.unknown++; break; } } }); return results; } note that in this code, the new and connecting states are being treated as a single connectionpending status in the returned object.
RTCIceCandidate.RTCIceCandidate() - Web APIs
the following fields are initialized to null if they are not included in the rtcicecandidate.candidate property: foundation, component, priority , ip, protocol, port, type, tcptype, relatedaddress, and relatedport.
... note: parsing of the candidate string is performed using the candidate-attribute grammar from the webrtc specification.
... usage notes this constructor does not do complete validation of the specified candidateinfo object or string.
RTCIceCandidate.port - Web APIs
port is initialized to null if it is not specified in the candidate, or if the candidate string can't be parsed propertly.
... note: if port is null, 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 port number is found in the sixth field, which is "44323".
RTCIceCandidate.priority - Web APIs
priority is initialized to null if it is not specified in the candidate, or if the candidate string can't be parsed propertly.
... note: if priority is null, 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 priority is the number after the protocol, so it's the fourth field in the candidate string.
RTCIceCandidate.protocol - Web APIs
protocol is null by default if not specified properly in the sdp, but this is an error condition and will result in a thrown exception when you call rtcpeerconnection.addicecandidate().
... 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.
RTCIceCandidate.relatedAddress - Web APIs
the related address and port (relatedport) are not used at all by ice itself; they are provided for analysis and diagnostic purposes only, and their inclusion may be blocked by security systems, so do not rely on them having non-null values.
... for host candidates, relatedaddress is null, meaning the field is not included in the candidate's a-line.
... usage notes the related address is included in ice candidates despite not being used by ice itself.
RTCIceCandidate.relatedPort - Web APIs
the related address (relatedaddress) and port are not used at all by ice itself; they are provided for analysis and diagnostic purposes only, and their inclusion may be blocked by security systems, so do not rely on them having non-null values.
... for host candidates, relatedport is null, meaning the field is not included in the candidate's a-line.
... usage notes the related address and port are not used by ice itself, and are only present for diagnostic and quality-of-service purposes.
RTCIceCandidatePairStats.selected - Web APIs
the non-standard, firefox-specific rtcicecandidatepairstats property selected indicates whether or not the candidate pair described by the object is the one currently being used to communicate with the remote peer.
...that object's selectedcandidatepairid property indicates whether or not the specified transport is the one being used.
...idatepair(statsresults) { statsresults.foreach(report => { if (report.type === "transport") { currentpair = statsresults.get(report.selectedcandidatepairid); } }); if (!currentpair) { statsresults.foreach(report => { if (report.type === "candidate-pair" && report.selected) { currentpair = report; } }); } return currentpair; } specifications not part of any specification.
RTCIceCandidateStats.deleted - Web APIs
the rtcicecandidatestats dictionary's deleted property indicates whether or not the candidate has been deleted or released.
... syntax isdeleted = rtcicecandidatestats.deleted; value a boolean value indicating whether or not the candidate has been deleted or released.
...only candidates which have not been deleted are included in the output.
RTCIceCandidateStats.networkType - Web APIs
note: the networktype property is only included in rtcicecandidatestats objects for local candidates (that is, candidates generated locally and included in an sdp offer or answer that has been sent to the remote peer).
...the vpn obscures the underlying network type, which is not discernible.
... note: keep in mind that the specified value only reflects the initial connection between the local peer and the next hop along the network toward reaching the remote peer.
RTCIceCandidateStats - Web APIs
deleted optional a boolean value indicating whether or not the candidate has been released or deleted; the default value is false.
...this property is not present for remote candidates.
... example this example features a function, isusablenetworktype(), whose job it is to look at an rtcicecandidatestats object's networktype and determine whether or not the type of network is acceptable for use.
RTCInboundRtpStreamStats.qpSum - Web APIs
note: this value is only available for video media.
... usage notes quantization is the process of applying lossy compression to a range of values, resulting in a single quantum value.
...additionally, qp is not likely to be the only parameter the codec uses to adjust the compression.
RTCOfferOptions.iceRestart - Web APIs
note: rather than manually creating and submitting an offer with icerestart set to true, you should consider calling the rtcpeerconnection method restartice() instead.
... syntax var options = { icerestart: trueorfalse }; value a boolean value indicating whether or not the rtcpeerconnection should generate new values for the connection's ice-ufrag and ice-pwd values, which will trigger ice renegotiation on the next message sent to the remote peer.
... usage notes when the rtcpeerconnection object's ice connection state changes to failed, you should try to trigger an ice restart.
RTCOutboundRtpStreamStats.pliCount - Web APIs
these are sent by the receiver's decoder to notify the sender's encoder that an undefined amount of coded video data, which may span frame boundaries, has been lost.
... note: this property is only used for video streams.
... usage notes upon receiving a pli packet, the sender may have responded by sending a full frame to the remote peer to allow it to re-synchronize with the media.
RTCOutboundRtpStreamStats.qpSum - Web APIs
note: this value is only available for video media.
... usage notes quantization is the process of applying lossy compression to a range of values, resulting in a single quantum value.
...additionally, qp is not likely to be the only parameter the codec uses to adjust the compression.
RTCPeerConnection() - Web APIs
rtcconfiguration dictionary bundlepolicy optional specifies how to handle negotiation of candidates when the remote peer is not compatible with the sdp bundle standard.
... this configuration option cannot be changed after it is first specified; once the certificates have been set, this property is ignored in future calls to rtcpeerconnection.setconfiguration().
...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.
RTCPeerConnection.addStream() - Web APIs
g, you should update your code to instead use the addtrack() method: navigator.getusermedia({video:true, audio:true}, function(stream) { var pc = new rtcpeerconnection(); stream.gettracks().foreach(function(track) { pc.addtrack(track, stream); }); }); the newer addtrack() api avoids confusion over whether later changes to the track-makeup of a stream affects a peer connection (they do not).
... the exception is in chrome, where addstream() does make the peer connection sensitive to later stream changes (though such changes do not fire the negotiationneeded event).
... if you are relying on the chrome behavior, note that other browsers do not have it.
RTCPeerConnection.canTrickleIceCandidates - Web APIs
the read-only rtcpeerconnection property cantrickleicecandidates returns a boolean which indicates whether or not the remote peer can accept trickled ice candidates.
... syntax var cantrickle = rtcpeerconnection.cantrickleicecandidates; value a boolean that is true if the remote peer can accept trickled ice candidates and false if it cannot.
... 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.
RTCPeerConnection.signalingState - Web APIs
the read-only signalingstate property on the rtcpeerconnection interface returns one of the string values specified by the rtcsignalingstate enum; these values describe the state of the signaling process on the local end of the connection while connecting or reconnecting to another peer.
...this provisional answer describes the supported media formats and so forth, but may not have a complete set of ice candidates included.
... note: this value moved into the rtcpeerconnectionstate enum in the may 13, 2016 draft of the specification, as it reflects the state of the rtcpeerconnection, not the signaling connection.
RTCPeerConnectionIceEvent() - Web APIs
if the candidate was not gathered by a stun or turn server, this value must be null.
... "bubbles" (optional, default is false): inherited from eventinit(), this boolean option indicates whether or not the event must bubble.
... "cancelable" (optional, default is false, inherited from eventinit(), this boolean indicates whether or not the event can be canceled.
RTCRtcpParameters - Web APIs
this property cannot be changed once initialized.
... reducedsize a boolean value indicating whether or not reduced size rtcp is configured.
...this property cannot be changed once initialized.
RTCRtpEncodingParameters - Web APIs
dtx only used for an rtcrtpsender whose kind is audio, this property indicates whether or not to use discontinuous transmission (a feature by which a phone is turned off or the microphone muted automatically in the absence of voice activity).
...this parameter cannot be modified using setparameters().
...the value must not be less than 1.0 (you can't use this to scale the video up).
RTCRtpParameters - Web APIs
this parameter cannot be changed once initially set.
...this parameter cannot be changed once initially set.
...this parameter cannot be changed once initially set.
RTCRtpSendParameters.encodings - Web APIs
dtx only used for an rtcrtpsender whose kind is audio, this property indicates whether or not to use discontinuous transmission (a feature by which a phone is turned off or the microphone muted automatically in the absence of voice activity).
...this parameter cannot be modified using setparameters().
...the value must not be less than 1.0 (you can't use this to scale the video up).
RTCRtpStreamStats.qpSum - Web APIs
note: this value is only available for video media.
... usage notes quantization is the process of applying lossy compression to a range of values, resulting in a single quantum value.
...additionally, qp is not likely to be the only parameter the codec uses to adjust the compression.
RTCRtpSynchronizationSource.voiceActivityFlag - Web APIs
the read-only voiceactivityflag property of the rtcrtpsynchronizationsource interface indicates whether or not the most recent rtp packet on the source includes voice activity.
... syntax var voiceactivity = rtcrtpsynchronizationsource.voiceactivityflag value a boolean value which is true if voice activity is present in the most recently received rtp packet played by the associated source, or false if voice activity is not present.
... this property is omitted entirely if voice activity detection is not enabled on the source, or if the rfc 6464 extension header isn't present.
RTCRtpTransceiver.setCodecPreferences() - Web APIs
note: any codecs not included in codecs will not be considered during the process of negotiating a connection.
... 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.
RTCRtpTransceiver.stopped - Web APIs
the read-only stopped property on the rtcrtptransceiver interface indicates whether or not the transceiver's associated sender and receiver have both been stopped.
... usage notes this property is deprecated and will be removed in the future.
... note: currently only firefox implements stopped, and has not yet been updated to implement this change.
Range.compareNode() - Web APIs
WebAPIRangecompareNode
warning: this method has been removed from gecko 1.9 (firefox 3) and will not exist in future versions of firefox, which was the only browser implementing it; you should switch to range.compareboundarypoints() as soon as possible.
... example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); returnvalue = range.comparenode(document.getelementsbytagname("p").item(0)); notes this method is obsolete; you should use the w3c dom range.compareboundarypoints() method.
... specifications this method is not standard and therefore not part of any specification.
ReadableStream - Web APIs
properties readablestream.locked read only the locked getter returns whether or not the readable stream is locked to a reader.
...the supplied reason argument will be given to the underlying source, which may or may not use it.
... examples in the following example, an artificial response is created to stream html fragments fetched from another resource to the browser.
ReadableStreamBYOBReader.cancel() - Web APIs
the supplied reason parameter will be given to the underlying source, which may or may not use it.
... note: if the reader is active, the cancel() method behaves the same as that for the associated stream (readablestream.cancel()).
... exceptions typeerror the source object is not a readablestreambyobreader, or the stream has no owner.
ReadableStreamDefaultController.error() - Web APIs
note: the error() method can be called more than once, and can be called when the stream is not readable.
... 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.
ReadableStreamDefaultController - Web APIs
default controllers are for streams that are not byte streams.
... note that a readablestreamdefaultcontroller object is provided as the parameter of the start() and pull() functions.
... when a button is pressed, the generation is stopped, the stream is closed using readablestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream.
ReadableStreamDefaultReader.ReadableStreamDefaultReader() - Web APIs
note: you generally wouldn't use this constructor manually; instead, you'd use the readablestream.getreader() method.
... exceptions typeerror the supplied stream parameter is not a readablestream, or it is already locked for reading by another reader.
...each chunk is read sequentially and output to the ui, until the stream has finished being read, at which point we return out of the recursive function and print the entire stream to another part of the ui.
RelativeOrientationSensor - Web APIs
this is not something that would ever be shown to a user.
... note that the intel demo this is based on uses the absoluteoreintationsensor.
... model.quaternion.fromarray(sensor.quaternion).inverse(); }); sensor.addeventlistener('error', error => { if (event.error.name == 'notreadableerror') { console.log("sensor is not available."); } }); sensor.start(); permissions example using orientation sensors requires requsting permissions for multiple device sensors.
Reporting API - Web APIs
note: there is no absolute guarantee of report delivery — a report could still fail to be collected if a serious error occurs.
...this method is not as failsafe as the report-to method described above — any page crash could stop you retrieving the reports — but it is easier to set up, and more flexible.
... note: if you look at the complete source code, you'll notice that we actually call the deprecated getusermedia() method twice.
Request - Web APIs
WebAPIRequest
you can create a new request object using the request() constructor, but you are more likely to encounter a request object being returned as the result of another api operation, such as a service worker fetchevent.request.
... note: the body functions can be run only once; subsequent calls will resolve with empty strings/arraybuffers.
... in the following snippet, we create a new request using the request() constructor with some initial data and body content for an api request which need a body payload: const request = new request('https://example.com', {method: 'post', body: '{"foo": "bar"}'}); const url = request.url; const method = request.method; const credentials = request.credentials; const bodyused = request.bodyused; note: the body type can only be a blob, buffersource, formdata, urlsearchparams, usvstring or readablestream type, so for adding a json object to the payload you need to stringify that object.
ResizeObserver - Web APIs
note: the content box is the box in which content can be placed, meaning the border box minus the padding and border width.
...this shows that you can respond to changes in an element’s size, even if they have nothing to do with the viewport.
...if it is turned off, the text will not change in response to the <div>'s width changing.
ResizeObserverEntry - Web APIs
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.
... note: the content box is the box in which content can be placed, meaning the border box minus the padding and border width.
...if not, it uses the older contentrect property.
Resize Observer API - Web APIs
the resize observer api provides a performant mechanism by which code can monitor an element for changes to its size, with notifications being delivered to the observer each time the size changes.
... such a solution tends to only work for limited use cases, be bad for performance (continually calling the above methods would result in a big performance hit), and often won't work when the browser window size is not changed.
...this shows that you can respond to changes in an element’s size, even if they have nothing to do with the viewport.
Response.error() - Web APIs
WebAPIResponseerror
note: this is mainly relevant to serviceworkers; the error method is used to return an error if you so wish it.
... note: an "error" response never really gets exposed to script: such a response to a fetch() would reject the promise.
... example tbd (does not yet appear to be supported anywhere).
SVGAngle - Web APIs
WebAPISVGAngle
unless otherwise described, an svgangle object is not associated with any element.
... exceptions on setting: a domexception with code syntax_err is raised if the assigned string cannot be parsed as a valid <angle>.
... 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).
SVGAnimatedAngle - Web APIs
if the given attribute is not currently being animated, then the svgangle will have the same contents as baseval.
... the object referenced by animval will always be distinct from the one referenced by baseval, even when the attribute is not animated.
... methods the svganimatedangle interface do not provide any specific methods.
SVGAnimatedLengthList - Web APIs
if the given attribute is not currently being animated, then the svglengthlist will have the same contents as baseval.
... the object referenced by animval will always be distinct from the one referenced by baseval, even when the attribute is not animated.
... methods the svganimatedlengthlist interface do not provide any specific methods.
SVGAnimatedNumberList - Web APIs
if the given attribute is not currently being animated, then the svgnumberlist will have the same contents as baseval.
... the object referenced by animval will always be distinct from the one referenced by baseval, even when the attribute is not animated.
... methods the svganimatednumberlist interface do not provide any specific methods.
SVGAnimatedPreserveAspectRatio - Web APIs
if the given attribute is not currently being animated, then the svgpreserveaspectratio will have the same contents as baseval.
... the object referenced by animval is always distinct from the one referenced by baseval, even when the attribute is not animated.
... methods the svganimatedpreserveaspectratio interface do not provide any specific methods.
SVGAnimatedRect - Web APIs
if the given attribute is not currently being animated, then the svgrect will have the same contents as baseval.
... the object referenced by animval will always be distinct from the one referenced by baseval, even when the attribute is not animated.
... methods the svganimatedrect interface do not provide any specific methods.
SVGCircleElement - Web APIs
it is denoted by the cx attribute of the element.
...it is denoted by the cy attribute of the element.
...it is denoted by the r of the element.
SVGFETurbulenceElement - Web APIs
idth="2px" /><text x="371" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfeturbulenceelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants turbulence types name value description svg_turbulence_type_unknown 0 the type is not one of predefined types.
... stitch options name value description svg_stitchtype_unknown 0 the type is not one of predefined types.
... methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGGraphicsElement: cut event - Web APIs
note though that cancelling the default action will also prevent the document from being updated.
... the handler cannot read the clipboard data.
... it's possible to construct and dispatch a synthetic cut event, but this will not affect the system clipboard or the document's contents.
SVGLength - Web APIs
WebAPISVGLength
nitor (pixel units will be dpi-dependent): value: 37.7952766418457, valueinspecifiedunits: 6: 1, valueasstring: 1cm value: 26.66666603088379, valueinspecifiedunits 9: 20, valueasstring: 20pt value: 26.66666603088379, valueinspecifiedunits 8: 0.277777761220932, valueasstring: 0.277778in constants name value description svg_lengthtype_unknown 0 the unit type is not one of predefined unit types.
... exceptions on setting: a domexception with code syntax_err is raised if the assigned string cannot be parsed as a valid <length>.
... 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).
SVGPreserveAspectRatio - Web APIs
svg_preserveaspectratio_xmidymax = 9 svg_preserveaspectratio_xmaxymax = 10 svg_meetorslice_unknown = 0 svg_meetorslice_meet = 1 svg_meetorslice_slice = 2 normative document svg 1.1 (2nd edition) constants name value description svg_preserveaspectratio_unknown 0 the enumeration was set to a value that is not one of predefined types.
... svg_meetorslice_unknown 0 the enumeration was set to a value that is not one of predefined types.
... methods the svgpreserveaspectratio interface do not provide any specific methods.
SVGTextPathElement - Web APIs
stroke-width="2px" /><text x="-79" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtextpathelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants method types name value description textpath_methodtype_unknown 0 the type is not one of predefined types.
... spacing types name value description textpath_spacingtype_unknown 0 the type is not one of predefined types.
... methods this interface does not provide any specific methods, but implements those of its parent, svgtextcontentelement, and also implements methods of svgurireference.
Screen Capture API - Web APIs
mediatrackconstraints mediatrackconstraints.cursor a constraindomstring indicating whether or not the cursor should be included in the captured display surface's stream, and if it should always be visible or if it should only be visible while the mouse is in motion.
... mediatrackconstraints.logicalsurface indicates whether or not the video in the stream represents a logical display surface (that is, one which may not be entirely visible onscreen, or may be completely offscreen).
... mediatracksettings mediatracksettings.cursor a string which indicates whether or not the display surface currently being captured includes the mouse cursor, and if so, whether it's only visible while the mouse is in motion or if it's always visible.
Selection.modify() - Web APIs
WebAPISelectionmodify
note: gecko does not implement "sentence", "paragraph", "sentenceboundary", "paragraphboundary", or "documentboundary".
... note: starting in gecko 5.0, the "word" granularity no longer includes the following space, regardless of the default platform behavior.
...ndary">document boundary</option> </select> <br><br> <button>extend selection</button> javascript let select = document.queryselector('select'); let button = document.queryselector('button'); button.addeventlistener('click', modify); function modify() { let selection = window.getselection(); selection.modify('extend', 'forward', select.value); } result specifications this method is not part of any specification.
ServiceWorkerContainer.register() - Web APIs
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.
... 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.
... 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.
ServiceWorkerGlobalScope: pushsubscriptionchange event - Web APIs
bubbles no cancelable no interface pushsubscriptionchangeevent event handler property onpushsubscriptionchange usage notes although examples demonstrating how to share subscription related information with the application server tend to use fetch(), this is not necessarily the best choice for real-world use, since it will not work if the app is offline, for example.
... consider using another method to synchronize subscription information between your service worker and the app server, or make sure your code using fetch() is robust enough to handle cases where attempts to exchange data fail.
... note: in earlier drafts of the specification, this event was defined to be sent when a pushsubscription has expired.
ServiceWorkerRegistration.unregister() - Web APIs
the promise will resolve to false if no registration was found, otherwise it resolves to true irrespective of whether unregistration happened or not (it may not unregister if someone else just called serviceworkercontainer.register() with the same scope.) the service worker will finish any ongoing operations before it is unregistered.
... note: this feature is available in web workers.
... return value promise resolves with a boolean indicating whether the service worker has unregistered or not.
ShadowRoot - Web APIs
this defines whether or not the shadow root's internal features are accessible from javascript.
...note that this is currently only implemented by chrome; other browsers still implement them on the document interface.
...note that this is currently only implemented by chrome; other browsers still implement them on the document interface.
SourceBuffer.abort() - Web APIs
exceptions exception explanation invalidstateerror the mediasource.readystate property of the parent media source is not equal to open, or this sourcebuffer has been removed from the mediasource.
...a buffer is being appended but the operation has not yet completed) a user "scrubs" the video seeking to a new point in time.
...in lines 92-101, the seek() function is defined — note that abort() is called if mediasource.readystate is set to open, which means that it is ready to receive new source buffers — at this point it is worth aborting the current segment and just getting the one for the new seek position (see checkbuffer() and getcurrentsegment().) specifications specification status comment media source extensionsthe definition of 'abort()...
SourceBuffer.appendBufferAsync() - Web APIs
return value a promise which is fulfilled when the buffer has been added successfully to the sourcebuffer, or null if the request could not be initiated.
... async function fillsourcebuffer(buffer, msbuffer) { try { while(true) { await msbuffer.appendbufferasync(buffer); } } catch(e) { handleexception(e); } } specifications not currently part of any specification.
... specification status comment media source extensions recommendation initial definition; does not include this method.
SpeechRecognitionEvent.emma - Web APIs
the emma read-only property of the speechrecognitionevent interface returns 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.
...if the speech recognition system does not supply emma data then the user agent will return null.
SpeechSynthesis.paused - Web APIs
the paused read-only property of the speechsynthesis interface is a boolean that returns true if the speechsynthesis object is in a paused state, or false if not.
... it can be set to paused even if nothing is currently being spoken through it.
... if utterances are then added to the utterance queue, they will not be spoken until the speechsynthesis object is unpaused, using speechsynthesis.resume().
SpeechSynthesisErrorEvent.error - Web APIs
audio-busy the operation couldn't be completed at this time because the user-agent couldn't access the audio output device (for example, the user may need to correct this by closing another application.) audio-hardware the operation couldn't be completed at this time because the user-agent couldn't identify an audio output device (for example, the user may need to connect a speaker or configure system settings.) network the operation couldn't be completed at this time because some required network communication failed.
... voice-unavailable the voice set in speechsynthesisutterance.voice was not available.
... invalid-argument the content of the speechsynthesisutterance.rate, speechsynthesisutterance.pitch or speechsynthesisutterance.volume property was not valid.
StaticRange - Web APIs
abstractrange and staticrange are not available from web workers.
... usage notes a dom range specifies a span of content in a document, potentially beginning inside one node (or element) and ending inside another one.
... unlike a range, a staticrange represents a range which is fixed in time; it does not change to try to keep the same content within it as the document changes.
StereoPannerNode.StereoPannerNode() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetstereopannernode() constructorchrome full support 55notes full support 55notes notes before chrome 59, the default values were not supported.edge full support ≤79firefox full support 53ie no support noopera full support 42safar...
...i no support nowebview android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.chrome android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios no support nosamsung internet android full support 6.0notes ...
... full support 6.0notes notes before samsung internet 7.0, the default values were not supported.legend full support full support no support no supportsee implementation notes.see implementation notes.
Storage.getItem() - Web APIs
WebAPIStoragegetItem
the getitem() method of the storage interface, when passed a key name, will return that key's value, or null if the key does not exist, in the given storage object.
...if the key does not exist, null is returned.
... localstorage.getitem('font'); var currentimage = localstorage.getitem('image'); document.getelementbyid('bgcolor').value = currentcolor; document.getelementbyid('font').value = currentfont; document.getelementbyid('image').value = currentimage; htmlelem.style.backgroundcolor = '#' + currentcolor; pelem.style.fontfamily = currentfont; imgelem.setattribute('src', currentimage); } note: to see this used within a real world example, see our web storage demo.
Storage.key() - Web APIs
WebAPIStoragekey
the order of keys is user-agent defined, so you should not rely on it.
...if the index does not exist, null is returned.
...xamples the following function iterates over the local storage keys: function foreachkey(callback) { for (var i = 0; i < localstorage.length; i++) { callback(localstorage.key(i)); } } the following function iterates over the local storage keys and gets the value set for each key: for(var i =0; i < localstorage.length; i++){ console.log(localstorage.getitem(localstorage.key(i))); } note: for a real world example, see our web storage demo.
SubtleCrypto.deriveBits() - Web APIs
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.
... examples note: you can try the working examples on github.
SubtleCrypto.exportKey() - Web APIs
keys are not exported in an encrypted format: to encrypt keys when exporting them use the subtlecrypto.wrapkey() api instead.
... notsupported raised when trying to export in an unknown format.
... examples note: you can try the working examples out on github.
Touch.radiusX - Web APIs
WebAPITouchradiusX
note: this attribute has not been formally standardized.
... it is specified in the touch events – level 2 draft specification and not in touch events recommendation.
... this attribute is not widely implemented.
Touch.radiusY - Web APIs
WebAPITouchradiusY
note: this attribute has not been formally standardized.
... it is specified in the touch events – level 2 draft specification and not in touch events recommendation.
... this attribute is not widely implemented.
Touch.rotationAngle - Web APIs
note: this attribute has not been formally standardized.
... it is specified in the touch events – level 2 draft specification and not in touch events recommendation.
... this attribute is not widely implemented.
Touch - Web APIs
WebAPITouch
note: many of the properties' values are hardware-dependent; for example, if the device doesn't have a way to detect the amount of pressure placed on the surface, the force value will always be 0.
... touch.clientx read only returns the x coordinate of the touch point relative to the left edge of the browser viewport, not including any scroll offset.
... touch.clienty read only returns the y coordinate of the touch point relative to the top edge of the browser viewport, not including any scroll offset.
TouchEvent.metaKey - Web APIs
summary a boolean value indicating whether or not the meta key is enabled when the touch event is created.
... note: on macintosh keyboards, this is the ⌘ command key.
... syntax var metaenabled = touchevent.metakey; return value metaenabled true if the meta key is enabled for this event; and false if the meta is not enabled.
TouchEvent.touches - Web APIs
touches is a read-only touchlist listing all the touch objects for touch points that are currently in contact with the touch surface, regardless of whether or not they've changed or what their target element was at touchstart time.
... syntax var touches = touchevent.touches; return value touches a touchlist listing all the touch objects for touch points that are still in contact with the touch surface, regardless of whether or not they've changed or what their target element was at touchstart time.
... 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.
Supporting both TouchEvent and MouseEvent - Web APIs
ideally, a touch-based application does not need to explicitly address mouse input.
... event firing the touch events standard defines a few browser requirements regarding touch and mouse interaction (see the interaction with mouse events and click section for details), noting the browser may fire both touch events and mouse events in response to the same user input.
...consequently, if an application does not want mouse events fired on a specific touch target element, the element's touch event handlers should call preventdefault() and no additional mouse events will be dispatched.
TrackEvent() - Web APIs
bubbles optional a boolean indicating whether the event bubbles or not.
... cancelable optional a boolean indicating whether or not the event can be canceled.
... composed optional a boolean indicating whether or not the event will trigger listeners outside of a shadow root; see event.composed for more details.
TransformStream - Web APIs
&& chunk.every(value => typeof value === 'number')) controller.enqueue(new uint8array(chunk)) else if ('function' === typeof chunk.valueof && chunk.valueof() !== chunk) this.transform(chunk.valueof(), controller) // hack else if ('tojson' in chunk) this.transform(json.stringify(chunk), controller) break case 'symbol': controller.error("cannot send a symbol as a chunk part") break case 'undefined': controller.error("cannot send undefined as a chunk part") default: controller.enqueue(this.textencoder.encode(string(chunk))) break }, flush() { /* do any destructor work here */ } } class anytou8stream extends transformstream { constructor() { super({...transformcontent, textencoder: ne...
...w textencoder()}) } } polyfilling textencoderstream and textdecoderstream note that this is deprecated by the native constructors.
... let responses = [ /* conjoined response tree */ ] let {readable, writable} = new transformstream responses.reduce( (a, res, i, arr) => a.then(() => res.pipeto(writable, {preventclose: (i+1) !== arr.length})), promise.resolve() ) note that this is not resilient to other influences.
UIEvent.cancelBubble - Web APIs
the uievent.cancelbubble property indicates if event bubbling for this event has been canceled or not.
...not all events are allowed to bubble up the dom.
... syntax event.cancelbubble = bool; var bool = event.cancelbubble; specifications this property is not part of any specification.
UIEvent.isChar - Web APIs
WebAPIUIEventisChar
the uievent.ischar read-only property returns a boolean indicating whether the event produced a key character or not.
...some keystroke combinations may raise events but not produce any character (example: ctrl-alt-?).
... if (event.ischar) { characterbuffer += e.which; } specification this property is not part of any specification.
UIEvent.pageX - Web APIs
WebAPIUIEventpageX
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.
... specifications this property is not part of any specification.
UIEvent - Web APIs
WebAPIUIEvent
uievent.cancelbubble is a boolean indicating whether the bubbling of the event has been canceled or not.
... uievent.ischar read only returns a boolean indicating whether the event produced a key character or not.
...if the event has already being dispatched, this method does nothing.
URL.createObjectURL() - Web APIs
note: this feature is available in web workers.
... note: this feature is not available in service workers due to its potential to create memory leaks.
... usage notes memory management each time you call createobjecturl(), a new object url is created, even if you've already created one for the same object.
URL.hash - Web APIs
WebAPIURLhash
the fragment is not percent-decoded.
... if the url does not have a fragment identifier, this property contains an empty string — "".
... note: this feature is available in web workers.
URL.revokeObjectURL() - Web APIs
call this method when you've finished using an object url to let the browser know not to keep the reference to the file any longer.
... note: this feature is available in web workers.
... note: this method is not available from service workers, due to issues with the blob interface's life cycle and the potential for leaks.
URLSearchParams.toString() - Web APIs
note: this method returns the query string without the question mark.
... note: this feature is available in web workers.
...params.append('foo', 4); console.log(params.tostring()); //prints 'foo=1&bar=2&foo=4' // note: params can also be directly created let url = new url('https://example.com?foo=1&bar=2'); let params = url.searchparams; // or even simpler let params = new urlsearchparams('foo=1&bar=2'); specifications specification status comment urlthe definition of 'tostring() (see "stringifier")' in that specification.
UserDataHandler - Web APIs
per the specification, exceptions should not be thrown in a userdatahandler.
... in both document.importnode() and node.clonenode(), although user data is not copied over, the handler will be called.
... constants constant value operation node_cloned 1 node.clonenode() node_imported 2 document.importnode() node_deleted unimplemented (see bug 550400) 3 node_renamed unimplemented 4 node.renamenode() node_adopted 5 document.adoptnode() (node_renamed is currently not supported since node.renamenode() is not supported.) specification dom level 3 core: userdatahandler ...
ValidityState.stepMismatch - Web APIs
the read-only stepmismatch 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 step attribute.
... if the field is numeric in nature, including the date, month, week, time, datetime-local, number and range types and the step value is not any, if the value don't doesn't conform to the constraints set by the step and min values, then stepmismatch will be true.
... if the remainder of the form control's value less the min value, divided by the step value (which defaults to 1 if ommitted) is not zero, there is a mismatch.
WakeLock.request() - Web APIs
WebAPIWakeLockrequest
exceptions notallowederror thrown when wake lock is not available, which can happen because: document is not allowed to use screen wake lock due to screen-wake-lock policy.
... document is not fully active.
... user agent could not acquire platform's wake lock.
WaveShaperNode.WaveShaperNode() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetwaveshapernode() constructorchrome full support 55notes full support 55notes notes before chrome 59, the default values were not supported.edge full support ≤79firefox full support 53ie no support noopera full support 42safar...
... webview android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.chrome android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ?
... samsung internet android full support 6.0notes full support 6.0notes notes before samsung internet 7.0, the default values were not supported.legend full support full support no support no support compatibility unknown compatibility unknownsee implementation notes.see implementation notes.
WebGL2RenderingContext.copyBufferSubData() - Web APIs
the webgl2renderingcontext.copybuffersubdata() method of the webgl 2 api copies part of the data of a buffer to another buffer.
... gl.copy_read_buffer: buffer for copying from one buffer object to another (provided specifically for copy operations).
... gl.copy_write_buffer: buffer for copying from one buffer object to another (provided specifically for copy operations).
WebGLRenderingContext.bufferData() - Web APIs
when using a webgl 2 context, the following values are available additionally: gl.copy_read_buffer: buffer for copying from one buffer object to another.
... gl.copy_write_buffer: buffer for copying from one buffer object to another.
... a gl.invalid_enum error is thrown if target or usage are not one of the allowed enums.
WebGLRenderingContext.bufferSubData() - Web APIs
when using a webgl 2 context, the following values are available additionally: gl.copy_read_buffer: buffer for copying from one buffer object to another.
... gl.copy_write_buffer: buffer for copying from one buffer object to another.
... a gl.invalid_enum error is thrown if target is not one of the allowed enums.
WebGLRenderingContext.enableVertexAttribArray() - Web APIs
either way, since attributes cannot be used unless enabled, and are disabled by default, you need to call enablevertexattribarray() to enable individual attributes so that they can be used.
...if you know the name of the attribute but not its index, you can get the index by calling getattriblocation().
...this step is not obvious, since this binding is almost a side effect.
WebGLRenderingContext.framebufferRenderbuffer() - Web APIs
exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer, gl.draw_framebuffer, or gl.read_framebuffer.
... a gl.invalid_enum error is thrown if renderbuffertarget is not gl.renderbuffer.
... a gl.invalid_enum error is thrown if attachment is not one of the allowed enums.
WebGLRenderingContext.getError() - Web APIs
gl.invalid_operation the specified command is not allowed for the current state.
... gl.invalid_framebuffer_operation the currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.
... gl.out_of_memory not enough memory is left to execute the command.
WebGLRenderingContext.getProgramParameter() - Web APIs
possible values: gl.delete_status: returns a glboolean indicating whether or not the program is flagged for deletion.
... gl.link_status: returns a glboolean indicating whether or not the last link operation was successful.
... gl.validate_status: returns a glboolean indicating whether or not the last validation operation was successful.
WebGLShader - Web APIs
at this point the webglshader is still not in a usable form and must still be attached to a webglprogram.
... function createshader (gl, sourcecode, type) { // compiles either a shader of type gl.vertex_shader or gl.fragment_shader var shader = gl.createshader( type ); gl.shadersource( shader, sourcecode ); gl.compileshader( shader ); if ( !gl.getshaderparameter(shader, gl.compile_status) ) { var info = gl.getshaderinfolog( shader ); throw 'could not compile webgl program.
... examples creating a vertex shader note that there are many other strategies for writing and accessing shader source code strings.
A basic 2D WebGL animation example - Web APIs
this is simply because our context is not square.
...note the use of a template literal string to insert the correct shader type string into the message that gets generated.
...this step is not obvious, since this binding is almost a side effect.
Canvas size and WebGL - Web APIs
« previousnext » this webgl example explores the effect of setting (or not setting) the canvas size to its element size in css pixels, as it appears in the browser window.
... <p>compare the two canvases.</p> <canvas>your browser does not seem to support html5 canvas.</canvas> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { display : inline-block; width : 120px; height : 80px; margin : auto; padding : 0; border : none; background-color : black; } window.addeventlistener("load", function() { "use strict" var firstcanvas = document.getelement...
..." + "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.
Clearing by clicking - Web APIs
note how we embed the webgl function calls inside the event handler function.
... <p>a very simple webgl program that still shows some color and user interaction.</p> <p>you can repeatedly click the empty canvas or the button below to change color.</p> <canvas id="canvas-view">your browser does not seem to support html5 canvas.</canvas> <button id="color-switcher">press here to switch color</button> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : inline-block; font-size : inherit; margin : auto; padding : 0.6em; } window.addeventlistener("load", function setupwebgl (evt) { "use strict" // cleaning after ourselves.
... 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.
Detect WebGL - Web APIs
saving the state of the graphics machine within a single context interface is not unique to webgl.
...the canvas is not added to the // document itself, so it is never displayed in the // browser window.
..." + "your browser or device may not support webgl."; } } }, false); the source code of this example is also available on github.
Hello vertex attributes - Web APIs
click on the canvas to change the horizontal position of the square.</p> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } <script type="x-shader/x-vertex" id="vertex-shader"> #version 100 precision highp float; attribute float p...
...ogram, fragmentshader); gl.linkprogram(program); gl.detachshader(program, vertexshader); gl.detachshader(program, fragmentshader); gl.deleteshader(vertexshader); gl.deleteshader(fragmentshader); if (!gl.getprogramparameter(program, gl.link_status)) { var linkerrlog = gl.getprograminfolog(program); cleanup(); document.queryselector("p").innerhtml = "shader program did not link successfully.
... function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } })(); the source code of this example is also available on github.
Scissor animation - Web APIs
note that this time it is the position of the square (the scissoring area) that is updated every frame (we set frame rate to roughly one every 17ms, or roughly 60fps – frames per second).
... <p>webgl animation by clearing the drawing buffer with solid color and applying scissor test.</p> <button id="animation-onoff"> press here to <strong>[verb goes here]</strong> the animation</button> <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; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } ;(function(){ "use strict" window.addeventlistener("load", setupanimation, false); /...
... function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } })(); the source code of this example is also available on github.
Textures from code - Web APIs
simple demonstration of procedural texturing</p> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } <script type="x-shader/x-vertex" id="vertex-shader"> #version 100 precision highp float; attribute vec2 po...
...ogram, fragmentshader); gl.linkprogram(program); gl.detachshader(program, vertexshader); gl.detachshader(program, fragmentshader); gl.deleteshader(vertexshader); gl.deleteshader(fragmentshader); if (!gl.getprogramparameter(program, gl.link_status)) { var linkerrlog = gl.getprograminfolog(program); cleanup(); document.queryselector("p").innerhtml = "shader program did not link successfully.
... function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } })(); the source code of this example is also available on github.
Getting started with WebGL - Web APIs
it's worth noting here that this series of articles introduces webgl itself; however, there are a number of frameworks available that encapsulate webgl's capabilities, making it easier to build 3d applications and games, such as three.js and babylon.js.
...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.
...if the browser does not support webgl, getcontext() will return null in which case we display a message to the user and exit.
Improving compatibility using WebRTC adapter.js - Web APIs
while the webrtc specification is relatively stable, not all browsers have fully implemented all of its features.
... 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.
... 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.
WebSocket.send() - Web APIs
WebAPIWebSocketsend
exceptions thrown invalid_state_err the connection is not currently open.
... 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.
Writing WebSocket client applications - Web APIs
note: this feature is available in web workers.
... note: the example snippets in this article are taken from our websocket chat client/server sample.
... 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.
WebXR application life cycle - Web APIs
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.
...this will reduce the chance that the rendering process will noticeably stall the app.
Web Animations API Concepts - Web APIs
this means we can use it to create and manipulate css-like animations that 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.
...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.
...effects for grouping and sequencing, not unlike features we had in flash.
Using IIR filters - Web APIs
this enters the realms of signal processing theory — don't worry if you look at it and feel like it's not for you.
... when setting our coefficients, the feedforward values can't all be set to zero, otherwise nothing would be sent to the filter.
... something like this is acceptable: let feedforward = [0.00020298, 0.0004059599, 0.00020298]; our feedback values cannot start with zero, otherwise on the first pass nothing would be sent back: let feedbackward = [1.0126964558, -1.9991880801, 0.9873035442]; note: these values are calculated based on the lowpass filter specified in the filter characteristics of the web audio api specification.
Attestation and Assertion - Web APIs
it is not included when used in the authenticatorassertionresponse.) different devices have different attestation formats.
... it should be noted that while attestation provides the capability for a root of trust, validating the root of trust is frequently not necessary.
...older authenticators (u2f) do not support this output.
Web Storage API - Web APIs
note: from firefox 45 onwards, when the browser crashes/restarts, the amount of data saved per origin is limited to 10mb.
... note: access to web storage from third-party iframes is denied if the user has disabled third-party cookies (firefox implements this behaviour from version 43 onwards.) note: web storage is not the same as mozstorage (mozilla's xpcom interfaces to sqlite) or the session store api (an xpcom storage utility for use by extensions).
... in addition, we have provided an event output page — if you load this page in another tab, then make changes to your choices in the landing page, you'll see the updated storage information outputted as the storageevent is fired.
Web Workers API - Web APIs
worker()) that runs a named javascript file — this file contains the code that will run in the worker thread; workers run in another global context that is different from the current window.
...they will also allow access to push notifications and background sync apis.
... note: as per the web workers spec, worker error events should not bubble (see bug 1188141.
Window: beforeunload event - Web APIs
however note that not all browsers support this method, and some instead require the event handler to implement one of two legacy methods: assigning a string to the event's returnvalue property returning a string from the event handler.
... 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.
...however, this is not supported by all browsers.
Window.captureEvents() - Web APIs
--> <script> function reg() { window.captureevents(event.click); window.onclick = page_click; } function page_click() { alert('page click event detected!'); } </script> </head> <body onload="reg();"> <p>click anywhere on this page.</p> </body> </html> notes events raised in the dom by user activity (such as clicking buttons or shifting focus away from the current document) generally pass through the high-level window and document objects first before arriving at the object that initiated the event.
... note that you can pass a list of events to this method using the following syntax: window.captureevents(event.keypress | event.keydown | event.keyup).
... specification this is not part of any specification.
Window.convertPointFromNodeToPage() - Web APIs
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).
...it is not present in the current css transforms module level 1 working draft.
Window.external - Web APIs
WebAPIWindowexternal
however, this is now deprecated, and the contained methods are now dummy functions that do nothing as per spec.
... methods the external object has the following methods: method description addsearchprovider(descriptionurl) dummy function; does nothing.
... issearchproviderinstalled() dummy function; does nothing.
Window.matchMedia() - Web APIs
WebAPIWindowmatchMedia
usage notes you can use the returned media query to perform both instantanteous and event-driven checks to see if the document matches the media query.
... if you need to be kept aware of whether or not the document matches the media query at all times, you can instead watch for the change event to be delivered to the object.
... javascript let mql = window.matchmedia('(max-width: 600px)'); document.queryselector(".mq-value").innertext = mql.matches; the javascript code simply passes the media query to match into matchmedia() to compile it, then sets the <span>'s innertext to the value of the results' matches property, so that it indicates whether or not the document matches the media query at the moment the page was loaded.
Window.name - Web APIs
WebAPIWindowname
syntax string = window.name; window.name = string; example <script> // open a tab with a specific browsing context name const othertab = window.open("url1", "_blank"); if (othertab) othertab.name = "other-tab"; </script> <a href="url2" target="other-tab">this link will be opened in the other tab.</a> notes the name of the window is used primarily for setting targets for hyperlinks and forms.
... browsing contexts do not need to have names.
...modern web applications hosting sensitive data should, however, not rely on window.name for cross-domain messaging but instead utilize the postmessage api.
Window: pageshow event - Web APIs
this includes: initially loading the page navigating to the page from another page in the same window or tab restoring a frozen page on mobile oses returning to the page using the browser's forward or back buttons during the initial page load, the pageshow event fires after the load event.
..."persisted" : "not persisted"; console.log('event:', event.type, '-', ispersisted); break; default: console.log('event:', event.type); break; } }; events.foreach(eventname => window.addeventlistener(eventname, eventlogger) ); html <p>open the console and watch the output as you navigate to and from this page.
... try loading new pages into this tab, then navigating forward and backward through history, noting the events’ output to the log.</p> results specifications specification status comment html living standardthe definition of 'pageshow' in that specification.
Window.pkcs11 - Web APIs
WebAPIWindowpkcs11
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.
... syntax objref = window.pkcs11 example window.pkcs11.addmodule(smod, secpath, 0, 0); notes see nsidompkcs11 for more information about how to manipulate pkcs11 objects.
... specification not part of specification.
Window.requestAnimationFrame() - Web APIs
note: your callback routine must itself call requestanimationframe() if you want to animate another frame at the next repaint.
...this is a non-zero value, but you may not make any other assumptions about its value.
... element.style.transform = 'translatex(' + math.min(0.1 * elapsed, 200) + 'px)'; if (elapsed < 2000) { // stop the animation after 2 seconds window.requestanimationframe(step); } } window.requestanimationframe(step); notes edge versions below 17 and internet explorer do not reliably fire requestanimationframe before the paint cycle.
Window.resizeBy() - Web APIs
WebAPIWindowresizeBy
example // shrink the window window.resizeby(-200, -200); notes this method resizes the window relative to its current size.
... even if you create window by window.open() it is not resizable by default.
...if the window you open is not in the same orgin as the current window, you will not be able to resize, or access any information on, that window/tab.
Window.scrollBy() - Web APIs
WebAPIWindowscrollBy
examples to scroll down one page: window.scrollby(0, window.innerheight); to scroll up: window.scrollby(0, -window.innerheight); using options: window.scrollby({ top: 100, left: 100, behavior: 'smooth' }); notes window.scrollby() scrolls by a particular amount, whereas window.scroll() scrolls to an absolute position in the document.
...ktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetscrollbychrome full support 1edge full support 79 full support 79 no support 12 — 79notes notes only scrollby(x-coord, y-coord) is supported.firefox full support 1ie partial support 11notes partial support 11notes notes only scrollby(x-coord, y-coord) is supported.opera full support 3safari full support ...
...nosamsung internet android full support 5.0legend full support full support partial support partial support no support no supportsee implementation notes.see implementation notes.
Window.sidebar - Web APIs
WebAPIWindowsidebar
addsearchprovider(descriptionurl) dummy function; does nothing.
... note: this was made obsolete in firefox 44, and has been removed completely in firefox 59.
...not part of any standard.
Window.window - Web APIs
WebAPIWindowwindow
another reason, is that without this property you wouldn't be able to write, for example, "window.open('http://google.com/')".
... yet another reason to use this property, is for libraries which wish to offer oop-versions, and non-oop versions (especially javascript modules).
...another advantage, is that the objects of such a class (even if the class were defined outside of a module) could change their reference to the window at will, they would not be able to do this if they had hard-coded a reference to "window".
Worker.prototype.postMessage() - Web APIs
if the message parameter is not provided, a typeerror will be thrown.
...null is not an acceptable value for transfer.
... note: postmessage() can only send a single object at once.
WorkerGlobalScope - Web APIs
windoworworkerglobalscope.issecurecontext read only returns a boolean indicating whether the current context is secure (true) or not (false).
...(this does not yet appear to be implemented in any browser.) events error fired when an error occured.
...for example, you could import another script into the worker and print out the contents of the worker scope's navigator object using the following two lines: importscripts('foo.js'); console.log(navigator); since the global scope of the worker script is effectively the global scope of the worker you are running (dedicatedworkerglobalscope or whatever) and all worker global scopes inherit methods, properties, etc.
WorkerNavigator - Web APIs
do not rely on this property to return the correct value.
...do not rely on this property to return the correct value.
...do not rely on this property to return the correct value.
Worklet - Web APIs
WebAPIWorklet
worklet types worklets are restricted to specific use cases; they cannot be used for arbitrary computations like web workers.
... the worklet interface abstracts properties and methods common to all kind of worklets, and cannot be created directly.
... properties the worklet interface does not define any properties.
XDomainRequest - Web APIs
if(window.xdomainrequest){ var xdr = new xdomainrequest(); xdr.open("get", "http://example.com/api/method"); xdr.onprogress = function () { //progress }; xdr.ontimeout = function () { //timeout }; xdr.onerror = function () { //error occurred }; xdr.onload = function() { //success(xdr.responsetext); } settimeout(function () { xdr.send(); }, 0); } note: the xdr.send() call is wrapped in a timeout (see window.settimeout() to prevent an issue with the interface where some requests are lost if multiple xdomainrequests are being sent at the same time.
... note: the xdr.onprogress event should always be defined, even as an empty function, or xdomainrequest may not fire onload for duplicate requests.
...if these do not match, the request will error "access is denied".
XMLHttpRequest() - Web APIs
const request = new xmlhttprequest(paramsdictionary); parameters (non-standard) objparameters there are two flags you can set: mozanon boolean: setting this flag to true will cause the browser not to expose the origin and user credentials when fetching resources.
... most important, this means that cookies will not be sent unless explicitly added using setrequestheader.
...this only works in privileged (reviewed) apps (bug 692677); it does not work on arbitrary webpages loaded in firefox ...
XMLHttpRequest.mozBackgroundRequest - Web APIs
note: this method is not available from web content.
... in cases in where a security dialog (such as authentication or a bad certificate notification) would normally be shown, this request fails instead.
... note: this property must be set before calling open().
XMLHttpRequest.multipart - 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.
... 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.overrideMimeType() - Web APIs
this may be used, for example, to force a stream to be treated and parsed as "text/xml", even if the server does not report it as such.
... note: if the server doesn't provide a content-type header, xmlhttprequest assumes that the mime type is "text/xml".
... if the content isn't valid xml, an "xml parsing error: not well-formed" error occurs.
XMLHttpRequest.responseText - Web APIs
syntax var resulttext = xmlhttprequest.responsetext; value a domstring which contains either the textual data received using the xmlhttprequest or null if the request failed or "" if the request has not yet been sent by calling send().
... while handling an asynchronous request, the value of responsetext always has the current content received from the server, even if it's incomplete because the data has not been completely received yet.
... exceptions invalidstateerror the xmlhttprequest.responsetype is not set to either the empty string or "text".
XMLHttpRequest.responseType - Web APIs
if the server returns data that is not compatible with the responsetype that was set, the value of response will be null.
... exceptions invalidaccesserror an attempt was made to change the value of responsetype on anxmlhttprequest which is in synchronous mode but not in a worker.
... usage notes synchronous xhr restrictions you cannot change the value of responsetype in a synchronous xmlhttprequest except when the request belongs to a worker.
XMLHttpRequest.responseXML - Web APIs
the xmlhttprequest.responsexml read-only property returns a document containing the html or xml retrieved by the request; or null if the request was unsuccessful, has not yet been sent, or if the data can't be parsed as xml or html.
... note: the name responsexml is an artifact of this property's history; it works for both html and xml.
... syntax var data = xmlhttprequest.responsexml; value a document from parsing the xml or html received using xmlhttprequest, or null if no data was received or if the data is not xml/html.
XMLHttpRequest.sendAsBinary() - Web APIs
warning: this method is obsolete and should not be used.
...prototype.sendasbinary) { xmlhttprequest.prototype.sendasbinary = function (sdata) { var nbytes = sdata.length, ui8data = new uint8array(nbytes); for (var nidx = 0; nidx < nbytes; nidx++) { ui8data[nidx] = sdata.charcodeat(nidx) & 0xff; } /* send as arraybufferview...: */ this.send(ui8data); /* ...or as arraybuffer (legacy)...: this.send(ui8data.buffer); */ }; } note: it's possible to build this polyfill putting two types of data as argument for send(): an arraybuffer (ui8data.buffer – the commented code) or an arraybufferview (ui8data, which is a typed array of 8-bit unsigned integers – uncommented code).
...another possible approach to send binary data is the stringview non native typed arrays superclass in conjunction with the send() method.
XPathResult.snapshotItem() - Web APIs
the snapshotitem() method of the xpathresult interface returns an item of the snapshot collection or null in case the index is not within the range of nodes.
... unlike the iterator result, the snapshot does not become invalid, but may not correspond to the current document if it is mutated.
... exceptions type_err in case xpathresult.resulttype is not unordered_node_snapshot_type or ordered_node_snapshot_type, an xpathexception of type type_err is thrown.
XRInputSource.handedness - Web APIs
the read-only xrinputsource property handedness indicates which of the user's hands the webxr input source is associated with, or if it's not associated with a hand at all.
...the value, which comes from the xrhandedness enumerated type, is one of the following: none the input controller is not associated with one of the user's hands.
... usage notes if the input source is not a device associated with a user's hand (whether by being held, attached, or worn), the value of handedness is none.
XRInputSource.profiles - Web APIs
note: the profiles list is always empty when the webxr session is in inline mode.
... usage notes input profile names an input profile name is a string describing a visual representation and behavior the input source may be configured to use.
... each string: has no spaces; instead, words are separated by hyphen ("-") characters if the platform makes it available, the usb vendor and product id may be provided but cannot be relied upon does not uniquely identify a specific device; rather, it identifies a configuration that the product is capable of using does not provide information about handedness of the device, if applicable the webxr input profiles registry is used by device developers and browser developers to attempt to ensure that a given device will report the same profile strings regardless of which browser or other user agent you use.
XRPermissionDescriptor.requiredFeatures - Web APIs
xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object.
... xrreferencespace usage notes examples in this example, permissions are checked to ensure that the user has granted permission for the site or app to use immersive augmented reality mode with the local-floor reference space (presumably since the user is unlikely to start to fly).
... let xrpermissiondesc = { name: "xr", mode: "immersive-ar", requiredfeatures: [ "local-floor" ] }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({state}) => { switch(state) { case "granted": setupxr(); break; case "prompt": promptandsetupxr(); break; default: /* do nothing otherwise */ break; } .catch(err) { console.log(err); } } else { setupxr(); } specifications specification status comment webxr device apithe definition of 'xrpermissiondescriptor.requiredfeatures' in that specification.
XRPermissionDescriptor - Web APIs
optionalfeatures an array of strings, each specifying the name of a webxr feature which is requested but not required for the app to function.
...and for any other returned state—which is almost certainly denied, which is the only other option as of this article's writing—we do nothing, since we can't use webxr.
... let xrpermissiondesc = { name: "xr", mode: "immersive-vr", requiredfeatures: [ "local-floor" ] }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({state}) => { switch(state) { case "granted": setupxr(); break; case "prompt": promptandsetupxr(); break; default: /* do nothing otherwise */ break; } .catch(err) { console.log(err); } } else { setupxr(); } specifications specification status comment webxr device apithe definition of 'xrpermissiondescriptor' in that specification.
XRRigidTransform.position - Web APIs
note: the w component of the point is always 1.0.
... if we're not in an immersive session, we instead request a viewer reference space.
...however, for inline sesions, we know we're in a space not automatically adjusted for floor level, so we request an offset reference space to shift the viewer's height to 1.5 meters above the presumed floor level of 0 meters.
XRSession.inputSources - Web APIs
keyboards, gamepads, and mice are not considered webxr input sources.
... note: traditional gamepad controllers are supported using the gamepad api.
... usage notes you can add a handler for the xrsession event inputsourceschange to be advised when the contents of the session's connected devices list changes.
XRSystem: devicechange event - Web APIs
note: not to be confused with the mediadevices devicechange event.
... bubbles no cancelable no interface event event handler xrsystem.ondevicechange usage notes devicechange events are not delivered if the document which owns the xrsystem object has been granted permission to do so through the xr-spatial-tracking feature policy.
... 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.
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
see the usage notes and examples for details.
... usage notes the scaling factor returned by this function will be 1.0 if the native resolution of the xr device and the resolution of the xr device match.
...this ensures that the scene we render will not only match the viewpoint we need to express (which is defined by the position and orientation data in the pose), but that the rendered output will be constrained within the correct portion of the frame buffer for the eye we're drawing, regardless of any scaling that is being performed.
XRWebGLLayer - Web APIs
properties antialias read only a boolean value indicating whether or not the webgl context's framebuffer supports anti-aliasing.
... ignoredepthvalues read only a boolean which indicates whether or not the webxr compositor should make use of the contents of the layer's depth buffer while compositing the scene.
...in current webxr implementations, 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.
XRWebGLLayerInit.antialias - Web APIs
if this property is missing or is false, anti-aliasing is not desired.
...if false, anti-aliasing is not desired.
... usage notes the state of anti-aliasing for the context after being created can be read from the xrwebgllayer property antialias.
XRWebGLLayerInit - Web APIs
otherwise, the color buffer will not have an alpha channel.
... ignoredepthvalues optional a boolean value which indicates whether or not to ignore the contents of the depth buffer while compositing the scene.
... examples given an xrsession, xrsession, and a webgl rendering context, gl, this snippet sets the rendering layer for the session, specifying the ignoredepthvalues option, indicating that the depth buffer should not be used (or should not exist at all), and that the only source for distance information of any given point is its position relative to the viewer.
XSLTProcessor - Web APIs
properties non-web-exposed properties the following properties are [chromeonly] and not exposed to web content: [chromeonly] attribute unsigned long xsltprocessor.flags flags that tweak the behavior of the processor.
... not reset by calling xsltprocessor.reset().
...<xsl:import> and document()) examples basic example advanced example additional example specifications not part of any specification.
msCaching - Web APIs
WebAPImsCaching
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.
... the mscaching read/write property specifies whether stream data downloaded using xmlhttprequestis cached to disk or not.
msGetPropertyEnabled - 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.
... return value type: boolean if false, the property is not enabled.
msWriteProfilerMark - 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.
... notes mswriteprofilermark enables you to inject dom based performance markers in addition to existing javascript api to learn exactly when parts of the page are being rendered, building a waterfall view for every one of our impressions showing latency per object, which can be useful for more accurately debugging real users perf issues.
msthumbnailclick - 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.
... syntax event property object.onmsthumbnailclick = handler; addeventlistener method object.addeventlistener("msthumbnailclick", handler, usecapture) general info synchronous no bubbles no cancelable no note the onmsthumbnailclick event is available only to documents that are launched from a pinned site shortcut.
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
note: opinions may differ on how assistive technology should handle this technique.
... the information provided below 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-orientation attribute - Accessibility
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.
... <a 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 presentation role - Accessibility
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: <ul role="tablist"> <li role="presentation"> <a role="tab" href="#">tab 1</a> </li> <li role="presentation"> <a role="tab" href="#">tab 2</a> </li> <li role="presentation"> <a role="tab" href="#">tab 3</a> </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 aria - 2.9 use of role=presentation or role=none: https://www.w3.org/tr/using-aria/#presentation ...
Using the radio role - Accessibility
possible effects on user agents and assistive technology note: opinons may differ on how assistive technology should handle this technique.
... the information provided above is one of those opinions and therefore not normative.
...dio" aria-checked="false"> <img role="presentation" src="radio-unchecked.gif" /> thai </li> <li id="r2" tabindex="-1" role="radio" aria-checked="false"> <img role="presentation" src="radio-unchecked.gif" /> subway </li> <li id="r3" tabindex="0" role="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 toolbar role - Accessibility
possible effects on user agents and assistive technology note: opinons 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: w3c toolbar example notes aria attributes used related aria techniques compatibility tbd: add support information for common ua and at product combinations additional resources ...
ARIA: timer role - Accessibility
while the value does not necessarily need to be machine parsable, it should continuously update at regular intervals unless the timer is paused or reaches its end-point.
... the timer role does not have a related html widget and xxx.
... the author of the timer must take full responsibility for not letting users get stuck in a focus limbo or trap focus inside something the user cannot exit of.
ARIA: banner role - Accessibility
if the header element technique is not being used for that banner, a declaration of role="banner" should be used to define a banner landmark to assistive technologies.
... assistive technologies can identify the main header element of a page as the banner if is a descendant of the body element, and not nested within an article, aside, main, nav or section subsection.
...vigation</p> </div> we could also have written the above with the html header element: <header> <a href="#nav" id="skiptomenu" class="skiptocontent">skip to keyboard navigation</a> <img src="images/w3c.png" alt="w3c logo"> <h1>aria landmarks</h1> <p>identifying page subsections for easy navigation</p> </header> best practices while it is best to use the header element and ensure it is not a descendant of any subsection of the page, sometimes you don't have access to the underlying html.
ARIA: Comment role - Accessibility
the comment landmark role semantically denotes a comment/reaction to some content on the page, or to a previous comment.
... multiple comments since aria-details can now accept multiple ids, we can associate multiple comments with the same annotation, like so: <p>the last half of the song is a slow-rising crescendo that peaks at the <mark aria-details="thread-1 thread-2">end of the guitar solo</mark>, before fading away sharply.</p> <div role="comment" id="thread-1" data-author="chris"> <h3>chris said</h3> <p class="comment-text">i really think this moment could use more cowbell.</p> <p><time datetime="2019-03-30t19:29">march 30 ...
...2019, 19:29</time></p> </div> <div role="comment" id="thread-2" data-author="chris"> <h3>marcus said</h3> <p class="comment-text">the guitar solo could do with a touch more chorus, and a slightly lower volume.</p> <p><time datetime="2019-03-29t15:35">march 29 2019, 15:35</time></p> </div> nested comments nested comments are also possible with aria annotations — simply nest the comments inside one another, like so: <div role="comment" id="thread-1" data-author="chris"> <h3>chris said</h3> <p class="comment-text">i really think this moment could use more cowbell.</p> <p><time datetime="2019-03-30t19:29">march 30 2019, 19:29</time></p> <div role="comment" data-author="marcus"> <h3>marcus replied</h3> <p class="comment-text">i don't know about that.
ARIA: figure role - Accessibility
the aria figure role can be used to identify a figure inside page content where appropriate semantics do not already exist.
...</figure> generally, you should reference the figure from the main text, but the figure need not be displayed at the same location as the referencing element.
... note: if at all possible in your work, you should use the appropriate semantic html elements to mark up a figure and its caption — <figure> and <figcaption>.
ARIA: gridcell role - Accessibility
<div role="gridcell" aria-colindex="1">debra</div> <div role="gridcell" aria-colindex="2">burks</div> <div role="gridcell" aria-colindex="5">new york</div> <div role="gridcell" aria-colindex="6">14127</div> </div> </div> … </div> describing the position of gridcells when the overall structure is unknown in situations where the table-style grouping of content does not provide information about the columns and rows, gridcells must have their positions programatically described by using aria-describedby.
... <td contenteditable="true">notes</td> <div role="gridcell" contenteditable="true">item cost</div> contenteditable will make the element it is applied to focusable via the tab key.
...note that if this attribute is provided, it applies only to the individual gridcell.
ARIA: Listitem role - Accessibility
group a collection of related objects, limited to list items when nested in a list, not important enough to have their own place in a pages table of contents.
...for example, our above example should be rewritten as follows: <ul> <li>list item 1</li> <li>list item 2</li> <li>list item 3</li> </ul> or use an ordered list if the order of the list items matters: <ol> <li>list item 1</li> <li>list item 2</li> <li>list item 3</li> </ol> note: the aria list/listitem roles don't distinguish 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.
ARIA: rowgroup role - Accessibility
note: using the native html table element (<table>) along with the table header (<thead>), footer (<tfoot>), and body (<tbody>) elements whenever possible is strongly encouraged.
...the columns are sortable, but not currently sorted, as indicated by the aria-sort property.
...because not all the rows are in the dom, we've included the aria-rowindex property on every row.
Keyboard - Accessibility
this includes users of screen readers, but can also include users who have trouble operating a pointing device such as a mouse or trackball, or whose mouse is not working at the moment, or who simply prefer to use a keyboard for input whenever possible.
... note: one important exception to this rule is if the element has role="document" applied to it, inside an interactive context (such as role="application").
... standard focusable elements such as links and input fields are given special styling by the browser by default, so you might not need to specify focus styling for such elements, unless you want the focus styling to be more distinctive.
-moz-context-properties - CSS: Cascading Style Sheets
note that if a color is set directly on the svg, but then the context color is also specified, the context color overrides the direct color.
... note: you can find a working example on github.
... specifications not part of any standard.
-moz-image-region - CSS: Cascading Style Sheets
note: for a system that works on any background, see -moz-image-rect().
...note: -moz-image-region only works with <image> elements where the icon is specified using list-style-image.
... it will not work with xul <image src="url" />.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax <shape> | autowhere <shape> = rect(<top>, <right>, <bottom>, <left>) examples clipping an image #example-button { /* display only the 4x4 area from the top left of this image */ list-style-image: url("chrome://example/skin/example.png"); -moz-image-region: rect(0px, 4px, 4px, 0px); } #example-button:hover { /* use the 4x4 area to the right of the first for the hovered button */ -moz-image-region: rect(0px, 8px, 4px, 4px); } specifications not part of any standard.
-moz-orient - CSS: Cascading Style Sheets
formal definition initial valueinlineapplies toany element; it has an effect on progress and meter, but not on <input type="range"> or other elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax inline | block | horizontal | vertical examples html <p> the following progress meter is horizontal (the default): </p> <progress max="100" value="75"></progress> <p> the following progress meter is vertical: </p> <progress class="vert" max="100" value="75"></progress> c...
...ss .vert { -moz-orient: vertical; width: 16px; height: 150px; } result specifications not part of any standard.
... though submitted to the w3c, with positive initial feedback, this property is not yet part of any specification; currently, this is a mozilla-specific extension (that is, -moz-orient).
-moz-outline-radius - CSS: Cascading Style Sheets
and:-moz-outline-radius-topleft: a length, percentage or calc();-moz-outline-radius-topright: a length, percentage or calc();-moz-outline-radius-bottomright: a length, percentage or calc();-moz-outline-radius-bottomleft: a length, percentage or calc(); formal syntax <outline-radius>{1,4} [ / <outline-radius>{1,4} ]?where <outline-radius> = <length> | <percentage> examples rounding an outline note: this example will not display the desired effect if you are viewing this in a browser other than firefox.
... html <p>this element has a rounded outline!</p> css p { margin: 5px; border: 1px solid black; outline: dotted red; -moz-outline-radius: 12% 1em 25px; } result notes dotted or dashed radiused corners were rendered as solid until firefox 50, bug 382721 future versions of gecko/firefox may drop this property completely.
... specifications not part of any standard.
-webkit-overflow-scrolling - CSS: Cascading Style Sheets
the -webkit-overflow-scrolling css property controls whether or not touch devices use momentum-based scrolling for a given element.
... formal definition initial valueautoapplies toscrolling boxesinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | touch examples html <div class="scroll-touch"> <p> this paragraph has momentum scrolling </p> </div> <div class="scroll-auto"> <p> this paragraph does not.
... </p> </div> css div { width: 100%; overflow: auto; } p { width: 200%; background: #f5f9fa; border: 2px solid #eaf2f4; padding: 10px; } .scroll-touch { -webkit-overflow-scrolling: touch; /* lets it scroll lazy */ } .scroll-auto { -webkit-overflow-scrolling: auto; /* stops scrolling immediately */ } results specifications not part of any standard.
-webkit-print-color-adjust - CSS: Cascading Style Sheets
formal definition value not found in db!
... formal syntax syntax not found in db!
... examples forcing white-on-black printing article { -webkit-print-color-adjust: exact; background: #222; color: #eee; } specifications not part of any standard, though there is a proposal in the csswg wiki to standardize it.
:-moz-first-node - CSS: Cascading Style Sheets
it differs from :first-child because it does not match a first-child element with (non-whitespace) text before it.
... note: any whitespace at the start of an element is ignored for the determination of :-moz-first-node.
... <span>this doesn't match because it's preceded by text.</span> </p> result specifications not part of any standard.
:-moz-user-disabled - CSS: Cascading Style Sheets
the :-moz-user-disabled css pseudo-class is a mozilla extension that matches elements representing images that were not loaded because images have been entirely disabled by the user's preferences.
... note: this selector is mainly intended to be used by theme developers.
... syntax :-moz-user-disabled examples styling user-disabled elements :-moz-user-disabled { background-color: lightgray; padding: 8px; } specifications not part of any standard.
:-moz-window-inactive - CSS: Cascading Style Sheets
note: prior to the addition of this pseudo-class, giving different styles to background windows was achieved by setting an attribute (active="true") on the top-level xul chrome window.
... syntax :-moz-window-inactive examples this example alters the appearance of a box's background depending on whether its window is active or not.
... specifications not part of any standard.
::-moz-color-swatch - CSS: Cascading Style Sheets
note: using ::-moz-color-swatch with anything but an <input type="color"> doesn't match anything and has no effect.
... syntax syntax not found in db!
... examples html <input type="color" value="#de2020" /> css input[type=color]::-moz-color-swatch { border-radius: 10px; border-style: none; } result specifications not part of any standard.
::-moz-focus-inner - CSS: Cascading Style Sheets
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!
...n 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; } result specifications not part of any standard.
::-webkit-scrollbar - CSS: Cascading Style Sheets
::-webkit-scrollbar-track-piece — the part of the track (progress bar) not covered by the handle.
... syntax syntax not found in db!
...</div> specifications not part of any standard.
::first-letter (:first-letter) - CSS: Cascading Style Sheets
the ::first-letter css pseudo-element applies styles to the first letter of the first line of a block-level element, but only when not preceded by other content (such as images or inline tables).
... /* selects the first letter of a <p> */ p::first-letter { font-size: 130%; } the first letter of an element is not always trivial to identify: punctuation that precedes or immediately follows the first letter is included in the match.
... css3 introduced the ::first-letter notation (with two colons) to distinguish pseudo-classes from pseudo-elements.
::first-line (:first-line) - CSS: Cascading Style Sheets
note that the length of the first line depends on many factors, including the width of the element, the width of the document, and the font size of the text.
... /* selects the first line of a <p> */ p::first-line { color: red; } css3 introduced the ::first-line notation (with two colons) to distinguish pseudo-classes from pseudo-elements.
...see what i mean?</p> <span>the first line of this text will not receive special styling because it is not a block-level element.</span> css ::first-line { color: blue; text-transform: uppercase; /* warning: do not use these */ /* many properties are invalid in ::first-line pseudo-elements */ margin-left: 20px; text-indent: 20px; } result specifications specification status comment css pseudo-elements level 4the...
:empty - CSS: Cascading Style Sheets
WebCSS:empty
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.
...--></p> </div> css body { display: flex; justify-content: space-around; } .box { background: pink; height: 80px; width: 80px; } .box:empty { background: lime; } result accessibility concerns assistive technology such as screen readers cannot parse interactive content that is empty.
:first-child - CSS: Cascading Style Sheets
/* selects any <p> that is the first element among its siblings */ p:first-child { color: lime; } note: as originally defined, the selected element had to have a parent.
... syntax :first-child examples basic example html <div> <p>this text is selected!</p> <p>this text isn't selected.</p> </div> <div> <h2>this text isn't selected: it's not a `p`.</h2> <p>this text isn't selected.</p> </div> css p:first-child { color: lime; background-color: black; padding: 5px; } result styling a list html <ul> <li>item 1</li> <li>item 2</li> <li>item 3 <ul> <li>item 3.1</li> <li>item 3.2</li> <li>item 3.3</li> </ul> </li> </ul> css ul li { color: blue; } ul li:first-child { color: red; font-weight: bold; } result specifications specification status comment selectors level 4the definition of ':first-child' in ...
... working draft matching elements are not required to have a parent.
:first-of-type - CSS: Cascading Style Sheets
/* selects any <p> that is the first element of its type among its siblings */ p:first-of-type { color: red; } note: as originally defined, the selected element had to have a parent.
...note that the universal selector (*) is implied when no simple selector is written.
... working draft matching elements are not required to have a parent.
:invalid - CSS: Cascading Style Sheets
WebCSS:invalid
people who have certain types of color blindness will be unable to determine the input's state unless it is accompanied by an additional indicator that does not rely on color to convey meaning.
... mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.1 | w3c understanding wcag 2.0 notes radio buttons if any one of the radio buttons in a group is required, the :invalid pseudo-class is applied to all of them if none of the buttons in the group is selected.
... (grouped radio buttons share the same value for their name attribute.) gecko defaults by default, gecko does not apply a style to the :invalid pseudo-class.
:lang() - CSS: Cascading Style Sheets
WebCSS:lang
/* selects any <p> in english (en) */ p:lang(en) { quotes: '\201c' '\201d' '\2018' '\2019'; } note: in html, the language is determined by a combination of the lang attribute, the <meta> element, and possibly by information from the protocol (such as http headers).
...note that this doesn't illustrate the only way to do this, and that the best method to use depends on the type of document.
... also note that unicode values are used to specify some of the special quote characters.
:last-child - CSS: Cascading Style Sheets
/* selects any <p> that is the last element among its siblings */ p:last-child { color: lime; } note: as originally defined, the selected element had to have a parent.
... syntax :last-child examples basic example html <div> <p>this text isn't selected.</p> <p>this text is selected!</p> </div> <div> <p>this text isn't selected.</p> <h2>this text isn't selected: it's not a `p`.</h2> </div> css p:last-child { color: lime; background-color: black; padding: 5px; } result styling a list html <ul> <li>item 1</li> <li>item 2</li> <li>item 3 <ul> <li>item 3.1</li> <li>item 3.2</li> <li>item 3.3</li> </ul> </li> </ul> css ul li { color: blue; } ul li:last-child { border: 1px solid red; color: red; } result specifications specification status comment selectors level 4the definition of ':last-child' in t...
... working draft matching elements are not required to have a parent.
:last-of-type - CSS: Cascading Style Sheets
/* selects any <p> that is the last element of its type among its siblings */ p:last-of-type { color: lime; } note: as originally defined, the selected element had to have a parent.
...note that the universal selector (*) is implied when no simple selector is written.
... working draft matching elements are not required to have a parent.
:nth-child() - CSS: Cascading Style Sheets
functional notation <an+b> represents elements in a list whose indices match those found in a custom pattern of numbers, defined by an+b, where: a is an integer step size, b is an integer offset, n is all positive integers, starting from 0.
...an>span</span> <em>this is an `em`.</em> <span>span</span> <span>span!</span> <span>span</span> <span>span!</span> <span>span</span> </div> <br> <h3><code>span:nth-of-type(2n+1)</code>, with an <code>&lt;em&gt;</code> among the child elements.</h3> <p>children 1, 4, 6, and 8 are selected.<br> 3 isn't used in the counting or selected because it is an <code>&lt;em&gt;</code>, not a <code>&lt;span&gt;</code>, and <code>nth-of-type</code> only selects children of that type.
... working draft adds of <selector> syntax and specifies that matching elements are not required to have a parent.
:nth-last-child() - CSS: Cascading Style Sheets
/* selects every fourth element among any group of siblings, counting backwards from the last one */ :nth-last-child(4n) { color: lime; } note: this pseudo-class is essentially the same as :nth-child, except it counts items backwards from the end, not forwards from the beginning.
... functional notation <an+b> represents elements whose numeric position in a series of siblings matches the pattern an+b, for every positive integer or zero value of n.
... working draft matching elements are not required to have a parent.
:nth-last-of-type() - CSS: Cascading Style Sheets
/* selects every fourth <p> element among any group of siblings, counting backwards from the last one */ p:nth-last-of-type(4n) { color: lime; } note: this pseudo-class is essentially the same as :nth-of-type, except it counts items backwards from the end, not forwards from the beginning.
... formal syntax :nth-last-of-type( <nth> )where <nth> = <an-plus-b> | even | odd examples html <div> <span>this is a span.</span> <span>this is another span.</span> <em>this is emphasized.</em> <span>wow, this span gets limed!!!</span> <strike>this is struck through.</strike> <span>here is one last span.</span> </div> css span:nth-last-of-type(2) { background-color: lime; } result specifications specification status comment selectors level 4the definition of ':nth-last-of-type' in that specification.
... working draft matching elements are not required to have a parent.
:target - CSS: Cascading Style Sheets
WebCSS:target
/* selects an element with an id matching the current url's fragment */ :target { border: 2px solid black; } for example, the following url has a fragment (denoted by the # sign) that points to an element called section2: http://www.example.com/index.html#section2 the following element would be selected by a :target selector when the current url is equal to the above: <section id="section2">example</section> syntax :target examples a table of contents the :target pseudo-class can be used to highlight the portion of a page that has been linked to from a table of contents.
...click on the link above to try out!</p> <p id="p2">this is <i>another paragraph</i>, also accessible from the links above.
... note: a more complete pure-css lightbox based on the :target pseudo-class is available on github (demo).
:where() - CSS: Cascading Style Sheets
WebCSS:where
note: you can also find this example on github; see is-where.
...to change preferences in chrome, visit chrome://flags.edge no support nofirefox full support 78 full support 78 full support 77notes disabled notes enabled by default in firefox nightly.disabled from version 77: this feature is behind the layout.css.is-where-selectors.enabled preference (needs to be set to enabled).
...oopera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
fallback - CSS: Cascading Style Sheets
the fallback descriptor can be used to specify a counter style to fall back to if the current counter style cannot create a marker representation for a particular counter value.
...if a valid fallback style is not specified, it defaults to decimal.
... when the fixed system is used and there are not enough symbols to cover all the list items, the fallback style will be used for the rest of the list items.
speak-as - CSS: Cascading Style Sheets
<counter-style-name> the name of another counter style, specified as a <custom-ident>.
...if the specified style does not exist, speak-as defaults to auto.
...do not rely on it to convey information critical to understanding the page's purpose.
font-display - CSS: Cascading Style Sheets
font block period if the font face is not loaded, any element attempting to use it must render an invisible fallback font face.
... font swap period if the font face is not loaded, any element attempting to use it must render a fallback font face.
... font failure period if the font face is not loaded, the user agent treats it as a failed load causing normal font fallback.
-ms-high-contrast - CSS: Cascading Style Sheets
it does not accept min/max prefixes.
... formal syntax syntax not found in db!
... specifications not part of any standard.
@viewport - CSS: Cascading Style Sheets
WebCSS@viewport
note: see https://github.com/w3c/csswg-drafts/issues/4766 for discussion around @viewport's removal from the standards track.
... @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.
... user-zoom controls whether or not the user should be able to change the zoom factor.
Box alignment in Multi-column Layout - CSS: Cascading Style Sheets
note: multi-column layout predates the box alignment specification.
... and the properties listed here, while specified for multicol, may not be supported in browsers.
...while other layout methods treat the initial value of column-gap as 0 multicol treats it as 1em, as in general you would not want to have no gap between columns.
Mastering margin collapsing - CSS: Cascading Style Sheets
note that the margins of floating and absolutely positioned elements never collapse.
... some things to note: more complex margin collapsing (of more than two margins) occurs when the above cases are combined.
... these rules apply even to margins that are zero, so the margin of a descendant ends up outside its parent (according to the rules above) whether or not the parent's margin is zero.
Flow Layout and Writing Modes - CSS: Cascading Style Sheets
this is not a comprehensive guide to the use of writing modes in css, the aim here is to document the areas where flow layout interacts with writing modes in possibly unanticipated ways.
... replaced elements replaced elements such as images will not change their orientation based on the writing-mode property.
...in vertical-lr it controls the size in the block direction because it does not rotate with the text.
In Flow and Out of Flow - CSS: Cascading Style Sheets
you cannot apply anything to the following in-flow content to achieve that.
...out of flow essentially means that the other elements on your page no longer know that element exists so will not respond to it.
...whether that involves clearing floats, or ensuring that an element with position: absolute does not sit on top of some other content.
Using CSS gradients - CSS: Cascading Style Sheets
the second example does not contain the hint to hilight the difference the color hint can make: <div class="colorhint-gradient"></div> <div class="regular-progression"></div> div { width: 120px; height: 120px; float: left; margin-right: 10px; box-sizing: border-box; } .colorhint-gradient { background: linear-gradient(to top, black, 20%, cyan); } .regular-progression { background: linear-gradient(to top, bla...
... the conic-gradient syntax is similar to the radial-gradient syntax, but the color-stops are placed around a gradient arc, the circumference of a circle, rather than on the gradient line emerging from the center of the gradient, and the color-stops are percentages or degrees: absolute lengths are not valid.
...if neither is declared, the gradient line is 100% meaning the linear and conic gradients will not repeat and the radial gradient will only repeat if the radius of the gradient is smaller than the length between the center of the gradient and the farthest corner.
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
the grid doesn't look the same however, as the width assigned to the container is a horizontal measure, a measure tied to the physical and not the logical or flow relative running of the text.
... there are then a group of properties which do not have a direct mapping in terms of existing physical properties.
... note: the css working group are currently trying to 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.
Using z-index - CSS: Cascading Style Sheets
if you are not familiar with the z-axis, imagine the page as a stack of layers, each one having a number.
... top layer (closest to the observer) notes: when no z-index property is specified, elements are rendered on the default rendering layer 0 (zero).
...the z-index of element #5 has no effect since it is not a positioned element.
Stacking context example 2 - CSS: Cascading Style Sheets
the reason is that they do not belong to the same stacking context.
... to better understand the situation, this is the stacking context hierarchy: root stacking context div #2 (z-index 2) div #3 (z-index 1) div #4 (z-index 10) note: it is worth remembering that in general the html hierarchy is different from the stacking context hierarchy.
... in the stacking context hierarchy, elements that do not create a stacking context are collapsed on their parent.
Understanding CSS z-index - CSS: Cascading Style Sheets
stacking without the z-index property: the stacking rules that apply when z-index is not used.
... the stacking context: notes on the stacking context.
... last updated date: july 9, 2005 author's note: thanks to wladimir palant and rod whiteley for the review.
CSS Ruby Layout - CSS: Cascading Style Sheets
WebCSSCSS Ruby
css ruby layout is a module of css that provides the rendering model and formatting controls related to the display of ruby annotation.
... ruby annotation is a form of interlinear annotation, consisting of short runs of text alongside the base text.
... they are typically used in east asian documents to indicate pronunciation or to provide a short annotation.
Basic concepts of CSS Scroll Snap - CSS: Cascading Style Sheets
the proximity keyword means that it may snap to the point, but does not have to.
... padding the scroll container if you do not want the content to snap right to the edge of the scroll container you can use the scroll-padding property or its equivalent longhand values to set some padding.
... note: the scroll-snap-stop property is currently marked at risk in the current candidate recommendation spec, therefore it may be removed.
Inline formatting context - CSS: Cascading Style Sheets
this box will be large enough to contain all of the inline boxes in that line; when there is no more room in the inline direction another line will be created.
... note: i am using the logical, flow-relative properties — padding-inline-start rather than padding-left — so that they work in the inline dimension whether the text is horizontal or vertical.
... alignment in the block direction inline boxes may be aligned in the block direction in different ways, using the vertical-align property, which will align on the block axis in vertical writing modes (therefore not vertically at all!).
Card - CSS: Cascading Style Sheets
note: the various elements in separate cards do not align with each other, as each card is an independent grid.
... useful fallbacks or alternative methods flexbox could be used to lay out the card, in which case you should make the content area grow, and other items not grow.
...alternatively you could use css multi-col — this would cause the cards to lay out down the columns, which may or may not be a problem.
Center an element - CSS: Cascading Style Sheets
in this recipe you will see how to center one box inside another.
... requirements to place an item into the center of another box horizontally and vertically.
... recipe download this example choices made to center one box inside another we make the containing box a flex container.
Testing media queries programmatically - CSS: Cascading Style Sheets
once you've created a mediaquerylist object, you can check the result of the query or receive notifications when the result changes.
...evice is in landscape or portrait orientation: const mediaquerylist = window.matchmedia("(orientation: portrait)"); checking the result of a query once you've created your media query list, you can check the result of the query by looking at the value of its matches property: if (mediaquerylist.matches) { /* the viewport is currently in portrait orientation */ } else { /* the viewport is not currently in portrait orientation, therefore landscape */ } receiving query notifications if you need to be aware of changes to the evaluated result of the query on an ongoing basis, it's more efficient to register a listener than to poll the query's result.
... ending query notifications to stop receiving notifications about changes to the value of your media query, call removelistener() on the mediaquerylist, passing it the name of the previously-defined callback function: mediaquerylist.removelistener(handleorientationchange); ...
Pseudo-elements - CSS: Cascading Style Sheets
*/ p::first-line { color: blue; text-transform: uppercase; } note: in contrast to pseudo-elements, pseudo-classes can be used to style an element based on its state.
... note: as a rule, double colons (::) should be used instead of a single colon (:).
...however, since this distinction was not present in older versions of the w3c spec, most browsers support both syntaxes for the original pseudo-elements.
Replaced elements - CSS: Cascading Style Sheets
put in simpler terms, they're elements whose contents are not 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.
... note that some replaced elements, but not all, have intrinsic dimensions or a defined baseline, which is used by some css properties, such as vertical-align.
all - CSS: Cascading Style Sheets
WebCSSall
it can set properties to their initial or inherited values, or to the values specified in another stylesheet origin.
...note that none of these values affect the unicode-bidi and direction properties.
... unset specifies that all the element's properties should be changed to their inherited values if they inherit by default, or to their initial values if not.
animation-delay - CSS: Cascading Style Sheets
note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are.
...etanimation-delaychrome full support 43 full support 43 full support 3prefixed prefixed implemented with the vendor prefix: -webkit-edge full support 12firefox full support 16notes full support 16notes notes before firefox 57, firefox does not repaint elements outside the viewport that are animated into the viewport with a delay.
...-webkit-samsung internet android full support 4.0 full support 4.0 full support 1.0prefixed prefixed implemented with the vendor prefix: -webkit-legend full support full supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.requires a vendor prefix or different name for use.requires a vendor prefix or different name for use.
border-bottom - CSS: Cascading Style Sheets
as with all shorthand properties, border-bottom always sets the values of all of the properties that it can set, even if they are not specified.
... it sets those that are not specified to their default values.
...since the default value of border-bottom-style is none, not specifying the border-style part results in no border.
border-image-width - CSS: Cascading Style Sheets
must not be negative.
...must not be negative.
...if the image does not have the required intrinsic dimension, the corresponding border-width is used instead.
border-left - CSS: Cascading Style Sheets
as with all shorthand properties, border-left always sets the values of all of the properties that it can set, even if they are not specified.
... it sets those that are not specified to their default values.
...since the default value of border-left-style is none, not specifying the border-style part results in no border.
border-right - CSS: Cascading Style Sheets
as with all shorthand properties, border-right always sets the values of all of the properties that it can set, even if they are not specified.
... it sets those that are not specified to their default values.
...since the default value of border-right-style is none, not specifying the border-style part results in no border.
border-top - CSS: Cascading Style Sheets
as with all shorthand properties, border-top always sets the values of all of the properties that it can set, even if they are not specified.
... it sets those that are not specified to their default values.
...since the default value of border-top-style is none, not specifying the border-style part results in no border.
box-flex-group - CSS: Cascading Style Sheets
elements do not shrink below their minimum widths.
...usage example in the original flexbox spec, box-flex-group could be used to assign flex children to different groups to distribute flexible space between: article:nth-child(1) { -webkit-box-flex-group: 1; } article:nth-child(2) { -webkit-box-flex-group: 2; } this was only ever supported in webkit-based browsers, with a prefix, and in subsequent versions of the spec this functionality does not have an equivalent.
... specifications not part of any standard.
column-count - CSS: Cascading Style Sheets
12 full support 12 full support 12prefixed prefixed implemented with the vendor prefix: -webkit-firefox full support 52 full support 52 no support 1.5 — 74prefixed notes prefixed implemented with the vendor prefix: -moz-notes prior to version 37, multiple columns didn't work with display: table-caption elements.ie full support 10opera full support 11.1 full support 11.1 full support 1...
... 50 full support 50 full support 18prefixed prefixed implemented with the vendor prefix: -webkit-firefox android full support 52 full support 52 full support 4prefixed notes prefixed implemented with the vendor prefix: -moz-notes prior to version 37, multiple columns didn't work with display: table-caption elements.opera android full support 11.1 full support 11.1 full support 14prefixed prefixed implemented with the vendor prefix: ...
...-webkit-samsung internet android full support 5.0 full support 5.0 full support 1.0prefixed prefixed implemented with the vendor prefix: -webkit-legend full support full supportsee implementation notes.see implementation notes.requires a vendor prefix or different name for use.requires a vendor prefix or different name for use.
counter-increment - CSS: Cascading Style Sheets
note: the counter's value can be reset to an arbitrary number using the counter-reset css property.
... syntax /* increment "my-counter" by 1 */ counter-increment: my-counter; /* decrement "my-counter" by 1 */ counter-increment: my-counter -1; /* increment "counter1" by 1, and decrement "counter2" by 4 */ counter-increment: counter1 counter2 -4; /* do not increment/decrement anything: used to override less specific rules */ counter-increment: none; /* global values */ counter-increment: inherit; counter-increment: initial; counter-increment: unset; the counter-increment property is specified as either one of the following: a <custom-ident> naming the counter, followed optionally by an <integer>.
...defaults to 1 if not specified.
direction - CSS: Cascading Style Sheets
WebCSSdirection
note that text direction is usually defined within a document (e.g., with html's dir attribute) rather than through direct use of the direction property.
... unlike the dir attribute in html, the direction property is not inherited from table columns into table cells, since css inheritance follows the document tree, and table cells are inside of rows but not inside of columns.
... the direction and unicode-bidi properties are the two only properties which are not affected by the all shorthand property.
drop-shadow() - CSS: Cascading Style Sheets
note: this function is somewhat similar to the box-shadow property.
... syntax drop-shadow(offset-x offset-y blur-radius color) the drop-shadow() function accepts a parameter of type <shadow> (defined in the box-shadow property), with the exception that the inset keyword and spread parameters are not allowed.
...negative values are not allowed.
font-optical-sizing - CSS: Cascading Style Sheets
syntax /* keyword values */ font-optical-sizing: none; font-optical-sizing: auto; /* default */ /* global values */ font-optical-sizing: inherit; font-optical-sizing: initial; font-optical-sizing: unset; values none the browser will not modify the shape of glyphs for optimal viewing.
... 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.
font-style - CSS: Cascading Style Sheets
when the specified style is not available, both italic and oblique faces are simulated by artificially sloping the glyphs of the regular face (use font-synthesis to control this behavior).
...if an angle is not specified, an angle of 14 degrees is used.
... 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> </div> css /* amstelvaralpha-vf is created by david berlow (https://github.com/typenetwork/amstelvar) and is used here under the terms of its license: https://github.com/typenetwork/amstelvar/blob/master/ofl.txt */ @font-face { src: url('https://mdn.mozillademos.org/files/160...
<frequency-percentage> - CSS: Cascading Style Sheets
the pitch of a speaking voice, are not currently used in any css properties.
... examples valid percentage values 90% positive percentage +90% positive percentage with leading + -90% negative percentage — not valid for all properties that use percentages invalid percentage values 90 % no space is allowed between the number and the unit valid frequency values 12hz positive integer 4.3hz non-integer 14khz the unit is case-insensitive, though non-si capitalization is not recommended.
... +0hz zero, with a leading + and a unit -0khz zero, with a leading - and a unit invalid frequency values 12.0 this is a <number>, not an <frequency>, because it is missing a unit.
grid-template-columns - CSS: Cascading Style Sheets
when appearing outside a minmax() notation, it implies an automatic minimum (i.e.
... minmax(min, max) is a functional notation that defines a size range greater than or equal to min and less than or equal to max.
... note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties.
grid-template-rows - CSS: Cascading Style Sheets
when appearing outside a minmax() notation, it implies an automatic minimum (i.e.
... minmax(min, max) is a functional notation that defines a size range, greater than or equal to min, and less than or equal to max.
... note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties.
grid-template - CSS: Cascading Style Sheets
sets grid-template-areas to the strings listed, grid-template-rows to the track sizes following each string (filling in auto for any missing sizes), and splicing in the named lines defined before/after each size, and grid-template-columns to the track listing specified after the slash (or none, if not specified).
... note: the repeat() function isn’t allowed in these track listings, as the tracks are intended to visually line up one-to-one with the rows/columns in the “ascii art”.
... note: the grid shorthand accepts the same syntax, but also resets the implicit grid properties to their initial values.
image-orientation - CSS: Cascading Style Sheets
it should not be used for any other orientation adjustments; instead, the transform property should be used with the rotate <transform-function>.
...will not apply any additional image rotation; the image is oriented as encoded or as other css property values dictate.
...it should not be used for arbitrary rotations.
left - CSS: Cascading Style Sheets
WebCSSleft
for relatively positioned elements, the distance of the element from its normal position is based on the right property; or if right is also auto, the element is not moved horizontally at all.
... inherit specifies that the value is the same as the computed value from its parent element (which might not be its containing block).
...if the element cannot stretch to satisfy both, the position of the element is overspecified.
linear-gradient() - CSS: Cascading Style Sheets
the order of the side keywords does not matter.
... note: rendering of color stops in css gradients follows the same rules as color stops in svg gradients.
... note also that the first example above does not exactly render as depicted in mozilla firefox (particularly version 80.0b3).
list-style - CSS: Cascading Style Sheets
note: this property is applied to list items, i.e., elements with display: list-item; .
... accessibility concerns safari has an issue whereby unordered lists with a list-style value of none applied to them will not be recognized as a list in the accessibility tree.
...this ensures the design is unaffected by the bug fix and that list items are not improperly described.
margin-trim - CSS: Cascading Style Sheets
syntax none margins are not trimmed by the container.
...it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax none | in-flow | all examples basic usage once support is implemented for this property, it will probably work like so: when you've got a container with some inline children and you want to put a margin between each child but not have it interfere with the spacing at the end of the row, you might do something like this: article { background-color: red; margin: 20px; padding: 20px; display: inline-block; } article > span { background-color: black; color: white; text-align: center; padding: 10px; margin-right: 20px; } the problem here is that you'd end up with 20px too much spacing at the right of the r...
...ow, so you'd maybe do this to fix it: span:last-child { margin-right: 0; } it is a pain having to write another rule to achieve this, and it is also not very flexible.
margin - CSS: Cascading Style Sheets
WebCSSmargin
note: margins create extra space around an element.
... /* right: 3px margin */ /* bottom: 30px margin */ /* left: 5px margin */ margin: 2em auto; /* top and bottom: 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.
mask-border-slice - CSS: Cascading Style Sheets
for vector images, the number is relative to the element's size, not the size of the source image, so percentages are generally preferable in these cases.
... 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 working example (using the out-of-date prefixed border mask properties supported in chromium), so you can get an idea of the effect.
... note: the fill keyword needs to be included if you want the element's content to be visible.
max-block-size - CSS: Cascading Style Sheets
any time you would normally use max-height or max-width, you should instead use max-block-size to set the maximum "height" of the content (even though this may not be a vertical value) and max-inline-size to set the maximum "width" of the content (although this may instead be vertical rather than horizontal).
...some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, i thought i would sail about a little and see the watery part of the world.
...some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, i thought i would sail about a little and see the watery part of the world.
mix-blend-mode - CSS: Cascading Style Sheets
valueas specifiedanimation typediscretecreates stacking contextyes formal syntax <blend-mode>where <blend-mode> = normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity examples effect of different mix-blend-mode values <div class="grid"> <div class="col"> <div class="note">blending in isolation (no blending with the background)</div> <div class="row isolate"> <div class="cell"> normal <div class="container normal"> <div class="group"> <div class="item firefox"></div> <svg viewbox="0 0 150 150"> <defs> <lineargradient id="red"> <stop offset="0" stop-color="hsl(0,...
...ss="item firefox"></div> <svg viewbox="0 0 150 150"> <ellipse class="item r" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item g" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item b" cx="75" cy="75" rx="25" ry="70"></ellipse> </svg> </div> </div> </div> </div> <div class="note">blending globally (blend with the background)</div> <div class="row"> <div class="cell"> normal <div class="container normal"> <div class="group"> <div class="item firefox"></div> <svg viewbox="0 0 150 150"> <ellipse class="item r" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item g" cx="75" cy="75" rx...
...border-box; background: #eee; } .grid { width: 100%; display: flex; font: 1em monospace; } .row { display: flex; flex: 1 auto; flex-direction: row; flex-wrap: wrap; height: auto; } .col { display: flex; flex: 1 auto; flex-direction: column; height: auto; } .cell { margin: .5em; padding: .5em; background-color: #fff; overflow: hidden; text-align: center; } .note { background: #fff3d4; padding: 1em; margin: .5em .5em 0; font: .8em sans-serif; text-align: left; white-space: nowrap; } .note + .row .cell { margin-top: 0; } .container { position: relative; background: linear-gradient(to right, #000 0%, transparent 50%, #fff 100%), linear-gradient(to bottom, #ff0 0%, #f0f 50%, #0ff 100%); width: 150px; height: 150px; ma...
offset-path - CSS: Cascading Style Sheets
an offset path is either a specified path with one or multiple sub-paths or the geometry of a not-styled basic shape.
...it was changed to offset-path because the property describes static positions, not motion.
... svg the top and bottom halves of the scissors would appear in the top left of the canvas were they not positioned along the starting point of the motion path defined by offset-path.
opacity - CSS: Cascading Style Sheets
WebCSSopacity
description opacity applies to the element as a whole, including its contents, even though the value is not inherited by child elements.
... thus, the element and its children all have the same opacity relative to the element's background, even if they have different opacities relative to one another.
... if you do not want to apply opacity to child elements, use the background property instead.
order - CSS: Cascading Style Sheets
WebCSSorder
syntax /* <integer> values */ order: 5; order: -5; /* global values */ order: inherit; order: initial; order: unset; since order is only meant to affect the visual order of elements and not their logical or tab order.
... order must not be used on non-visual media such as speech.
...if the visual (css) order is important, then screen reader users will not have access to the correct reading order.
outline - CSS: Cascading Style Sheets
WebCSSoutline
the order of the values does not matter.
... note: the outline will be invisible for many elements if its style is not defined.
...a notable exception is input elements, which are given default styling by browsers.
Guide to scroll anchoring - CSS: Cascading Style Sheets
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.
... 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 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.
overflow-block - CSS: Cascading Style Sheets
this may be nothing, a scroll bar, or the overflow content.
... values visible content is not clipped and may be rendered outside the padding box's block start and block end edges.
...browsers display scrollbars whether or not any content is actually clipped.
overflow-inline - CSS: Cascading Style Sheets
this may be nothing, a scroll bar, or the overflow content.
... values visible content is not clipped and may be rendered outside the padding box's inline start and end edges.
...browsers display scrollbars whether or not any content is actually clipped.
overscroll-behavior-block - CSS: Cascading Style Sheets
underlying elements will not scroll.
... by default, when the inner box is scrolled and a scroll boundary is reached, the whole page will begin to scroll, which is probably not what we want.
... html <main> <div> <div> <p><code>overscroll-behavior-block</code> has been used to make it so that when the scroll boundaries of the yellow inner box are reached, the whole page does not begin to scroll.</p> </div> </div> </main> css main { height: 3000px; width: 500px; background-color: white; background-image: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 19px, rgba(0,0,0,0.5) 20px); } main > div { height: 300px; width: 400px; overflow: auto; position: relative; top: 50px; left: 50px; overscroll-behavior-block: contain; } div > div { height: 1500px; width: 100%; background-color: yellow; background-image...
overscroll-behavior-inline - CSS: Cascading Style Sheets
underlying elements will not scroll.
... by default, when the inner box is scrolled and a scroll boundary is reached, the whole page will begin to scroll, which is probably not what we want.
... html <main> <div> <div> <p><code>overscroll-behavior-inline</code> has been used to make it so that when the scroll boundaries of the yellow inner box are reached, the whole page does not begin to scroll.</p> </div> </div> </main> css main { height: 400px; width: 3000px; background-color: white; background-image: repeating-linear-gradient(to right, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 19px, rgba(0,0,0,0.5) 20px); } main > div { height: 300px; width: 400px; overflow: auto; position: relative; top: 50px; left: 50px; overscroll-behavior-inline: contain; } div > div { height: 100%; width: 1500px; background-color: yellow; background-im...
page-break-after - CSS: Cascading Style Sheets
user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | always | avoid | left | right | recto | verso examples setting a page break after footnotes /* move to a new page after footnotes */ div.footnotes { page-break-after: always; } specifications specification status comment css logical properties and values level 1the definition of 'recto and verso' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpage-break-afterchrome full support 1edge full support 12firefox full support 1notes full support 1notes notes the values avoid, left, and right are unsupported.ie full support 4opera full support 7safari full support 1.2webview android full support 37chro...
...me android full support 18firefox android full support 4notes full support 4notes notes the values avoid, left, and right are unsupported.opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full supportsee implementation notes.see implementation notes.
page-break-before - CSS: Cascading Style Sheets
user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | always | avoid | left | right | recto | verso examples avoid a page break before the dic /* avoid page break before the div */ div.note { page-break-before: avoid; } specifications specification status comment css logical properties and values level 1the definition of 'recto and verso' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpage-break-beforechrome full support 1edge full support 12firefox full support 1notes full support 1notes notes the values avoid, left, and right are unsupported.ie full support 4opera full support 7safari full support 1.2webview android full support 37chro...
...me android full support 18firefox android full support 4notes full support 4notes notes the values avoid, left, and right are unsupported.opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full supportsee implementation notes.see implementation notes.
paint-order - CSS: Cascading Style Sheets
when one value is specified, that one is painted first, followed by the other two in their default order relative to one another.
... note: in the case of this property, markers are only appropriate when drawing svg shapes involving the use of the marker-* properties (e.g.
...they do not apply to html text, so in that case, you can only determine the order of stroke and fill.
<percentage> - CSS: Cascading Style Sheets
note: only calculated values can be inherited.
... thus, even if a percentage value is used on the parent property, a real value (such as a width in pixels for a <length> value) will be accessible on the inherited property, not the percentage value.
...optionally, it may be preceded by a single + or - sign, although negative values are not valid for all properties.
repeating-radial-gradient() - CSS: Cascading Style Sheets
note: early implementations of this function included other keywords (cover and contain) as synonyms of the standard farthest-corner and closest-side, respectively.
...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.
scroll-margin-inline - CSS: Cascading Style Sheets
the aim here is to create four horizontally-scrolling blocks, the second and third of which snap into place, near but not quite at the right of each block.
...the outer container is styled like this: .scroller { text-align: left; width: 250px; height: 250px; overflow-x: scroll; display: flex; box-sizing: border-box; border: 1px solid #000; scroll-snap-type: x mandatory; } the main parts relevant to the scroll snapping are overflow-x: scroll, which makes sure the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point.
... note: here we are setting scroll-margin on the start and end of the inline axis (x in our case), but only the end edge is really relevant.
scroll-margin - CSS: Cascading Style Sheets
the aim here is to create four horizontally-scrolling blocks, the second and third of which snap into place, near but not quite at the left of each block.
...the outer container is styled like this: .scroller { text-align: left; width: 250px; height: 250px; overflow-x: scroll; display: flex; box-sizing: border-box; border: 1px solid #000; scroll-snap-type: x mandatory; } the main parts relevant to the scroll snapping are overflow-x: scroll, which makes sure the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point.
... note: here we are setting scroll-margin on all sides at once, but only the start edge is really relevant.
shape-outside - CSS: Cascading Style Sheets
note: user agents must use the potentially cors-enabled fetch method defined by the html5 specification for all urls in a shape-outside value.
...if list values are not one of those types but are identical (such as finding nonzero in the same list position in both lists), those values do interpolate.
...sometimes you don't notice.
text-decoration-color - CSS: Cascading Style Sheets
css does not provide a direct mechanism for specifying a unique color for each line type.
... color alone should not be used to convey meaning.
... for example, change of text and text-decoration-color alone is not enough to indicate a link has focus.
text-decoration - CSS: Cascading Style Sheets
the style rule em { text-decoration: none; } would not cause any change; the entire paragraph would still be underlined.
...{ text-decoration: none; } .underover { text-decoration: dashed underline overline; } .thick { text-decoration: solid underline purple 4px; } .blink { text-decoration: blink; } <p class="under">this text has a line underneath it.</p> <p class="over">this text has a line over it.</p> <p class="line">this text has a line 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.
text-size-adjust - CSS: Cascading Style Sheets
/* keyword values */ text-size-adjust: none; text-size-adjust: auto; /* <percentage> value */ text-size-adjust: 80%; /* global values */ text-size-adjust: inherit; text-size-adjust: initial; text-size-adjust: unset; because many websites have not been developed with small devices in mind, mobile browsers differ from desktop browsers in the way they render web pages.
...the text-size-adjust property allows web authors to disable or modify this behavior, as web pages designed with small screens in mind do not need it.
... formal definition initial valueauto for smartphone browsers supporting inflation, none in other cases (and then not modifiable).applies toall elementsinheritedyespercentagesyes, refer to the corresponding size of the text fontcomputed valueas specifiedanimation typediscrete formal syntax none | auto | <percentage> examples basic disabling usage as hinted at above, on a properly designed responsive site the text-size-adjust behavior is not needed, so developers can elect to turn it off by specifying a vlau...
matrix() - CSS: Cascading Style Sheets
note: matrix(a, b, c, d, tx, ty) is a shorthand for matrix3d(a, b, 0, 0, c, d, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1).
...the constant values are implied and not passed as parameters; the other parameters are described in the column-major order.
... note: until firefox 16, gecko accepted a <length> value for tx and ty.
matrix3d() - CSS: Cascading Style Sheets
note: until firefox 16, gecko accepted a <length> value for a4, b4 and c4.
... a generic 3d affine transformation can't be represented using a cartesian-coordinate matrix, as translations are not linear transformations.
...ckground: rgba(210,0,0,.7); transform: rotatey(90deg) translatez(50px); } .left { background: rgba(0,0,210,.7); transform: rotatey(-90deg) translatez(50px); } .top { background: rgba(210,210,0,.7); transform: rotatex(90deg) translatez(50px); } .bottom { background: rgba(210,0,210,.7); transform: rotatex(-90deg) translatez(50px); } result matrix translation and scale example another transform3d() example, which implements an animated combined translate and scale.
rotateX() - CSS: Cascading Style Sheets
note: rotatex(a) is equivalent to rotate3d(1, 0, 0, a).
... note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative.
...a positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one.
rotateY() - CSS: Cascading Style Sheets
note: rotatey(a) is equivalent to rotate3d(0, 1, 0, a).
... note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative.
...a positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one.
rotateZ() - CSS: Cascading Style Sheets
note: rotatez(a) is equivalent to rotate(a) or rotate3d(0, 0, 1, a).
... note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative.
...a positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one.
translateZ() - CSS: Cascading Style Sheets
note: translatez(tz) is equivalent to translate3d(0, 0, tz).
... a translation is not a linear transformation in ℝ3 and can't be represented using a cartesian-coordinate matrix.
... note if the perspective() value is less than the translatez() value, such as transform: perspective(200px) translatez(300px); the transformed element will not be visible as it is further than the user's viewport.
transform-style - CSS: Cascading Style Sheets
if flattened, the element's children will not exist on their own in the 3d-space.
... as this property is not inherited, it must be set for all non-leaf descendants of the element.
...in this alternative state, the cube faces are all flattened onto the plane of their parent, and you might not be able to see them at all, depending on the browser you are using.
var() - CSS: Cascading Style Sheets
WebCSSvar
the var() css function can be used to insert the value of a custom property (sometimes called a "css variable") instead of any part of a value of another property.
... the var() function cannot be used in property names, selectors or anything else besides property values.
...) note: the syntax of the fallback, like that of custom properties, allows commas.
vertical-align - CSS: Cascading Style Sheets
eline</td> <td style="vertical-align: top">top</td> <td style="vertical-align: middle">middle</td> <td style="vertical-align: bottom">bottom</td> <td> <p>there is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.</p> <p>there is another theory which states that this has already happened.</p> </td> </tr> </table> table { 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 elem...
...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.
... for elements that do not have a baseline, the bottom margin edge is used instead.
will-change - CSS: Cascading Style Sheets
it should not be used to anticipate performance problems.
...it should not be used to anticipate performance problems.
...it cannot be one of the following values: unset, initial, inherit, will-change, auto, scroll-position, or contents.
Making content editable - Developer guides
note: in firefox 63 beta/dev edition, some of the rich-text editing features have been disabled by default, for better cross-browser compatibility.
... note: internet explorer, which is no longer being developed, uses <p> elements instead of <div>.
...x4xd5r+b0ddaenbxbhbhn2dgwdaqfjjyvhcqyrfgoidgiqjawtcqmriwwmfgicnvcaaamoak+blaortluyt7i5uiuhads=" /> </div> <div id="textbox" contenteditable="true"><p>lorem ipsum</p></div> <p id="editmode"><input type="checkbox" name="switchmode" id="switchbox" onchange="setdocmode(this.checked);" /> <label for="switchbox">show html</label></p> <p><input type="submit" value="send" /></p> </form> </body> </html> note: if you want to see how to standardize the creation and the insertion of your editor in your page, please see our more complete rich-text editor example.
Introduction to HTML5 - Developer guides
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.
...also, if you are not currently using utf-8, it's recommended that you switch to it in your web pages, as it simplifies character handling in documents using different scripts.
... note that html5 restricts character sets to those compatible with ascii and using at least 8 bits.
HTML5 - Developer guides
WebGuideHTMLHTML5
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.
...this is often referred as css3, though css is not a monolithic specification any more and the different modules are not all at level 3: some are at level 1 and others at level 4, with all the intermediate levels covered.
... more fancy borders not only it is now possible to use images to style borders, using border-image and its associated longhand properties, but rounded borders are supported via the border-radius property.
Introduction to Web development - Developer guides
for another (overlapping) set of links to learning resources, see the mdn learning pages.
... note: the recommended resources on this page are subject to change.
... christian heilmann's javascript best practices — learn about some of the obvious and (not so) obvious best practices when writing javascript.
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.
... <p> <label for="soundfile">select an audio file:</label> <input type="file" id="soundfile" accept="audio/*"> </p> <p> <label for="videofile">select a video file:</label> <input type="file" id="videofile" accept="video/*"> </p> <p> <label for="imagefile">select some images:</label> <input type="file" id="imagefile" accept="image/*" multiple> </p> note the last example allows you to select multiple iamges.
..., might look like this: <input type="file" accept="image/*,.pdf"> using file inputs a basic example <form method="post" enctype="multipart/form-data"> <div> <label for="file">choose file to upload</label> <input type="file" id="file" name="file" multiple> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } this produces the following output: note: you can find this example on github too — see the source code, and also see it running live.
<address>: The Contact Address element - HTML: Hypertext Markup Language
WebHTMLElementaddress
permitted parents any element that accepts flow content, but always excluding <address> elements (according to the logical principle of symmetry, if <address> tag, as a parent, can not have nested <address> element, then the same <address> content can not have <address> tag as its parent).
... 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.
... this element should not contain more information than the contact information, like a publication date (which belongs in a <time> element).
<aside>: The Aside element - HTML: Hypertext Markup Language
WebHTMLElementaside
note that an <aside> element must not be a descendant of an <address> element.
... implicit aria role complementary permitted aria roles feed, none, note, presentation, region, search dom interface htmlelement attributes this element only includes the global attributes.
... usage notes do not use the <aside> element to tag parenthesized text, as this kind of text is considered part of the main flow.
<base>: The Document Base URL element - HTML: Hypertext Markup Language
WebHTMLElementbase
permitted parents a <head> that doesn't contain another <base> element.
... usage notes multiple <base> elements if multiple <base> elements are used, only the first href and first target are obeyed — all others are ignored.
... open graph open graph tags do not acknowledge <base>, and should always have full absolute urls.
<basefont> - HTML: Hypertext Markup Language
WebHTMLElementbasefont
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.
... usage notes do not use this element!
...starting with html 4, html does not convey styling information anymore (outside the <style> element or the style attribute of each element).
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
WebHTMLElementbdi
this works in two ways: the directionality of text embedded in <bdi> does not influence the directionality of the surrounding text.
... the directionality of text embedded in <bdi> is not influenced by the directionality of the surrounding text.
... though the same visual effect can be achieved using the css rule unicode-bidi: isolate on a <span> or another text-formatting element, html authors should not use this approach because it is not semantic and browsers are allowed to ignore css styling.
<bgsound>: The Background Sound element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementbgsound
do not use this!
... example <bgsound src="sound1.mid"> <bgsound src="sound2.au" loop="infinite"> usage notes historically, the <embed> element could be used with audio player plug-ins to play audio in the background in most browsers.
... you can write <bgsound> as a self-closing tag (<bgsound />); however, since this element is non-standard, doing so will still not validate.
<dd>: The Description Details element - HTML: Hypertext Markup Language
WebHTMLElementdd
the end tag may be omitted if the <dd> element is immediately followed by another <dd> element or a <dt> element, or if there is no more content in the parent element.
... previous sibling <dt> or another <dd> element.
... nowrap if the value of this attribute is set to yes, the definition text will not wrap.
<dir>: The Directory element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementdir
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.
... usage note: do not use this attribute, as it has been deprecated: the <dir> element should be styled using css.
<element>: The Custom Element element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementelement
note: this element has been removed from the specification.
...not for use in new websites.deprecated.
... not for use in new websites.
<header> - HTML: Hypertext Markup Language
WebHTMLElementheader
note that a <header> element must not be a descendant of an <address>, <footer> or another <header> element.
... implicit aria role banner, or no corresponding role if a descendant of an article, aside, main, nav or section element, or an element with role=article, complementary, main, navigation or region permitted aria roles group, presentation or none dom interface htmlelement usage notes the <header> element is not sectioning content and therefore does not introduce a new section in the outline.
... that said, a <header> element is intended to usually contain the surrounding section's heading (an h1–h6 element), but this is not required.
<hgroup> - HTML: Hypertext Markup Language
WebHTMLElementhgroup
usage notes the <hgroup> element has been removed from the html5 (w3c) specification, but it still is in the whatwg version of html.
... however, given that a key purpose of the <hgroup> element is to affect how headings are displayed by the outline algorithm defined in the html specification—but the html outline algorithm is not implemented in any browsers—then the <hgroup> semantics are in practice only theoretical.
... in other words, the <hgroup> element prevents any of its secondary <h1>–<h6> children from creating separate sections of their own in the outline—as those <h1>–<h6> elements otherwise normally would if they were not children of any <hgroup>.
<html>: The HTML Document / Root element - HTML: Hypertext Markup Language
WebHTMLElementhtml
tag omission the start tag may be omitted if the first thing inside the <html> element is not a comment.
... the end tag may be omitted if the <html> element is not immediately followed by a comment.
...this attribute is not needed, because it is redundant with the version information in the document type declaration.
<input type="button"> - HTML: Hypertext Markup Language
WebHTMLElementinputbutton
note: while <input> elements of type button are still perfectly valid html, the newer <button> element is now the favored way to create buttons.
...cument.queryselector('input'); const paragraph = document.queryselector('p'); button.addeventlistener('click', updatebutton); function updatebutton() { if (button.value === 'start machine') { button.value = 'stop machine'; paragraph.textcontent = 'the machine has started!'; } else { button.value = 'start machine'; paragraph.textcontent = 'the machine is stopped.'; } } note: the problem with the above example of course is that the user will not know what the access key is!
...ue="button 1"> <input type="button" value="button 2"> <input type="button" value="button 3"> </fieldset> const button = document.queryselector('input'); const fieldset = document.queryselector('fieldset'); button.addeventlistener('click', disablebutton); function disablebutton() { fieldset.disabled = true; window.settimeout(function() { fieldset.disabled = false; }, 2000); } note: firefox will, unlike other browsers, by default, persist the dynamic disabled state of a <button> across page loads.
<multicol>: The HTML Multi-Column Layout element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementmulticol
the html multi-column layout element (<multicol>) was an experimental element designed to allow multi-column layouts and must not be used.
... it never got any significant traction and is not implemented in any major browsers.
... do not use this!
<nextid>: The NeXT ID element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementnextid
it was generated by that web editing tool automatically and was not to be adjusted or entered by hand.
... html "0.a" - from the beginning through january 10, 1991 this tag had not been invented as yet, so no examples are found from this period.
...s nesting a header (<h*> element) within a link (<a> element) html version 2 level 2 this is the default and includes and permits all html level 2 functions and elements and attributes html version 2 strict level 2 this excludes these depreciated elements and also forbids such constructs as nesting a header (<h*> element) within a link (<a> element), or having a forms <input> element which is not within a block level element such as <p> html version 3.2 <nextid> has vanished altogether, never to be heard from again.
<noembed>: The Embed Fallback element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementnoembed
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.
... while this element currently still works in many browsers, it is obsolete and should not be used.
... examples the message inside <noembed> tag will appear only when your browser does not support <embed> tag.
<samp>: The Sample Output element - HTML: Hypertext Markup Language
WebHTMLElementsamp
usage notes you can use a css rule to override the browser's default font face for the <samp> element; however, it's possible that the browser's preferences may take precedence over any css you specify.
...for example, consider this text presenting a transcript of a linux (or macos) console session: html <pre> <samp><span class="prompt">mike@interwebz:~$</span> <kbd>md5 -s "hello world"</kbd> md5 ("hello world") = 3e25960a79dbc69b674cd4ec67a72c62 <span class="prompt">mike@interwebz:~$</span> <span class="cursor">█</span></samp></pre> note the use of <span> to allow customization of the appearance of specific portions of the sample text such as the shell prompts and the cursor.
... note also the use of <kbd> to represent the command the user entered at the prompt in the sample text.
<table>: The Table element - HTML: Hypertext Markup Language
WebHTMLElementtable
cellpadding this attribute defines the space between the content of a cell and its border, displayed or not.
...border-spacing does not have any effect if border-collapse is set to collapse.
... if the table cannot be broken apart, use a combination of the id and headers attributes to programmatically associate each table cell with the header(s) the cell is associated with.
<time> - HTML: Hypertext Markup Language
WebHTMLElementtime
usage notes this element is for presenting dates and times in a machine readable format.
... this element should not be used for dates prior to the introduction of the gregorian calendar (due to complications in calculating those dates).
...if the element does not have a datetime attribute, it must not have any element descendants, and the datetime value is the element’s child text content.
draggable - HTML: Hypertext Markup Language
false: the element cannot be dragged.
... this attribute is enumerated and not boolean.
... if this attribute is not set, its default value is auto, which means drag behavior is the default browser behavior: only text selections, images, and links can be dragged.
itemscope - HTML: Hypertext Markup Language
an itemscope element that does not have an associated itemtype must have an associated itemref.
... note: find more about itemtype attributes at http://schema.org/thing simple example html the following example specifies the itemscope attribute.
...op name carol smith itemscope itemprop[itemtype] aggregaterating [aggregaterating] itemprop ratingvalue 4.0 itemprop reviewcount 35 itemscope itemprop[itemtype] nutrition [nutritioninformation] itemprop servingsize 1 medium slice itemprop calories 250 cal itemprop fatcontent 12 g note: a handy tool for extracting microdata structures from html is google's structured data testing tool.
itemtype - HTML: Hypertext Markup Language
note: more about itemtype attributes can be found at http://schema.org/thing the itemtype attribute must have a value that is an unordered set of unique tokens which are case-sensitive, each is a valid and absolute url, and all defined to use the same vocabulary.
...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.
... pricecurrency usd itemprop price 119.99 itemprop pricevaliduntil 2020-11-05 itemprop itemcondition http://schema.org/usedcondition itemprop availability http://schema.org/instock itemscope itemprop[itemtype] seller [organization] http://schema.org/organization itemprop name executive objects note: a handy tool for extracting microdata structures from html is google's structured data testing tool.
lang - HTML: Hypertext Markup Language
if the attribute value is the empty string (lang=""), the language is set to unknown; if the language tag is not valid according to bcp47, it is set to invalid.
... even if the lang attribute is set, it may not be taken into account, as the xml:lang attribute has priority.
...so while :lang(es) matches both lang="es-es" and lang="es-419", :lang(xyzzy) would not match lang="xyzzy-zorp!".
Link types: noopener - HTML: Hypertext Markup Language
the noopener keyword for the rel attribute of the <a>, <area>, and <form> elements instructs the browser to navigate to the target resource without granting the new browsing context access to the document that opened it — by not setting the window.opener property on the opened window (it returns null).
... this is especially useful when opening untrusted links, in order to ensure they cannot tamper with the originating document via the window.opener property (see about rel=noopener for more details), while still providing the referer http header (unless noreferrer is used as well).
... 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.
HTML: Hypertext Markup Language
WebHTML
"hypertext" refers to links that connect web pages to one another, either within a single website or between websites.
... html uses "markup" to annotate text, images, and other content for display in a web browser.
... global attributes global attributes may be specified on all html elements, even those not specified in the standard.
Cross-Origin Resource Policy (CORP) - HTTP
as this policy is expressed via a response header, the actual request is not prevented—rather, the browser prevents the result from being leaked by stripping the response body.
...if the application does not serve a no-sniff directive, chromium will attempt to guess the content-type and apply the protection anyway.
... usage note: due to a bug in chrome, setting cross-origin-resource-policy can break pdf rendering, preventing visitors from being able to read past the first page of some pdfs.
Feature Policy - HTTP
in a nutshell feature policy provides a mechanism to explicitly declare what functionality is used (or not used), throughout your website.
... ensure images are sized properly and are not too big for the viewport.
...if you do not specify a policy for a feature, then a default allowlist will be used.
Accept-Patch - HTTP
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.
...note that the first one was discontinued due to patent licensing problems.
Content-Language - HTTP
multiple language tags are also possible, as well as applying the content-language header to various media types and not only to textual documents.
... note: language tags are formaly defined in rfc 5646, which rely on the iso 639 standard (quite often the iso 639-1 code list) for language codes to be used.
... <html lang="de"> do not use this meta element like this for stating a document language: <!-- /!\ this is bad practice --> <meta http-equiv="content-language" content="de"> indicating a target audience for a resource the content-language header is used to specify the intended audience of the page, and can indicate that this is more than one language.
Cross-Origin-Opener-Policy - HTTP
the http cross-origin-opener-policy (coop) response header allows you to ensure a top-level document does not share a browsing context group with cross-origin documents.
... if a cross-origin document with coop is opened in a new window, the opening document will not have a reference to it, and the window.opener property of the new window will be null.
...cross-origin documents are not loaded in the same browsing context.
Expect-CT - HTTP
the expect-ct header lets sites opt in to reporting and/or enforcement of certificate transparency requirements, to prevent the use of misissued certificates for that site from going unnoticed.
... 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.
Feature-Policy: display-capture - HTTP
the http feature-policy header display-capture directive controls whether or not the document is permitted to use screen capture api, i.e.,getdisplaymedia() to capture the screen's contents.
... if display-capture is disabled in a document, the document will not be able to initiate screen capture via getdisplaymedia().
...the feature is not allowed in cross-origin documents in nested browsing contexts.
If-Range - HTTP
WebHTTPHeadersIf-Range
if the condition is not fulfilled, the full resource is sent back, with a 200 ok status.
... this header can be used either with a last-modified validator, or with an etag, but not with both.
... the most common use case is to resume a download, to guarantee that the stored resource has not been modified since the last fragment has been received.
Pragma - HTTP
WebHTTPHeadersPragma
it is used for backwards compatibility with http/1.0 caches where the cache-control http/1.1 header is not yet present.
... note: pragma is not specified for http responses and is therefore not a reliable replacement for the general http/1.1 cache-control header, although it does behave the same as cache-control: no-cache, if the cache-control header field is omitted in a request.
... header type general header, but response behavior is not specified and thus implementation-specific.
Referer - HTTP
WebHTTPHeadersReferer
note that referer is actually a misspelling of the word "referrer".
... a referer header is not sent by browsers if: the referring resource is a local "file" or "data" uri.
..."username:password" in "https://username:password@example.com/foo/bar/") are not included.
Referrer-Policy - HTTP
the referrer-policy header does not share this misspelling.
...tps://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.
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.
...the content-length header is omitted in this case and at the beginning of each chunk you need to add the length of the current chunk in hexadecimal format, followed by '\r\n' and then the chunk itself, followed by another '\r\n'.
... 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 not be known until the request has been fully processed.
Want-Digest - HTTP
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.
...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.
... 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 uses one of them: request: get /item want-digest: sha-256;q=0.3, sha;q=1 response: http/1.1 200 ok digest: sha-256=x48e9qookqqrvdts8nojrjn3owduoywxbf7kbu9dbpe= unsupported digests the server does not support any of the requested digest algorithms, so uses a different algorithm: request: get /item want-digest: sha;q=1 response: http/1.1 200 ok digest: sha-256=x48e9qookqqrvdts8nojrjn3owduoywxbf7kbu9dbpe= the server does not support any of the requested digest algorithms, so responds with a 400 error and includes another want-digest header, listing the algorithms that it does suppor...
X-Content-Type-Options - HTTP
the x-content-type-options response http header is a marker used by the server to indicate that the mime types advertised in the content-type headers should not be changed and be followed.
... note: x-content-type-options only apply request-blocking due to nosniff for request destinations of "script" and "style".
... header type response header forbidden header name no syntax x-content-type-options: nosniff directives nosniff blocks a request if the request destination is of type: "style" and the mime type is not text/css, or "script" and the mime type is not a javascript mime type enables cross-origin read blocking (corb) protection for the mime-types: text/html text/plain text/json, application/json or any other type with a json extension: */*+json text/xml, application/xml or any other type with an xml extension: */*+xml (excluding image/svg+xml) specifications specification status comm...
202 Accepted - HTTP
WebHTTPStatus202
the hypertext transfer protocol (http) 202 accepted response status code indicates that the request has been accepted for processing, but the processing has not been completed; in fact, processing may not have started yet.
... the request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place.
...it is intended for cases where another process or server handles the request, or for batch processing.
302 Found - HTTP
WebHTTPStatus302
a browser redirects to this page but search engines don't update their links to the resource (in 'seo-speak', it is said that the 'link-juice' is not sent to the new url).
... even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents conform here - you can still find this type of bugged software out there.
...this is useful when you want to give a response to a put method that is not the uploaded resource but a confirmation message such as: 'you successfully uploaded xyz'.
CSS Houdini
li { background-image: paint(mycomponent, stroke, 10px); --highlights: blue; --lowlights: green; } note: with great power comes great responsibility!
... with houdini you could invent your own masonry, grid, or regions implementation, but doing so is not necessarily the best idea.
...it is not yet natively available.
JavaScript technologies overview - JavaScript
one of them is the core language (ecmascript), another is the collection of the web apis, including the dom (document object model).
...in a browser, this global object is the window object, but ecmascript only defines the apis not specific to browsers, e.g.
... other notable apis the settimeout and setinterval functions were first specified on the window interface in html standard.
TypeError: property "x" is non-configurable and can't be deleted - JavaScript
message typeerror: calling delete on 'x' is not allowed in strict mode (edge) typeerror: property "x" is non-configurable and can't be deleted.
... (firefox) typeerror: cannot delete property 'x' of #<object> (chrome) error type typeerror in strict mode only.
... 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().
SyntaxError: applying the 'delete' operator to an unqualified name is deprecated - JavaScript
message syntaxerror: calling delete on expression not allowed in strict mode (edge) syntaxerror: applying the 'delete' operator to an unqualified name is deprecated (firefox) syntaxerror: delete of an unqualified identifier in strict mode.
...in strict mode, an attempt to delete a variable will throw an error and is not allowed.
... unlike what common belief suggests, the delete operator has nothing to do with directly freeing memory.
Warning: JavaScript 1.6's for-each-in loops are deprecated - JavaScript
var array = [10, 20, 30]; for (var x of array) { console.log(x); // 10 // 20 // 30 } iterating over a null-able array for each...in does nothing if the specified value is null or undefined, but for...of will throw an exception in these cases.
... deprecated syntax function func(array) { for each (var x in array) { console.log(x); } } func([10, 20]); // 10 // 20 func(null); // prints nothing func(undefined); // prints nothing alternative standard syntax to rewrite for each...in statements so that values can be null or undefined with for...of as well, you need to guard around for...of.
... function func(array) { if (array) { for (var x of array) { console.log(x); } } } func([10, 20]); // 10 // 20 func(null); // prints nothing func(undefined); // prints nothing iterating over an object's key-value pair deprecated syntax there's a deprecated idiom to iterate over the specified object's key-value pairs using for each...in and the deprecated iterator object.
SyntaxError: illegal character - JavaScript
“this looks like a string”; // syntaxerror: illegal character // “ and ” are not " but look like this 42 – 13; // syntaxerror: illegal character // – is not - but looks like this var foo = 'bar'; // syntaxerror: illegal character // <37e> is not ; but looks like this this should work: "this is actually a string"; 42 - 13; var foo = 'bar'; some editors and ides will notify you...
... or at least use a slightly different highlighting for it, but not all.
... when something like this happens to your code and you're not able to find the source of the problem, it's often best to just delete the problematic line and retype it.
SyntaxError: a declaration in the head of a for-of loop can't have an initializer - JavaScript
this is not allowed in for-of loops.
... message syntaxerror: for-of loop head declarations cannot have an initializer (edge) syntaxerror: a declaration in the head of a for-of loop can't have an initializer (firefox) syntaxerror: for-of loop variable declaration may not have an initializer.
...this is not allowed in for-of loops.
TypeError: "x" is read-only - JavaScript
message typeerror: assignment to read-only properties is not allowed in strict mode (edge) typeerror: "x" is read-only (firefox) typeerror: 0 is read-only (firefox) typeerror: cannot assign to read only property 'x' of #<object> (chrome) typeerror: cannot assign to read only property '0' of [object array] (chrome) error type typeerror what went wrong?
... examples invalid cases read-only properties are not super common, but they can be created using object.defineproperty() or object.freeze().
... the global variable undefined is also read-only, so you can't silence the infamous "undefined is not a function" error by doing this: 'use strict'; undefined = function() {}; // typeerror: "undefined" is read-only valid cases 'use strict'; var obj = object.freeze({name: 'score', points: 157}); obj = {name: obj.name, points: 0}; // replacing it with a new object works 'use strict'; var lung_count = 2; // a `var` works, because it's not read-only lung_count = 3; // ok (anatomically unlik...
RangeError: repeat count must be less than infinity - JavaScript
message rangeerror: argument out of range (edge) rangeerror: repeat count must be less than infinity and not overflow maximum string size (firefox) rangeerror: invalid count value (chrome) error type rangeerror what went wrong?
...it must be between 0 and less than positive infinity and cannot be a negative number.
... the resulting string can also not be larger than the maximum string size, which can differ in javascript engines.
TypeError: invalid arguments - JavaScript
typed array constructors require either a length, another typed array, array-like objects, iterable objects or an arraybuffer object to create a new typed array.
... other constructor arguments will not create a valid typed array.
... var ta = new uint8array("nope"); // typeerror: invalid arguments different ways to create a valid uint8array: // from a length var uint8 = new uint8array(2); uint8[0] = 42; console.log(uint8[0]); // 42 console.log(uint8.length); // 2 console.log(uint8.bytes_per_element); // 1 // from an array var arr = new uint8array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint8array([21, 31]); var y = new uint8array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint8array(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint8 = new uint8array(iterable); // uint8array[1, 2, 3] ...
ReferenceError: assignment to undeclared variable "x" - JavaScript
message referenceerror: assignment to undeclared variable "x" (firefox) referenceerror: "x" is not defined (chrome) referenceerror: variable undefined in strict mode (edge) error type referenceerror warning in strict mode only.
... three things to note about declared and undeclared variables: declared variables are constrained in the execution context in which they are declared.
...undeclared variables do not exist until the code assigning to them is executed.
TypeError: invalid 'instanceof' operand 'x' - JavaScript
message typeerror: invalid 'instanceof' operand "x" (firefox) typeerror: "x" is not a function (firefox) typeerror: right-hand side of 'instanceof' is not an object (chrome) typeerror: right-hand side of 'instanceof' is not callable (chrome) error type typeerror what went wrong?
... examples instanceof vs typeof "test" instanceof ""; // typeerror: invalid 'instanceof' operand "" 42 instanceof 0; // typeerror: invalid 'instanceof' operand 0 function foo() {} var f = foo(); // foo() is called and returns undefined var x = new foo(); x instanceof f; // typeerror: invalid 'instanceof' operand f x instanceof x; // typeerror: x is not a function to fix these errors, you will either need to replace the instanceof operator with the typeof operator, or to make sure you use the function name, instead of the result of its evaluation.
... typeof "test" == "string"; // true typeof 42 == "number" // true function foo() {} var f = foo; // do not call foo.
Method definitions - JavaScript
(that is, * g(){} will work, but g *(){} will not.) non-generator method definitions cannot contain the yield keyword.
... const obj4 = { f: async function* () { yield 1 yield 2 yield 3 } }; // the same object using shorthand syntax const obj4 = { async* f() { yield 1 yield 2 yield 3 } } method definitions are not constructable methods cannot be constructors!
... 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.
Rest parameters - JavaScript
formally defined in function expression), while the arguments object contains all arguments passed to the function; the arguments object is not a real array, while rest parameters are array instances, meaning methods like sort, map, foreach or pop can be applied on it directly; the arguments object has additional functionality specific to itself (like the callee property).
...before rest parameters, "arguments" could be converted to a normal array using: function f(a, b) { let normalarray = array.prototype.slice.call(arguments) // -- or -- let normalarray = [].slice.call(arguments) // -- or -- let normalarray = array.from(arguments) let first = normalarray.shift() // ok, gives the first argument let first = arguments.shift() // error (arguments is not a normal array) } // now, you can easily gain access to a normal array using a rest parameter function f(...args) { let normalarray = args let first = normalarray.shift() // ok, gives the first argument } examples using rest parameters in this example, the first argument is mapped to a and the second to b, so these named arguments are used as normal.
...each one of them is then multiplied by the first parameter, and the array is returned: function multiply(multiplier, ...theargs) { return theargs.map(element => { return multiplier * element }) } let arr = multiply(2, 1, 2, 3) console.log(arr) // [2, 4, 6] use with the arguments object array methods can be used on rest parameters, but not on the arguments object: function sortrestargs(...theargs) { let sortedargs = theargs.sort() return sortedargs } console.log(sortrestargs(5, 3, 7, 1)) // 1, 3, 5, 7 function sortarguments() { let sortedargs = arguments.sort() return sortedargs // this will never happen } console.log(sortarguments(5, 3, 7, 1)) // throws a typeerror (arguments.sort is not a function) to use array me...
setter - JavaScript
it is not possible to simultaneously have a setter on a property that holds an actual value.
... note the following when working with the set syntax: it can have an identifier which is either a number or a string; it must have exactly one parameter (see incompatible es5 change: literal getter and setter functions must now have exactly zero or one arguments for more information); it must not appear in an object literal with another set or with a data entry for the same property.
...when current is assigned a value, it updates log with that value: const language = { set current(name) { this.log.push(name); }, log: [] } language.current = 'en'; console.log(language.log); // ['en'] language.current = 'fa'; console.log(language.log); // ['en', 'fa'] note that current is not defined, and any attempts to access it will result in undefined.
Array.prototype[@@iterator]() - JavaScript
sed for (let letter of earr) { letterresult.innerhtml += "<li>" + letter + "</li>"; } result alternative iteration var arr = ['a', 'b', 'c', 'd', 'e']; var earr = arr[symbol.iterator](); console.log(earr.next().value); // a console.log(earr.next().value); // b console.log(earr.next().value); // c console.log(earr.next().value); // d console.log(earr.next().value); // e use case for brace notation the use case for this syntax over using the dot notation (array.prototype.values()) is in a case where you don't know what object is going to be ahead of time.
... function logiterable(it) { if (!(symbol.iterator in object.getprototypeof(it) /* or "symbol.iterator in object.__proto__" or "it[symbol.iterator]" */)) { console.log(it, ' is not an iterable object...'); return; } var iterator = it[symbol.iterator](); // your browser must support for..of loop // and let-scoped variables in for loops // const and var could also be used for (let letter of iterator) { console.log(letter); } } // array logiterable(['a', 'b', 'c']); // a // b // c // string logiterable('abc'); // a // b // c logiterable(123); // 123 " ...
...is not an iterable object..." specifications specification ecmascript (ecma-262)the definition of 'array.prototype[@@iterator]()' in that specification.
Array() constructor - JavaScript
note that this special case only applies to javascript arrays created with the array constructor, not array literals created with the bracket syntax.
... arraylength if the only argument passed to the array constructor is an integer between 0 and 232-1 (inclusive), this returns a new javascript array with its length property set to that number (note: this implies an array of arraylength empty slots, not slots with actual undefined values).
... examples array literal notation arrays can be created using the literal notation: let fruits = ['apple', 'banana']; console.log(fruits.length); // 2 console.log(fruits[0]); // "apple" array constructor with a single parameter arrays can be created using a constructor with a single number parameter.
Array.prototype.flatMap() - JavaScript
alternative reduce() and concat() var arr = [1, 2, 3, 4]; arr.flatmap(x => [x, x * 2]); // is equivalent to arr.reduce((acc, x) => acc.concat([x, x * 2]), []); // [1, 2, 2, 4, 3, 6, 4, 8] note, however, that this is inefficient and should be avoided for large arrays: in each iteration, it creates a new temporary array that must be garbage-collected, and it copies elements from the current accumulator array into a new array instead of just adding the new elements to the existing array.
... please do not add polyfills on this article.
... let arr1 = ["it's sunny in", "", "california"]; arr1.map(x => x.split(" ")); // [["it's","sunny","in"],[""],["california"]] arr1.flatmap(x => x.split(" ")); // ["it's","sunny","in", "", "california"] notice, the output list length can be different from the input list length.
Array.prototype.toLocaleString() - JavaScript
if (this == null) { throw new typeerror('"this" is null or not defined'); } var a = object(this); // 2.
... // note: in this case, we will use a comma var separator = ','; // 4.
... 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.
Array.prototype.toSource() - JavaScript
description the tosource method returns the following values: for the built-in array object, tosource returns the following string indicating that the source code is not available: function array() { [native code] } for instances of array, tosource returns a string representing the source code.
... this method is usually called internally by javascript and not explicitly in code.
... examples examining the source code of an array to examine the source code of an array: var alpha = new array('a', 'b', 'c'); alpha.tosource(); //returns ['a', 'b', 'c'] specifications not part of any standard.
AsyncFunction - JavaScript
note that asyncfunction is not a global object.
... note: async functions created with the asyncfunction constructor do not create closures to their creation contexts; they are always created in the global scope.
... when running them, they will only be able to access their own local variables and global ones, not the ones from the scope in which the asyncfunction constructor was called.
Date.prototype.toISOString() - JavaScript
the timezone is always zero utc offset, as denoted by the suffix "z".
...engines which have not been updated to support this method can work around the absence of this method using the following shim: if (!date.prototype.toisostring) { (function() { function pad(number) { if (number < 10) { return '0' + number; } return number; } date.prototype.toisostring = function() { return this.getutcfullyear() + '-' + pad(this.getutcmonth() + 1)...
...his.getutcminutes()) + ':' + pad(this.getutcseconds()) + '.' + (this.getutcmilliseconds() / 1000).tofixed(3).slice(2, 5) + 'z'; }; })(); } examples using toisostring() let today = new date('05 october 2011 14:48 utc') console.log(today.toisostring()) // returns 2011-10-05t14:48:00.000z the above example uses parsing of a non–standard string value that may not be correctly parsed in non–mozilla browsers.
Date.prototype.toString() - JavaScript
description date instances inherit their tostring() method from date.prototype, not object.prototype.
...therefore it should not be relied upon to be in the specified format.
... tostring() is a generic method, it does not require that its this is a date instance.
Function.prototype.toSource() - JavaScript
this method is usually called internally by javascript and not explicitly in code.
... examples native functions for the built-in function object, tosource() returns the following string indicating that the source code is not available: function function() { [native code] } custom functions for custom functions, tosource() returns the javascript source that defines the object as a string.
... // for example: function hello() { console.log("hello, world!"); } hello.tosource(); // results in: "function hello() { console.log(\"hello, world!\"); }" specifications not part of any standard.
GeneratorFunction - JavaScript
note that generatorfunction is not a global object.
... note: generator function created with the generatorfunction constructor do not create closures to their creation contexts; they are always created in the global scope.
... when running them, they will only be able to access their own local variables and global ones, not the ones from the scope in which the generatorfunction constructor was called.
Intl.Collator() constructor - JavaScript
implementations are not required to support this property.
...implementations are not required to support this property.
... examples using collator the following example demonstrates the different potential results for a string occurring before, after, or at the same level as another: console.log(new intl.collator().compare('a', 'c')); // → a negative value console.log(new intl.collator().compare('c', 'a')); // → a positive value console.log(new intl.collator().compare('a', 'a')); // → 0 note that the results shown in the code above can vary between browsers and browser versions.
Intl.DateTimeFormat.prototype.format() - JavaScript
note that the function is bound to the intl.datetimeformat from which it was obtained, so it can be passed directly to array.prototype.map().
...most notably, the ie and edge browsers insert bidirectional control characters around dates, so the output text will flow properly when concatenated with other text.
... for this reason you cannot expect to be able to compare the results of format() to a static value: let d = new date("2019-01-01t00:00:00.000000z"); let formatteddate = intl.datetimeformat(undefined, { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric' }).format(d); "1.1.2019, 01:00:00" === formatteddate; // true in firefox and others // false in ie and edge note: see also this stackoverflow thread for more details and examples.
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
notation the value provided for this property in the options argument, if present, or "standard filled in as a default.
... this property is only present if the notation is set to "compact".
... examples using the resolvedoptions method var de = new intl.numberformat('de-de'); var usedoptions = de.resolvedoptions(); usedoptions.locale; // "de-de" usedoptions.numberingsystem; // "latn" usedoptions.notation; // "standard" usedoptions.signdisplay; // "auto" usedoption.style; // "decimal" usedoptions.minimumintegerdigits; // 1 usedoptions.minimumfractiondigits; // 0 usedoptions.maximumfractiondigits; // 3 usedoptions.usegrouping; // true specifications specification ecmascript internationalization api (ecma-402)the definition...
Intl - JavaScript
if the locales argument is not provided or is undefined, the runtime's default locale is used.
... 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.
...if the options argument is not provided or is undefined, default values are used for all properties.
Map.prototype.forEach() - JavaScript
it is not invoked for keys which have been deleted.
...callback is not invoked for values deleted before being visited.
...it does not return a value.
Math.ceil() - JavaScript
note: math.ceil(null) returns integer 0 and does not give a nan error.
... description because ceil() is a static method of math, you always use it as math.ceil(), rather than as a method of a math object you created (math is not a constructor).
... if (typeof exp === 'undefined' || +exp === 0) { return math[type](value); } value = +value; exp = +exp; // if the value is not a number or the exp is not an integer...
Math.clz32() - JavaScript
if x is not a number, then it will be converted to a number first, then converted to a 32-bit unsigned integer.
... count leading ones and beyond at present, there is no math.clon for "count leading ones" (named "clon", not "clo", because "clo" and "clz" are too similar especially for non-english-speaking people).
...fill in all the higher bits after the first one // asmjs for some reason does not allow ^=,&=, or |= integer = integer | (integer << 16); integer = integer | (integer << 8); integer = integer | (integer << 4); integer = integer | (integer << 2); integer = integer | (integer << 1); // 2.
Math.floor() - JavaScript
description because floor() is a static method of math, you always use it as math.floor(), rather than as a method of a math object you created (math is not a constructor).
... note: math.floor(null) returns 0, not a nan.
... if (typeof exp === 'undefined' || +exp === 0) { return math[type](value); } value = +value; exp = +exp; // if the value is not a number or the exp is not an integer...
Math.fround() - JavaScript
if the parameter is of a different type, it will get converted to a number or to nan if it cannot be converted.
... because fround() is a static method of math, you always use it as math.fround(), rather than as a method of a math object you created (math is not a constructor).
... math.round((leading - arg / powexp) * 0x800000); if (mantissa <= -0x800000) return sign * infinity; return sign * powexp * (leading - mantissa / 0x800000); }; examples using math.fround() the number 1.5 can be precisely represented in the binary numeral system, and is identical in 32-bit and 64-bit: math.fround(1.5); // 1.5 math.fround(1.5) === 1.5; // true however, the number 1.337 cannot be precisely represented in the binary numeral system, so it differs in 32-bit and 64-bit: math.fround(1.337); // 1.3370000123977661 math.fround(1.337) === 1.337; // false 21502^150 is too big for a 32-bit float, so infinity is returned: 2 ** 150; // 1.42724769270596e+45 math.fround(2 ** 150); // infinity if the parameter cannot be converted to a number, or it is not-a-number (nan), math.fr...
Math.min() - JavaScript
if any one or more of the parameters cannot be converted into a number, nan is returned.
... description because min() is a static method of math, you always use it as math.min(), rather than as a method of a math object you created (math is not a constructor).
... if at least one of arguments cannot be converted to a number, the result is nan.
Math - JavaScript
it’s not a function object.
... description unlike many other global objects, math is not a constructor.
... note: many math functions have a precision that’s implementation-dependent.
Number.isSafeInteger() - JavaScript
a safe integer is an integer that can be exactly represented as an ieee-754 double precision number, and whose ieee-754 representation cannot be the result of rounding any other integer to fit the ieee-754 representation.
...in contrast, 253 is not a safe integer: it can be exactly represented in ieee-754, but the integer 253 + 1 can't be directly represented in ieee-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding.
... return value a boolean indicating whether or not the given value is a number that is a safe integer.
Number.parseFloat() - JavaScript
if a number cannot be parsed from the argument, it returns nan.
...if this argument is not a string, then it is converted to one using the tostring abstract operation.
... or nan when the first non-whitespace character cannot be converted to a number.
Number.parseInt() - JavaScript
if this argument is not a string, then it is converted to one using the tostring abstract operation.
...be careful—this does not default to 10!
... if the radix is smaller than 2 or bigger than 36, and the first non-whitespace character cannot be converted to a number, nan is returned.
Number.prototype.toPrecision() - JavaScript
return value a string representing a number object in fixed-point or exponential notation rounded to precision significant digits.
... exceptions rangeerror if precision is not between 1 and 100 (inclusive), a rangeerror is thrown.
...onsole.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.log(numobj.toprecision()) // logs '0.000123' console.log(numobj.toprecision(5)) // logs '0.00012300' console.log(numobj.toprecision(2)) // logs '0.00012' console.log(numobj.toprecision(1)) // logs '0.0001' // note that exponential notation might be returned in some circumstances console.log((1234.5).toprecision(2)) // logs '1.2e+3' specifications specification ecmascript (ecma-262)the definition of 'number.prototype.toprecision' in that specification.
Number.prototype.toSource() - JavaScript
examples native function for the built-in number object, tosource() returns the following string indicating that the source code is not available: function number() { [native code] } for instances of number, tosource() returns a string representing the source code.
... this method is usually called internally by javascript and not explicitly in web code.
... specifications not part of any standard.
Object.getOwnPropertyDescriptor() - JavaScript
the object.getownpropertydescriptor() method returns an object describing the configuration of a specific property on a given object (that is, one directly present on an object and not in the object's prototype chain).
... true, // enumerable: true, // value: 73, // writable: true // } o = {}; object.defineproperty(o, 'qux', { value: 8675309, writable: false, enumerable: false }); d = object.getownpropertydescriptor(o, 'qux'); // d is { // value: 8675309, // writable: false, // enumerable: false, // configurable: false // } non-object coercion in es5, if the first argument to this method is not an object (a primitive), then it will cause a typeerror.
... object.getownpropertydescriptor('foo', 0); // typeerror: "foo" is not an object // es5 code object.getownpropertydescriptor('foo', 0); // object returned by es2015 code: { // configurable: false, // enumerable: true, // value: "f", // writable: false // } specifications specification ecmascript (ecma-262)the definition of 'object.getownpropertydescriptor' in that specification.
Object.isExtensible() - JavaScript
return value a boolean indicating whether or not the given object is extensible.
...var frozen = object.freeze({}); object.isextensible(frozen); // === false non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
... object.isextensible(1); // typeerror: 1 is not an object (es5 code) object.isextensible(1); // false (es2015 code) specifications specification ecmascript (ecma-262)the definition of 'object.isextensible' in that specification.
Object.prototype.isPrototypeOf() - JavaScript
the isprototypeof() method checks if an object exists in another object's prototype chain.
...in the expression "object instanceof afunction", the object prototype chain is checked against afunction.prototype, not against afunction itself.
... description the isprototypeof() method allows you to check whether or not an object exists within another object's prototype chain.
Object.prototype.propertyIsEnumerable() - JavaScript
if the object does not have the specified property, this method returns false.
...inherited properties var a = []; a.propertyisenumerable('constructor'); // returns false function firstconstructor() { this.property = 'is not enumerable'; } firstconstructor.prototype.firstmethod = function() {}; function secondconstructor() { this.method = function() { return 'is enumerable'; }; } secondconstructor.prototype = new firstconstructor; secondconstructor.prototype.constructor = secondconstructor; var o = new secondconstructor(); o.arbitraryproperty = 'is enumerable'; o.propertyisenumerable('arbitraryproperty'); //...
... returns true o.propertyisenumerable('method'); // returns true o.propertyisenumerable('property'); // returns false o.property = 'is enumerable'; o.propertyisenumerable('property'); // returns true // these return false as they are on the prototype which // propertyisenumerable does not consider (even though the last two // are iteratable with for-in) o.propertyisenumerable('prototype'); // returns false (as of js 1.8.1/ff3.6) o.propertyisenumerable('constructor'); // returns false o.propertyisenumerable('firstmethod'); // returns false specifications specification ecmascript (ecma-262)the definition of 'object.prototype.propertyisenumerable' in that specification.
Object.prototype.toSource() - JavaScript
description the tosource() method returns the following values: for the built-in object object, tosource() returns the following string indicating that the source code is not available: function object() { [native code] } for instances of object, tosource() returns a string representing the source code.
...a cyclically linked list or a tree that can be traversed both ways, tosource() will not recreate the self-reference, as of firefox 24.
...e dog: function dog(name, breed, color, sex) { this.name = name; this.breed = breed; this.color = color; this.sex = sex; } thedog = new dog('gabby', 'lab', 'chocolate', 'female'); calling the tosource() method of thedog displays the javascript source that defines the object: thedog.tosource(); // returns ({name:"gabby", breed:"lab", color:"chocolate", sex:"female"}) specifications not part of any standard.
Object.prototype.toString() - JavaScript
if this method is not overridden in a custom object, tostring() returns "[object type]", where type is the object type.
... the following code illustrates this: const o = new object(); o.tostring(); // returns [object object] note: starting in javascript 1.8.5, tostring() called on null returns [object null], and undefined returns [object undefined], as defined in the 5th edition of ecmascript and subsequent errata.
... by using radix you can also convert base 10 numbers (like 1,2,3,4,5,.........) to another base numbers, in example below we are converting base 10 number to a base 2 (binary) number let basetenint = 10; console.log(basetenint.tostring(2)); // expected output is "1010" and same for big integers let bignum = bigint(20); console.log(bignum.tostring(2)); // expected output is "10100" some common radix are 2 for binary numbers, 8 for octal numbers, 10 for decimal numbers, 16 for hexadecimal numbers.
Object.prototype.valueOf() - JavaScript
an object's valueof method is usually invoked by javascript, but you can invoke it yourself as follows: mynumbertype.valueof() note: objects in string contexts convert via the tostring() method, which is different from string objects converting to string primitives using valueof.
...but many objects do not convert to number, boolean, or function.
...his.number; }; var myobj = new mynumbertype(4); myobj + 3; // 7 using unary plus +"5" // 5 (string to number) +"" // 0 (string to number) +"1 + 2" // nan (doesn't evaluate) +new date() // same as (new date()).gettime() +"foo" // nan (string to number) +{} // nan +[] // 0 (tostring() returns an empty string list) +[1] // 1 +[1,2] // nan +new set([1]) // nan +bigint(1) // uncaught typeerror: cannot convert a bigint value to a number +undefined // nan +null // 0 +true // 1 +false // 0 specifications specification ecmascript (ecma-262)the definition of 'object.prototype.valueof' in that specification.
Object - JavaScript
however, an object may be deliberately created for which this is not true (e.g.
...other code cannot delete or change its properties.
... object.prototype.hasownproperty() returns a boolean indicating whether an object contains the specified property as a direct property of that object and not inherited through the prototype chain.
Promise.prototype.catch() - JavaScript
note the examples below are throwing instances of error.
... examples using and chaining the catch method var p1 = new promise(function(resolve, reject) { resolve('success'); }); p1.then(function(value) { console.log(value); // "success!" throw new error('oh, no!'); }).catch(function(e) { console.error(e.message); // "oh, no!" }).then(function(){ console.log('after a catch the chain is restored'); }, function () { console.log('not fired due to the catch'); }); // the following behaves the same as above p1.then(function(value) { console.log(value); // "success!" return promise.reject('oh, no!'); }).catch(function(e) { console.error(e); // "oh, no!" }).then(function(){ console.log('after a catch the chain is restored'); }, function () { console.log('not fired due to the catch'); }); gotchas when throwing errors ...
...caught exception!'); }, 1000); }); p2.catch(function(e) { console.error(e); // this is never called }); // errors thrown after resolve is called will be silenced var p3 = new promise(function(resolve, reject) { resolve(); throw new error('silenced exception!'); }); p3.catch(function(e) { console.error(e); // this is never called }); if it is resolved //create a promise which would not call onreject var p1 = promise.resolve("calling next"); var p2 = p1.catch(function (reason) { //this is never called console.error("catch p1!"); console.error(reason); }); p2.then(function (value) { console.log("next promise's onfulfilled"); /* next promise's onfulfilled */ console.log(value); /* calling next */ }, function (reason) { console.log("next promise's onreject...
Promise.resolve() - JavaScript
examples using the static promise.resolve method promise.resolve('success').then(function(value) { console.log(value); // "success" }, function(value) { // not called }); resolving an array var p = promise.resolve([1,2,3]); p.then(function(v) { console.log(v[0]); // 1 }); resolving another promise var original = promise.resolve(33); var cast = promise.resolve(original); cast.then(function(value) { console.log('value: ' + value); }); console.log('original === cast ?
... resolving thenables and throwing errors // resolving a thenable object var p1 = promise.resolve({ then: function(onfulfill, onreject) { onfulfill('fulfilled!'); } }); console.log(p1 instanceof promise) // true, object casted to a promise p1.then(function(v) { console.log(v); // "fulfilled!" }, function(e) { // not called }); // thenable throws before callback // promise rejects var thenable = { then: function(resolve) { throw new typeerror('throwing'); resolve('resolving'); }}; var p2 = promise.resolve(thenable); p2.then(function(v) { // not called }, function(e) { console.error(e); // typeerror: throwing }); // thenable throws after callback // promise resolves var thenable = { then: function(r...
...esolve) { resolve('resolving'); throw new typeerror('throwing'); }}; var p3 = promise.resolve(thenable); p3.then(function(v) { console.log(v); // "resolving" }, function(e) { // not called }); specifications specification ecmascript (ecma-262)the definition of 'promise.resolve' in that specification.
handler.deleteProperty() - JavaScript
return value the deleteproperty() method must return a boolean indicating whether or not the property has been successfully deleted.
... interceptions this trap can intercept these operations: property deletion: delete proxy[foo] and delete proxy.foo reflect.deleteproperty() invariants if the following invariants are violated, the proxy will throw a typeerror: a property cannot be deleted, if it exists as a non-configurable own property of the target object.
... const p = new proxy({}, { deleteproperty: function(target, prop) { if (prop in target){ delete target[prop] console.log('property removed: ' + prop) return true } else { console.log('property not found: ' + prop) return false } } }) let result p.a = 10 console.log('a' in p) // true result = delete p.a // "property removed: a" console.log(result) // true console.log('a' in p) // false result = delete p.a // "property not found: a" console.log(result) // false specifications specification ecmascript (ecma-262)the definition of '[[delete]]' in that specification.
handler.set() - JavaScript
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.
... interceptions this trap can intercept these operations: property assignment: proxy[foo] = bar and proxy.foo = bar inherited property assignment: object.create(proxy)[foo] = bar reflect.set() invariants if the following invariants are violated, the proxy will throw a typeerror: cannot change the value of a property to be different from the value of the corresponding target object property if the corresponding target object property is a non-writable, non-configurable data property.
... cannot set the value of a property if the corresponding target object property is a non-configurable accessor property that has undefined as its [[set]] attribute.
Proxy() constructor - JavaScript
it can be any sort of object, including a native array, a function, or even another proxy.
... examples selectively proxy property accessors in this example the target has two properties, notproxied and proxied.
... const target = { notproxied: "original value", proxied: "original value" }; const handler = { get: function(target, prop, receiver) { if (prop === "proxied") { return "replaced value"; } return reflect.get(...arguments); } }; const proxy = new proxy(target, handler); console.log(proxy.notproxied); // "original value" console.log(proxy.proxied); // "replaced value" specifications specification ecmascript (ecma-262)the definition of 'proxy constructor' in that specification.
RangeError - JavaScript
the rangeerror object indicates an error when a value is not in the set or range of allowed values.
... description a rangeerror is thrown when trying to pass a value as an argument to a function that does not allow a range that includes the value.
... this can be encountered when: passing a value that is not one of the allowed string values to string.prototype.normalize(), or when attempting to create an array of an illegal length with the array constructor, or when passing bad values to the numeric methods number.prototype.toexponential(), number.prototype.tofixed() or number.prototype.toprecision().
Reflect.deleteProperty() - JavaScript
return value a boolean indicating whether or not the property was successfully deleted.
... exceptions a typeerror, if target is not an object.
...it returns a boolean indicating whether or not the property was successfully deleted.
Reflect.getOwnPropertyDescriptor() - JavaScript
exceptions a typeerror, if target is not an object.
...flect.getownpropertydescriptor({x: 'hello'}, 'x') // {value: "hello", writable: true, enumerable: true, configurable: true} reflect.getownpropertydescriptor({x: 'hello'}, 'y') // undefined reflect.getownpropertydescriptor([], 'length') // {value: 0, writable: true, enumerable: false, configurable: false} difference to object.getownpropertydescriptor() if the target argument to this method is not an object (a primitive), then it will cause a typeerror.
... reflect.getownpropertydescriptor('foo', 0) // typeerror: "foo" is not non-null object object.getownpropertydescriptor('foo', 0) // { value: "f", writable: false, enumerable: true, configurable: false } specifications specification ecmascript (ecma-262)the definition of 'reflect.getownpropertydescriptor' in that specification.
RegExp.prototype.dotAll - JavaScript
the dotall property indicates whether or not the "s" flag is used with the regular expression.
...the "s" flag indicates that the dot special character (".") should additionally match the following line terminator ("newline") characters in a string, which it would not match otherwise: u+000a line feed (lf) ("\n") u+000d carriage return (cr) ("\r") u+2028 line separator u+2029 paragraph separator this effectively means the dot will match any character on the unicode basic multilingual plane (bmp).
... you cannot change this property directly.
RegExp.lastMatch ($&) - JavaScript
description the lastmatch property is static, it is not a property of an individual regular expression object.
... you can not use the shorthand alias with the dot property accessor (regexp.$&), because the parser expects an expression with "&" in that case and a syntaxerror is thrown.
... use the bracket notation for property access.
RegExp.lastParen ($+) - JavaScript
description the lastparen property is static, it is not a property of an individual regular expression object.
... you can not use the shorthand alias with the dot property accessor (regexp.$+), because the parser expects an expression with "+" in that case and a syntaxerror is thrown.
... use the bracket notation for property access.
RegExp.leftContext ($`) - JavaScript
description the leftcontext property is static, it is not a property of an individual regular expression object.
... you can not use the shorthand alias with the dot property accessor (regexp.$`), because the parser expects a starting template string in that case and a syntaxerror is thrown.
... use the bracket notation for property access.
RegExp.rightContext ($') - JavaScript
description the rightcontext property is static, it is not a property of an individual regular expression object.
... you can not use the shorthand alias with the dot property accessor (regexp.$'), because the parser expects a starting string in that case and a syntaxerror is thrown.
... use the bracket notation for property access.
RegExp.prototype.test() - JavaScript
test() returns a boolean, unlike the string.prototype.search() method (which returns the index of a match, or -1 if not found).
... const str = 'hello world!'; const result = /^hello/.test(str); console.log(result); // true the following example logs a message which depends on the success of the test: function testinput(re, str) { let midstring; if (re.test(str)) { midstring = 'contains'; } else { midstring = 'does not contain'; } console.log(`${str} ${midstring} ${re.source}`); } using test() on a regex with the "global" flag when a regex has the global flag set, test() will advance the lastindex of the regex.
... note: as long as test() returns true, lastindex will not reset—even when testing a different string!
RegExp.prototype.toSource() - JavaScript
examples native function for the built-in regexp object, tosource() returns the following string indicating that the source code is not available: function regexp() { [native code] } for instances of regexp, tosource() returns a string representing the source code.
... this method is usually called internally by javascript and not explicitly in web code.
... specifications not part of any standard.
Set.prototype.forEach() - JavaScript
it is not invoked for values which have been deleted.
...callback is not invoked for values deleted before being visited.
... foreach() executes the callback function once for each element in the set object; it does not return a value.
Set - JavaScript
in an earlier version of ecmascript specification, this was not based on the same algorithm as the one used in the === operator.
... set.prototype.has(value) returns a boolean asserting whether an element is present with the given value in the set object or not.
...et object let myset = new set() myset.add(1) // set [ 1 ] myset.add(5) // set [ 1, 5 ] myset.add(5) // set [ 1, 5 ] myset.add('some text') // set [ 1, 5, 'some text' ] let o = {a: 1, b: 2} myset.add(o) myset.add({a: 1, b: 2}) // o is referencing a different object, so this is okay myset.has(1) // true myset.has(3) // false, since 3 has not been added to the set myset.has(5) // true myset.has(math.sqrt(25)) // true myset.has('some text'.tolowercase()) // true myset.has(o) // true myset.size // 5 myset.delete(5) // removes 5 from the set myset.has(5) // false, 5 has been removed myset.size // 4, since we just removed one value console.log(myset) // logs set(4) [ 1, "some text", {…}, ...
SharedArrayBuffer - JavaScript
unlike an arraybuffer, a sharedarraybuffer cannot become detached.
... description allocating and sharing memory to share memory using sharedarraybuffer objects from one agent in the cluster to another (an agent is either the web page’s main program or one of its web workers), postmessage and structured cloning is used.
...this is established when the array is constructed and cannot be changed.
String.prototype.endsWith() - JavaScript
description this method lets you determine whether or not a string ends with another string.
... polyfill this method has been added to the ecmascript 6 specification and may not be available in all javascript implementations yet.
... however, you can polyfill string.prototype.endswith() with the following snippet: if (!string.prototype.endswith) { string.prototype.endswith = function(search, this_len) { if (this_len === undefined || this_len > this.length) { this_len = this.length; } return this.substring(this_len - search.length, this_len) === search; }; } examples using endswith() let str = 'to be, or not to be, that is the question.' console.log(str.endswith('question.')) // true console.log(str.endswith('to be')) // false console.log(str.endswith('to be', 19)) // true specifications specification ecmascript (ecma-262)the definition of 'string.prototype.endswith' in that specification.
String.prototype.lastIndexOf() - JavaScript
returns -1 if the value is not found.
... return value the index of the last occurrence of searchvalue; -1 if not found.
... 'canal'.lastindexof('a'); // returns 3 'canal'.lastindexof('a', 2); // returns 1 'canal'.lastindexof('a', 0); // returns -1 'canal'.lastindexof('x'); // returns -1 'canal'.lastindexof('c', -5); // returns 0 'canal'.lastindexof('c', 0); // returns 0 'canal'.lastindexof(''); // returns 5 'canal'.lastindexof('', 2); // returns 2 note: 'abab'.lastindexof('ab', 2) will return 2 and not 0, as fromindex limits only the beginning of the match.
String.prototype.matchAll() - JavaScript
return value an iterator (which is not a restartable iterable).
... const regexp = regexp('[a-c]',''); const str = 'abc'; str.matchall(regexp); // typeerror matchall internally makes a clone of the regexp—so, unlike regexp.exec(), lastindex does not change as the string is scanned.
... const regexp = regexp('[a-c]','g'); regexp.lastindex = 1; const str = 'abc'; array.from(str.matchall(regexp), m => `${regexp.lastindex} ${m[0]}`); // array [ "1 b", "1 c" ] better access to capturing groups (than string.prototype.match()) another compelling reason for matchall is the improved access to capture groups.
String.prototype.repeat() - JavaScript
rangeerror: repeat count must be less than infinity and not overflow maximum string size.
... polyfill this method has been added to the ecmascript 2015 specification and may not be available in all javascript implementations yet.
...but anyway, most current (august 2014) browsers can't handle // strings 1 << 28 chars or longer, so: if (str.length * count >= 1 << 28) throw new rangeerror('repeat count must not overflow maximum string size'); var maxcount = str.length * count; count = math.floor(math.log(count) / math.log(2)); while (count) { str += str; count--; } str += str.substring(0, maxcount - str.length); return str; } } examples using repeat 'abc'.repeat(-1) // rangeerror 'abc'.repeat(0) // '' 'abc'.repeat(1) // 'abc' 'abc'.repeat(2) // ...
String.prototype.slice() - JavaScript
the character at this index will not be included.
...changes to the text in one string do not affect the other string.
... slice() extracts up to but not including endindex.
String.prototype.startsWith() - JavaScript
description this method lets you determine whether or not a string begins with another string.
... polyfill this method has been added to the ecmascript 2015 specification and may not be available in all javascript implementations yet.
... examples using startswith() //startswith let str = 'to be, or not to be, that is the question.' console.log(str.startswith('to be')) // true console.log(str.startswith('not to be')) // false console.log(str.startswith('not to be', 10)) // true specifications specification ecmascript (ecma-262)the definition of 'string.prototype.startswith' in that specification.
String.prototype.substring() - JavaScript
description substring() extracts characters from indexstart up to but not including indexend.
...ng = 'mozilla' let anystring4 = anystring.substring(anystring.length - 4) console.log(anystring4) // displays 'zilla' the last 5 characters let anystring = 'mozilla' let anystring5 = anystring.substring(anystring.length - 5) console.log(anystring5) the difference between substring() and substr() there's a subtle difference between the substring() and substr() methods, so you should be careful not to get them confused.
... // replaces olds with news in the string fulls function replacestring(olds, news, fulls) { for (let i = 0; i < fulls.length; ++i) { if (fulls.substring(i, i + olds.length) == olds) { fulls = fulls.substring(0, i) + news + fulls.substring(i + olds.length, fulls.length) } } return fulls } replacestring('world', 'web', 'brave new world') note that this can result in an infinite loop if olds is itself a substring of news — for example, if you attempted to replace 'world' with 'otherworld' here.
String.prototype.toSource() - JavaScript
examples native function for the built-in string object, tosource() returns the following string indicating that the source code is not available: function string() { [native code] } for instances of string or string literals, tosource() returns a string representing the source code.
... this method is usually called internally by javascript and not explicitly in web code.
... specifications not part of any standard.
String.prototype.trim() - JavaScript
trim() does not affect the value of the str itself.
... polyfill running the following code before any other code will create trim() if it's not natively available.
... if (!string.prototype.trim) { string.prototype.trim = function () { return this.replace(/^[\s\ufeff\xa0]+|[\s\ufeff\xa0]+$/g, ''); }; } examples using trim() the following example displays the lowercase string 'foo': var orig = ' foo '; console.log(orig.trim()); // 'foo' // another example of .trim() removing whitespace from just one side.
Symbol() constructor - JavaScript
the symbol() constructor returns a value of type symbol, but is incomplete as a constructor because it does not support the syntax "new symbol()" and it is not intended to be subclassed.
...a description of the symbol which can be used for debugging but not to access the symbol itself.
...note that symbol("foo") does not coerce the string "foo" into a symbol.
Symbol.iterator - JavaScript
some built-in types have a default iteration behavior, while other types (such as object) do not.
...le] // [1, 2, 3] or iterables can be defined directly inside a class or object using a computed property: class foo { *[symbol.iterator] () { yield 1; yield 2; yield 3; } } const someobj = { *[symbol.iterator] () { yield 'a'; yield 'b'; } } [...new foo] // [ 1, 2, 3 ] [...someobj] // [ 'a', 'b' ] non-well-formed iterables if an iterable's @@iterator method does not return an iterator object, then it is a non-well-formed iterable.
... using it as such is likely to result in runtime exceptions or buggy behavior: var nonwellformediterable = {} nonwellformediterable[symbol.iterator] = () => 1 [...nonwellformediterable] // typeerror: [] is not a function specifications specification ecmascript (ecma-262)the definition of 'symbol.iterator' in that specification.
Symbol.match - JavaScript
now, if the match symbol is set to false (or a falsy value), it indicates that the object is not intended to be used as a regular expression object.
... property attributes of symbol.match writable no enumerable no configurable no examples disabling the isregexp check the following code will throw a typeerror: '/bar/'.startswith(/bar/); // throws typeerror, as /bar/ is a regular expression // and symbol.match is not modified.
... however, if you set symbol.match to false, the isregexp check (that uses the match property) will indicate that the object is not a regular expression object.
Symbol.unscopables - JavaScript
note that if using strict mode, with statements are not available and will likely also not need this symbol.
...that means that inside with environment "keys" would now be the method and not the variable.
... var obj = { foo: 1, bar: 2 }; obj[symbol.unscopables] = { foo: false, bar: true }; with (obj) { console.log(foo); // 1 console.log(bar); // referenceerror: bar is not defined } specifications specification ecmascript (ecma-262)the definition of 'symbol.unscopables' in that specification.
TypedArray.prototype.forEach() - JavaScript
it is not invoked for indexes that have been deleted or elided.
...elements that are appended to the typed array after the call to foreach() begins will not be visited by callback.
... if the values of existing elements of the typed array are changed, the value passed to callback will be the value at the time foreach() visits them; elements that are deleted before being visited are not visited.
TypedArray.from() - JavaScript
differences from array.from() some subtle distinctions between array.from() and typedarray.from(): if the thisarg value passed to typedarray.from() is not a constructor, typedarray.from() will throw a typeerror, where array.from() defaults to creating a new array.
... 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('this is not a typed array.'); } func = func || function (elem) { return elem; }; if (typeof func !== 'function') { throw new typeerror('specified argument is not a function'); } obj = object(obj); if (!obj['length']) { return new this(0); } var c...
TypedArray.prototype.subarray() - JavaScript
the whole array will be included in the new view if this value is not specified.
...if not specified, all elements from the one specified by begin to the end of the array are included in the new view.
... also note that this is creating a new view on the existing buffer; changes to the new object's contents will impact the original object and vice versa.
WebAssembly.CompileError() constructor - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jscompileerror() constructorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0legend full support full support no support no supportsee implementation...
... notes.see implementation notes.
WebAssembly.Instance() constructor - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsinstance() constructorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0legend full support full support no support no supportsee implementation...
... notes.see implementation notes.
WebAssembly.LinkError() constructor - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jslinkerror() constructorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0legend full support full support no support no supportsee implementation...
... notes.see implementation notes.
WebAssembly.Memory.prototype.buffer - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsbufferchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0legend full support full support no support no supportsee implementation...
... notes.see implementation notes.
WebAssembly.Module() constructor - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsmodule() constructorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0legend full support full support no support no supportsee implementation...
... notes.see implementation notes.
WebAssembly.RuntimeError() constructor - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsruntimeerror() constructorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0legend full support full support no support no supportsee implementation...
... notes.see implementation notes.
WebAssembly.Table.prototype.grow() - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsgrowchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0legend full support full support no support no supportsee implementation...
... notes.see implementation notes.
WebAssembly.Table.prototype.length - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jslengthchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11webview android full support ...
... 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0legend full support full support no support no supportsee implementation...
... notes.see implementation notes.
unescape() - JavaScript
warning: although unescape() is not strictly deprecated (as in "removed from the web standards"), it is defined in annex b of the ecma-262 standard, whose introduction states: … all of the language features and behaviours specified in this annex have one or more undesirable characteristics and in the absence of legacy usage would be removed from this specification.
... … … programmers should not use or assume the existence of these features and behaviours when writing new ecmascript code.
... note: do not use unescape to decode uris, use decodeuri instead.
uneval() - JavaScript
note: this will not return a json representation of object.
... description uneval() is a top-level function and is not associated with any object.
... examples using uneval var a = 1; uneval(a); // returns a string containing 1 var b = '1'; uneval(b); // returns a string containing "1" uneval(function foo() {}); // returns "(function foo(){})" var a = uneval(function foo() { return 'hi'; }); var foo = eval(a); foo(); // returns "hi" specifications not part of any standard.
Comma operator (,) - JavaScript
usage notes you can use the comma operator when you want to include multiple expressions in a location that requires a single expression.
... the following code prints the values of the diagonal elements in the array: for (var i = 0, j = 9; i <= 9; i++, j--) console.log('a[' + i + '][' + j + '] = ' + a[i][j]); note that the comma operators in assignments may appear not to have the normal effect of comma operators because they don't exist within an expression.
... var a, b, c; a = b = 3, c = 4; // returns 4 in console console.log(a); // 3 (left-most) var x, y, z; x = (y = 5, z = 6); // returns 6 in console console.log(x); // 6 (right-most) processing and then returning another example that one could make with comma operator is processing before returning.
Equality (==) - JavaScript
the most notable difference between this operator and the strict equality (===) operator is that the strict equality operator does not attempt type conversion.
... examples comparison with no type conversion 1 == 1; // true "hello" == "hello"; // true comparison with type conversion "1" == 1; // true 1 == "1"; // true 0 == false; // true 0 == null; // false 0 == undefined; // false 0 == !!null; // true, look at logical not operator 0 == !!undefined; // true, look at logical not operator null == undefined; // true const number1 = new number(3); const number2 = new number(3); number1 == 3; // true number1 == number2; // false comparison of objects const object1 = {"key": "value"} const object2 = {"key": "value"}; object1 == object2 // false object2 == object2 // true comparing strings and string...
... objects note that strings constructed using new string() are objects.
Inequality (!=) - JavaScript
the inequality operator (!=) checks whether its two operands are not equal, returning a boolean result.
... syntax x != y description the inequality operator checks whether its operands are not equal.
...examples comparison with no type conversion 1 != 2; // true "hello" != "hola"; // true 1 != 1; // false "hello" != "hello"; // false comparison with type conversion "1" != 1; // false 1 != "1"; // false 0 != false; // false 0 != null; // true 0 != undefined; // true 0 != !!null; // false, look at logical not operator 0 != !!undefined; // false, look at logical not operator null != undefined; // false const number1 = new number(3); const number2 = new number(3); number1 != 3; // false number1 != number2; // true comparison of objects const object1 = {"key": "value"} const object2 = {"key": "value"}; object1 != object2 // true object2 != object2 // false specifications s...
await - JavaScript
rv returns the fulfilled value of the promise, or the value itself if it's not a promise.
... if the value of the expression following the await operator is not a promise, it's converted to a resolved promise.
...} f2(); conversion to promise if the value is not a promise, it converts the value to a resolved promise, and waits for it.
typeof - JavaScript
result undefined "undefined" null "object" (see below) boolean "boolean" number "number" bigint (new in ecmascript 2020) "bigint" string "string" symbol (new in ecmascript 2015) "symbol" function object (implements [[call]] in ecma-262 terms) "function" any other object "object" note: ecmascript 2019 and older permitted implementations to have typeof return any implementation-defined string value for non-callable non-standard exotic objects.
... examples basic usage // numbers typeof 37 === 'number'; typeof 3.14 === 'number'; typeof(42) === 'number'; typeof math.ln2 === 'number'; typeof infinity === 'number'; typeof nan === 'number'; // despite being "not-a-number" typeof number('1') === 'number'; // number tries to parse things into numbers typeof number('shoe') === 'number'; // including values that cannot be type coerced to a number typeof 42n === 'bigint'; // strings typeof '' === 'string'; typeof 'bla' === 'string'; typeof `template literal` === 'string'; typeof '1' === 'string'; // note that a number within a string is still typeof string typeof (typeof 1) === 'string'; // typeof always returns a string typeof s...
...(logical not) operator are equivalent to boolean() // symbols typeof symbol() === 'symbol' typeof symbol('foo') === 'symbol' typeof symbol.iterator === 'symbol' // undefined typeof undefined === 'undefined'; typeof declaredbutundefinedvariable === 'undefined'; typeof undeclaredvariable === 'undefined'; // objects typeof {a: 1} === 'object'; // use array.isarray or object.prototype.tostring.call // to differentiate regular objects from arrays typeof [1, 2, 4] === 'object'; typeof new ...
yield* - JavaScript
the yield* expression is used to delegate to another generator or iterable object.
... examples delegating to another generator in following code, values yielded by g1() are returned from next() calls just like those which are yielded by g2().
...r.next()); // {value: 2, done: false} console.log(iterator.next()); // {value: "3", done: false} console.log(iterator.next()); // {value: "4", done: false} console.log(iterator.next()); // {value: 5, done: false} console.log(iterator.next()); // {value: 6, done: false} console.log(iterator.next()); // {value: undefined, done: true} the value of yield* expression itself yield* is an expression, not a statement—so it evaluates to a value.
import.meta - JavaScript
normally the left-hand side of the dot is the object on which property access is performed, but here import is not really an object.
... note that this will include query parameters and/or hash (i.e., following the ?
... for example, with the following html: <script type="module"> import './index.mjs?someurlinfo=5'; </script> ..the following javascript file will log the `someurlinfo parameter: // index.mjs new url(import.meta.url).searchparams.get('someurlinfo'); // 5 the same applies when a file imports another: // index.mjs import './index2.mjs?someurlinfo=5'; // index2.mjs new url(import.meta.url).searchparams.get('someurlinfo'); // 5 note that while node.js will pass on query parameters (or the hash) as in the latter example, as of node 14.1.0, a url with query parameters will err when loading in the form node --experimental-modules index.mjs?someurlinfo=5 (it is treated as a file rather than a url in this context).
try...catch - JavaScript
if an inner try statement does not have a catch-block, the enclosing try statement's catch-block is used instead.
...note that the finally-block executes regardless of whether an exception is thrown.
...cludes exceptions thrown inside of the catch-block: (function() { try { try { throw new error('oops'); } catch (ex) { console.error('inner', ex.message); throw ex; } finally { console.log('finally'); return; } } catch (ex) { console.error('outer', ex.message); } })(); // output: // "inner" "oops" // "finally" the outer "oops" is not thrown because of the return in the finally-block.
Trailing commas - JavaScript
furthermore, when using a rest parameters, trailing commas are not allowed: function f(,) {} // syntaxerror: missing formal parameter (,) => {}; // syntaxerror: expected expression, got ',' f(,) // syntaxerror: expected expression, got ',' function f(...p,) {} // syntaxerror: parameter after rest parameter (...p,) => {} // syntaxerror: expected closing parenthesis, got ',' trailing commas in destructuring a trailing comma is also al...
...lowed on the left-hand side when using destructuring assignment: // array destructuring with trailing comma [a, b,] = [1, 2]; // object destructuring with trailing comma var o = { p: 42, q: true, }; var {p, q,} = o; again, when using a rest element, a syntaxerror will be thrown: var [a, ...b,] = [1, 2, 3]; // syntaxerror: rest element may not have a trailing comma trailing commas in json trailing commas in objects were only introduced in ecmascript 5.
... as json is based on javascript's syntax prior to es5, trailing commas are not allowed in json.
<mo> - MathML
WebMathMLElementmo
) you usually do not need to specify this attribute explicitly.
...(it is the default value if the operator is not included in a <mrow> element.) postfix, closing fences.
...that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography.
<ms> - MathML
WebMathMLElementms
note that quotation marks should not be specified unless they are part of the string literal.
... the content of an <ms> element is not an ascii string per se, but rather a sequence of characters and <mglyph> and <malignmark> elements.
...that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography.
<mtext> - MathML
WebMathMLElementmtext
the mathml <mtext> element is used to render arbitrary text with no notational meaning, such as comments or annotations.
... to display text with notational meaning, use <mi> and <mo> instead.
...that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography.
CSS and JavaScript animation performance - Web Performance
developers can create an animation by simply changing an element's style each time the loop is called (or updating the canvas draw, or whatever.) note: like css transitions and animations, requestanimationframe() pauses when the current tab is pushed into the background.
...the key is that as long as the properties we want to animate do not trigger reflow/repaint (read css triggers for more information), we can move those sampling operations out of the main thread.
... note: in nightly/developer edition, you should see that omta is enabled by default, so you might have to do the tests the other way around (test with it enabled first, then disable to test without omta.) summary browsers are able to optimize rendering flows.
Recommended Web Performance Timings: How long is too long? - Web Performance
as noted in the description of the critical rendering path, when received, browsers immediately start processing the html, rendering the content as it is received rather than waiting for additional assets to load.
...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.
...while a slower than 100ms reaction may create a disconnect between the user interaction and the response, a 100 to 200ms transition for a response may help the user notice the response their interaction initiated, such as a menu opening.
Applying SVG effects to HTML content - SVG: Scalable Vector Graphics
note: references to svg in external files must be to the same origin as the referencing document.
...gradient-1" y2="1"> <stop stop-color="white" offset="0"/> <stop stop-opacity="0" offset="1"/> </lineargradient> <circle cx="0.25" cy="0.25" r="0.25" id="circle" fill="white"/> <rect x="0.5" y="0.2" width="300" height="100" fill="url(#gradient-1)"/> </mask> </svg> .target { mask: url(#mask-1); } p { width: 300px; border: 1px solid #000; display: inline-block; } note that in the css, the mask is specified using a url to the id #mask-1, which is the id of the svg mask specified below it.
...notice that even the clickable areas for links are clipped.
calcMode - SVG: Scalable Vector Graphics
the default mode is linear, however if the attribute does not support linear interpolation (e.g.
... 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.
...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.
color-interpolation-filters - SVG: Scalable Vector Graphics
notes: this property just has an affect on filter operations.
... note: as a presentation attribute, color-interpolation can be used as a css property.
...n attribute, it can be applied to any element but it only has an effect on the following eighteen elements: <fespotlight>, <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, <feturbulence> usage notes value auto | srgb | linearrgb default value linearrgb animatable yes auto indicates that the user agent can choose either the srgb or linearrgb spaces for color interpolation.
color - SVG: Scalable Vector Graphics
WebSVGAttributecolor
note: as a presentation attribute, color can be used as a css property.
... as a presentation attribute, it can be applied to any element, but as noted above, it has no direct effect on svg elements.
... usage notes value <color> | inherit default value depends on user agent animatable yes example html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <g color="green"> <rect width="50" height="50" fill="currentcolor" /> <circle r="25" cx="70" cy="70" stroke="currentcolor" fill="none" stroke-width="5" /> </g> </svg> specifications specification status comment scalable vector graphics (svg) 2the definition of 'color' in that specification.
contentStyleType - SVG: Scalable Vector Graphics
this language is used for all instances of style that do not specify their own styling language, such as the style attribute that is available on many elements.
... 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.
enable-background - SVG: Scalable Vector Graphics
note: as a presentation attribute, enable-background can be used as a css property.
... as a presentation attribute, it can be applied to any element but it has effect only on the following eleven elements: <a>, <defs>, <glyph>, <g>, <marker>, <mask>, <missing-glyph>, <pattern>, <svg>, <switch>, and <symbol> context notes value accumulate | new [ <x> <y> <width> <height> ]?
...if one, two, or three values are specified or if neither <width> nor <height> are specified, the backgroundimage and backgroundalpha of a filter primitive are processed as if background image processing were not enabled.
fill-rule - SVG: Scalable Vector Graphics
note: as a presentation attribute, fill-rule can be used as a css property.
...it is therefore considered outside the shape, and not filled.
... --> <polygon fill-rule="evenodd" stroke="red" points="150,0 121,90 198,35 102,35 179,90"/> </svg> usage notes value nonzero | evenodd default value nonzero animatable yes the fill-rule attribute provides two options for how the inside (that is, the area to be filled) of a shape is determined: nonzero the value nonzero determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction, and then examining the places where a segment of the shape crosses the ray.
font-size-adjust - SVG: Scalable Vector Graphics
note: as a presentation attribute, font-size-adjust can be used as a css property.
... </text> </svg> usage notes default value none value none | <number> animatable yes none choose the size of the font based only on the font-size property.
...this means that the first-choice font, when available, will appear the same size in browsers, whether or not they support font-size-adjust.
marker-mid - SVG: Scalable Vector Graphics
note: as a presentation attribute, marker-mid can be used as a css property.
...html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <defs> <marker id="circle" markerwidth="8" markerheight="8" refx="4" refy="4"> <circle cx="4" cy="4" r="4" stroke="none" fill="#f00"/> </marker> </defs> <polyline fill="none" stroke="black" points="20,100 40,60 70,80 100,20" marker-mid="url(#circle)"/> </svg> usage notes value none | <marker-ref> default value none animatable yes none indicates that no marker symbol shall be drawn at the given vertices.
...if the reference is not valid, then no marker will be drawn.
opacity - SVG: Scalable Vector Graphics
WebSVGAttributeopacity
note: as a presentation attribute, opacity can be used as a css property.
...ient id="gradient" x1="0%" y1="0%" x2="0" y2="100%"> <stop offset="0%" style="stop-color:skyblue;" /> <stop offset="100%" style="stop-color:seagreen;" /> </lineargradient> </defs> <rect x="0" y="0" width="100%" height="100%" fill="url(#gradient)" /> <circle cx="50" cy="50" r="40" fill="black" /> <circle cx="150" cy="50" r="40" fill="black" opacity="0.3" /> </svg> usage notes default value 1 value <alpha-value> animatable yes <alpha-value> the uniform opacity setting to be applied across an entire object, as a <number>.
... candidate recommendation references the specification in css color 3 and notes that there are some related attributes.
orient - SVG: Scalable Vector Graphics
WebSVGAttributeorient
th d="m 0 0 l 10 5 l 0 10 z" fill="red" /> </marker> </defs> <polyline points="10,10 10,90 90,90" fill="none" stroke="black" marker-start="url(#arrow)" marker-end="url(#arrow)" /> <polyline points="15,80 29,50 43,60 57,30 71,40 85,15" fill="none" stroke="grey" marker-start="url(#dataarrow)" marker-mid="url(#dataarrow)" marker-end="url(#dataarrow)" /> </svg> usage notes value auto | auto-start-reverse | <angle> | <number> default value 0 animatable yes (non-additive) auto this value indicates that the marker is oriented such that its positive x-axis is pointing in a direction relative to the path at the position the marker is placed.
... note: this allows a single arrowhead marker to be defined that can be used for both the start and end of a path, i.e.
... note: for example, if a value of 45 is given, then the marker's positive x-axis would be pointing down and right in the shape's coordinate system.
patternContentUnits - SVG: Scalable Vector Graphics
note: that this attribute has no effect if attribute viewbox is specified on the <pattern> element.
... note that the size of the tile is computed against the bounding box of the target element --> <pattern id="p1" width="20%" height="20%" patterncontentunits="userspaceonuse"> <circle cx="10" cy="10" r="10" /> </pattern> <!-- a pattern tile that content coordinates and values are computed against the bounding box of the target element.
... note that the size of the tile is also computed against the bounding box of the target element --> <pattern id="p2" width="20%" height="20%" patterncontentunits="objectboundingbox"> <circle cx=".1" cy=".1" r=".1" /> </pattern> <!-- left square with user space tiles --> <rect x="10" y="10" width="80" height="80" fill="url(#p1)" /> <!-- right square with bounding box tiles --> <rect x="110" y="10" width="80" height="80" fill="url(#p2)" /> </svg> pattern for <pattern>, patterncontentunits defines the coordinate system in use for the content of the element.
rendering-intent - SVG: Scalable Vector Graphics
only one element is using this attribute: <color-profile> usage notes value auto | perceptual | relative-colorimetric | saturation | absolute-colorimetric default value auto animatable yes auto this value allows the user agent to determine the best intent based on the content type.
... note: this method should be used for images.
... note: this option is generally not recommended.
rotate - SVG: Scalable Vector Graphics
WebSVGAttributerotate
usage notes value auto | auto-reverse | <number> default value 0 animatable no the auto and auto-reverse values allow the animated element's rotation to change dynamically as it travels along the path.
... setting rotate's value to a number specifies a constant rotation, in degrees, that does not change with the animation.
... examples svg <svg width="400" height="120" viewbox="0 0 480 120" xmlns="http://www.w3.org/2000/svg"> <!-- draw the outline of the motion path in grey --> <path d="m10,110 a120,120 -45 0,1 110 10 a120,120 -45 0,1 10,110" stroke="lightgrey" stroke-width="2" fill="none" id="themotionpath"/> <!-- red arrow which will not rotate --> <path fill="red" d="m-5,-5 l10,0 -5,5 0,0 z"> <!-- define the motion path animation --> <animatemotion dur="6s" repeatcount="indefinite" rotate="0"> <mpath href="#themotionpath"/> </animatemotion> </path> <g transform="translate(100, 0)"> <use href="#themotionpath"/> <!-- green arrow which will rotate along the motion path --> <path fill="green" d="m-...
rx - SVG: Scalable Vector Graphics
WebSVGAttributerx
value <length> | <percentage> | auto default value auto animatable yes note: starting with svg2, rx is a geometry property meaning this attribute can also be used as a css property for ellipses.
... the way the value of the rx attribute is interpreted depend on both the ry attribute and the width of the rectangle: if a properly specified value is provided for rx but not for ry (or the opposite), then the browser will consider the missing value equal to the defined one.
... value <length> | <percentage> | auto default value auto animatable yes note: starting with svg2, rx is a geometry property meaning this attribute can also be used as a css property for rects.
ry - SVG: Scalable Vector Graphics
WebSVGAttributery
value <length> | <percentage> | auto default value auto animatable yes note: starting with svg2, ry is a geometry property meaning this attribute can also be used as a css property for ellipses.
... the way the value of the ry attribute is interpreted depend on both the rx attribute and the width of the rectangle: if a properly specified value is provided for ry but not for rx (or the opposite), then the browser will consider the missing value equal to the defined one.
... value <length> | <percentage> | auto default value auto animatable yes note: starting with svg2, ry is a geometry property meaning this attribute can also be used as a css property for rects.
stroke-linecap - SVG: Scalable Vector Graphics
note: as a presentation attribute stroke-linecap can be used as a css property.
... <line x1="1" y1="3" x2="5" y2="3" stroke="black" stroke-linecap="round" /> <!-- effect of the "square" value --> <line x1="1" y1="5" x2="5" y2="5" stroke="black" stroke-linecap="square" /> <!-- the following pink lines highlight the position of the path for each stroke --> <path d="m1,1 h4 m1,3 h4 m1,5 h4" stroke="pink" stroke-width="0.025" /> </svg> usage notes value butt | round | square default value butt animatable yes butt the butt value indicates that the stroke for each subpath does not extend beyond its two endpoints.
... on a zero length subpath, the path will not be rendered at all.
stroke - SVG: Scalable Vector Graphics
WebSVGAttributestroke
the stroke attribute is a presentation attribute defining the color (or any svg paint servers like gradients or patterns) used to paint the outline of the shape; note: as a presentation attribute stroke can be used as a css property.
...roke --> <circle cx="5" cy="5" r="4" fill="none" stroke="green" /> <!-- stroke a circle with a gradient --> <defs> <lineargradient id="mygradient"> <stop offset="0%" stop-color="green" /> <stop offset="100%" stop-color="white" /> </lineargradient> </defs> <circle cx="15" cy="5" r="4" fill="none" stroke="url(#mygradient)" /> </svg> usage notes value <paint> default value none animatable yes specifications specification status comment scalable vector graphics (svg) 2the definition of 'stroke' in that specification.
... legend compatibility unknown compatibility unknown note: for information on using the context-stroke (and context-fill) values from html documents, see the documentation for the non-standard -moz-context-properties property.
style - SVG: Scalable Vector Graphics
WebSVGAttributestyle
html,body,svg { height:100% } <svg viewbox="0 0 100 60" xmlns="http://www.w3.org/2000/svg"> <rect width="80" height="40" x="10" y="10" style="fill: skyblue; stroke: cadetblue; stroke-width: 2;"/> </svg> usage notes value <style> default value none animatable no <style> the syntax of style data depends on the style sheet language.
... note: in theory, the contentstyletype attribute could be used to specify styling languages other than css, like xsl(t).
... however, this was never implemented satisfactorily in browsers, so you should not rely on it.
text-anchor - SVG: Scalable Vector Graphics
it is not applicable to other types of auto-wrapped text.
... note: as a presentation attribute, text-anchor can be used as a css property.
...text text-anchor="middle" x="60" y="75">a</text> <text text-anchor="end" x="60" y="110">a</text> <!-- materialisation of anchors --> <circle cx="60" cy="40" r="3" fill="red" /> <circle cx="60" cy="75" r="3" fill="red" /> <circle cx="60" cy="110" r="3" fill="red" /> <style><![cdata[ text { font: bold 36px verdana, helvetica, arial, sans-serif; } ]]></style> </svg> usage notes default value start value start | middle | end animatable yes start the rendered characters are aligned such that the start of the text string is at the initial current text position.
transform-origin - SVG: Scalable Vector Graphics
note: as a presentation attribute in svg, transform-origin corresponds in syntax and behavior to the transform-origin property in css, and can be used as css property to style svg.
... usage notes values [ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?where <length-percentage> = <length> | <percentage> default value 50%, 50% animatable yes the transform-origin property may be specified using one, two, or three values, where each value represents an offset.
... offsets that are not explicitly defined are reset to their corresponding initial values.
viewBox - SVG: Scalable Vector Graphics
WebSVGAttributeviewBox
the numbers separated by whitespace and/or a comma, which specify a rectangle in user space which is mapped to the bounds of the viewport established for the associated svg element (not the browser viewport).
... html,body,svg { height:100% } svg:not(:root) { display: inline-block; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- with relative unit such as percentage, the visual size of the square looks unchanged regardless of the viewbox --> <rect x="0" y="0" width="100%" height="100%"/> <!-- with a large viewbox the circle looks small as it is using user units for the r attribute: 4 resolved against 100 as set in the viewbox --> <circle cx="50%" cy="50%" r="4" fill="white"/> </svg> <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <!-- with relative unit such as percentage, the visual size of the square looks unchanged regardless of the viewbox` --> <rect x="0" y="0" width="100%" height="100%"/> <!-- with a small viewbox th...
... note: values for width or height lower or equal to 0 disable rendering of the element.
<animateMotion> - SVG: Scalable Vector Graphics
note: to reuse an existing path, it will be necessary to use an <mpath> element inside the <animatemotion> element instead of the path attribute.
... value type: <number>|auto|auto-reverse; default value: 0; animatable: no note: for <animatemotion> the default value for the calcmode attribute is paced animation attributes animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill animation value attributes calcmode, values, keytimes, keysplines, from, to, by other animation attributes most notably: attributename, additive, accumulate animation event attributes most notably:...
... onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes this element implements the svganimatemotionelement interface.
<circle> - SVG: Scalable Vector Graphics
WebSVGElementcircle
value type: <number> ; default value: none; animatable: yes note: starting with svg2, cx, cy, and r are geometry properties, meaning those attributes can also be used as css properties for that element.
... global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current,...
...a-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<circle>' in that specification.
<cursor> - SVG: Scalable Vector Graphics
WebSVGElementcursor
note: the css cursor property should be used instead of this element.
...typically, the other pixel information (e.g., the r, g and b channels) defines the colors for those parts of the cursor which are not masked out.
... note that cursors usually contain at least two colors so that the cursor can be visible over most backgrounds.
<defs> - SVG: Scalable Vector Graphics
WebSVGElementdefs
objects created inside a <defs> element are not rendered directly.
...circle" cx="0" cy="0" r="5" /> <lineargradient id="mygradient" gradienttransform="rotate(90)"> <stop offset="20%" stop-color="gold" /> <stop offset="90%" stop-color="red" /> </lineargradient> </defs> <!-- using my graphical objects --> <use x="5" y="5" xlink:href="#mycircle" fill="url('#mygradient')" /> </svg> attributes global attributes core attributes most notably: id lang styling attributes class, style event attributes global event attributes, document element event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-da...
...shoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2the definition of '<defs>' in that specification.
<foreignObject> - SVG: Scalable Vector Graphics
value type: <length>|<percentage> ; default value: 0; animatable: yes note: starting with svg2, x, y, width, and height are geometry properties, meaning those attributes can also be used as css properties for that element.
... global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes, document event attributes, document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colco...
...a-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesnonepermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<foreignobject>' in that specification.
<line> - SVG: Scalable Vector Graphics
WebSVGElementline
html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <line x1="0" y1="80" x2="100" y2="20" stroke="black" /> <!-- if you do not specify the stroke color the line will not be visible --> </svg> attributes x1 defines the x-axis coordinate of the line starting point.
... value type: <number> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-event...
...a-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<line>' in that specification.
<pattern> - SVG: Scalable Vector Graphics
WebSVGElementpattern
value type: userspaceonuse|objectboundingbox; default value: userspaceonuse; animatable: yes note: this attribute has no effect if a viewbox attribute is specified on the <pattern> element.
... value type: <url>; default value: none; animatable: yes note: for browsers implementing href, if both href and xlink:href are set, xlink:href will be ignored and only href will be used.
... value type: <length>|<percentage> ; default value: 0; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes most notably: xlink:title usage notes categoriescontainer elementpermitt...
<radialGradient> - SVG: Scalable Vector Graphics
value type: <transform-list> ; default value: identity transform; animatable: yes href this attribute defines a reference to another <lineargradient> element that will be used as a template.
... value type: pad|reflect|repeat ; default value: pad; animatable: yes xlink:href an <iri> reference to another <lineargradient> element that will be used as a template.
... value type: <iri> ; default value: none; animatable: yes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatetransform...
<rect> - SVG: Scalable Vector Graphics
WebSVGElementrect
value type: <number> ; default value: none; animatable: yes note: starting with svg2, x, y, width, height, rx and ry are geometry properties, meaning those attributes can also be used as css properties for that element.
... global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current,...
...a-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<rect>' in that specification.
<symbol> - SVG: Scalable Vector Graphics
WebSVGElementsymbol
value type: <length>|<percentage> ; default value: 0; animatable: yes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoff...
...a-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> not...
...e: a <symbol> element itself is not meant to be rendered.
<title> — the SVG accessible name element - SVG: Scalable Vector Graphics
WebSVGElementtitle
text in a <title> element is not rendered as part of the graphic, but browsers usually display it as a tooltip.
... note: for backward compatibility with svg 1.1, <title> elements should be the first child element of their parent.
... html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <circle cx="5" cy="5" r="4"> <title>i'm a circle</title> </circle> <rect x="11" y="1" width="8" height="8"> <title>i'm a square</title> </rect> </svg> attributes this element only includes global attributes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesdescriptive elementpermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<title>' in that specification.
Scripting - SVG: Scalable Vector Graphics
WebSVGScripting
note the existence of all three arguments setting properties.
...this is not the case for mozilla's native svg implementation; therefore, using window.svgdocument does not work in mozilla.
...although the adobe svg viewer plugin allows the use of functionname(), it's not the preferred way to do things.
Filter effects - SVG: Scalable Vector Graphics
« previousnext » there are situations, where basic shapes do not provide the flexibility you need to achieve a certain effect.
... drop shadows, to provide a popular example, cannot be created reasonably with a combination of gradients.
... step 4 <fecomposite in="specout" in2="sourcealpha" operator="in" result="specout"/> the first <fecomposite> takes in "specout" and "sourcealpha", masks out the result of "specout" so that the result is not bigger than "sourcealpha" (the original source graphic), and overrides the result "specout".
Gradients in SVG - SVG: Scalable Vector Graphics
<lineargradient id="gradient2" x1="0" x2="0" y1="0" y2="1"> note: you can also use the xlink:href attribute on gradients too.
... when it is used, attributes and stops from one gradient can be included on another.
...the radialgradient above would be rewritten: <radialgradient id="gradient" cx="60" cy="60" r="50" fx="35" fy="35" gradientunits="userspaceonuse"> you can also then apply another transformation to the gradient by using the gradienttransform attribute, but since we haven't introduced transforms yet, i'll leave that for later.
How to fix a website with blocked mixed content - Web security
note that since mixed content blocking already happens in chrome and internet explorer, it is very likely that if your website works in both of these browsers, it will work equally well in firefox with mixed content blocking.
...if nothing is said about mixed content, your website is in good shape: keep making excellent websites!
...if https is not available, you can try contacting the domain and asking them if they can make the content available via https.
Mixed content - Web security
mixed passive/display content mixed passive/display content is content served over http that is included in an https webpage, but that cannot alter other portions of the webpage.
... note: since firefox 55, the loading of mixed content is allowed on http://127.0.0.1/ (see bug 903966).
...safari does not allow any mixed content.
Securing your site - Web security
note: this article is a work in progress, and is neither complete nor does following its suggestions guarantee your site will be fully secure.
... the x-frame-options response header 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>.
... sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.
Transport Layer Security - Web security
it was updated to ssl 3.0 not long after, and as its usage expanded, it became clear that a common, standard encryption technology needed to be specified to ensure interoperability among all web browsers and servers.
...note however that the server identity (the server_name or sni extension) that a client sends to the server is not encrypted.
...reactive client authentication using certificates is supported by tls 1.3 but not widely implemented.
format-number - XPath
(the documentation for jdk 1.1 is not available online.
... notes this function is an xslt-specific addition to xpath.
... it is not a part of the core xpath function library.
generate-id - XPath
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.
...it is not a part of the core xpath function library.
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementnumber
any (not supported at this time.) numbers all matching nodes, regardless of level, sequentially.
...this level is not supported at this time.
... lang (not supported at this time.) specifies which language's alphabet should be used in letter-based numbering formats.
<xsl:text> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementtext
optional attributes disable-output-escaping (netscape does not serialize the result of transformation - the "output" below - so this attribute is essentially irrelevant in context.
...if "yes" is set, for example, the character > is output as >, not as &gt;.
... defined xslt, section 7.2 gecko support supported as noted.
2015 MDN Fellowship Program - Archive of obsolete content
we are not accepting applications.
...they enable the creation of effective offline experiences and wiill also allow access to push notifications and background sync apis.
Navigator - Archive of obsolete content
navigator.moznotificationprovides support for creating notification objects, which are used to display desktop notification alerts to the user.
...see displaying notifications for an example.
Window: userproximity event - Archive of obsolete content
the userproximity event is fired when fresh data is available from a proximity sensor (indicates whether the nearby object is near the device or not).
... bubbles no cancelable no interface userproximityevent target defaultview (window) default action none event handler property window.onuserroximity specification proximity sensor note: this event has been disabled by default in firefox 62, behind the device.sensors.proximity.enabled preference (bug 1462308).
Program ID - Archive of obsolete content
when you create an xpi with jpm xpi: if the package.json does not include an id field, then the id written into the install.rdf is the value of the name field prepended with "@".
... if the package.json does include an id field, and it does not contain "@", then jpm xpi raises an error and the xpi will not be built.
Testing the Add-on SDK - Archive of obsolete content
note: you must remember to run source bin/activate in order to enable cfx first.
... with jpm (which is not part of the add-on sdk repo, and must be installed separately) things more difficult without the gulp commands provided by the gulpscript.js file in the addon-sdk repo.
Two Types of Scripts - Archive of obsolete content
this enables you to call functions like: window.alert("hello there"); in an add-on's main scripts you can't do that, because the add-on code does not execute in the context of a page, and the dom is therefore not available.
...you use require() to import functionality from another module, and exports to export functionality from your module.
hotkeys - Archive of obsolete content
the following commonly used hotkey combinations will not pass amo review: accel-z, accel-c, accel-x, accel-v or accel-q if you choose to use a key combination that's already defined, choose one which makes sense for the operation it will perform.
...on macintosh this can only be used in conjunction with another modifier, since alt-letter combinations are reserved for entering special characters in text.
simple-prefs - Archive of obsolete content
note that even so, the "value" property is supplied as an integer.
... "description": "some short description for the preference", "type": "string", "value": "this is the default string value" }] you can access somepreference using the prefs property: var preferences = require("sdk/simple-prefs").prefs; console.log(preferences.somepreference); preferences.somepreference = "this is a new value"; console.log(prefs["somepreference"]); // bracket notation preferences["somepreference"] = "this is the default string value"; console.log: my-addon: this is the default string value console.log: my-addon: this is a new value ...
High-Level APIs - Archive of obsolete content
addon-page create a page that does not contain navigational elements.
... notifications display transient, toaster-style desktop messages to the user.
content/worker - Archive of obsolete content
note that you can't communicate with the content script in response to this event.
...the script may not be initialized yet, or may already have been unloaded you can handle the detach event in the content script itself though: // in content script self.port.on("detach", function() { window.close(); }); ...
core/namespace - Archive of obsolete content
provides an api for creating namespaces for objects, which effectively may be used for creating fields that are not part of objects public api.
... also, multiple namespaces can be used with one object: // ./widget.js let { cu } = require('chrome'); let { ns } = require('sdk/core/namespace'); let { view } = require('./view'); // note this is completely independent from view's internal namespace object.
event/target - Archive of obsolete content
adding listeners eventtarget interface defines on method, that can be used to register event listeners on them for the given event type: target.on('message', function onmessage(message) { // note: `this` pseudo variable is an event `target` unless // intentionally overridden via `.bind()`.
...}); removing listeners eventtarget interface defines api for unregistering event listeners, via removelistener method: target.removelistener('message', onmessage); emitting events eventtarget interface intentionally does not define an api for emitting events.
lang/type - Archive of obsolete content
isobject(value) returns true if value is an object and not null, false otherwise.
...returns false if value is not a primitive value.
net/url - Archive of obsolete content
defaults to false if not provided.
...defaults to utf-8 if not provided.
net/xhr - Archive of obsolete content
usage security concerns by default, the xmlhttprequest object grants full access to any protocol scheme, which means that it can be used to read from (but not write to) the host system's entire filesystem.
... functions forceallowthirdpartycookie(xhr) force relevant cookies to be sent with this xmlhttprequest even if normally they would not be.
places/history - Archive of obsolete content
placesemitter the placesemitter is not exposed in the module, but returned from the search functions.
... error the error event is emitted whenever a search could not be completed.
stylesheet/utils - Archive of obsolete content
if not provided, the default value is "author".
...if not provided, the default value is "author".
util/collection - Archive of obsolete content
would print this to the console: 1 2 3 iteration proceeds over a copy of the collection made before iteration begins, so it is safe to mutate the collection during iteration; doing so does not affect the results of the iteration.
...any items not contained in the collection are ignored.
util/deprecate - Archive of obsolete content
it does not raise an exception, but just displays the error message and continues to execute the function.
... it does not raise an exception, but just displays the error message and returns.
util/match-pattern - Archive of obsolete content
in particular: the pattern must match the entire value, not just any subset.
... for example, the pattern /moz.*/ will not match the url http://mozilla.org.
Low-Level APIs - Archive of obsolete content
core/namespace provides an api for creating namespaces for objects, which effectively may be used for creating fields that are not part of objects public api.
...xul <iframe> elements) that are not displayed to the user.
Adding a Button to the Toolbar - Archive of obsolete content
the id attribute is mandatory, and is used to remember the position of the button, so you should not change it in subsequent versions of the add-on.
... the icon file must be packaged with your add-on: it may not refer to a remote file.
Listen for Page Load - Archive of obsolete content
you can get notifications about new pages loading using the tabs module.
... the following add-on listens to the tab's built-in ready event and just logs the url of each tab as the user loads it: require("sdk/tabs").on("ready", logurl); function logurl(tab) { console.log(tab.url); } you will find this console output in the browser console, not the web console.
Using third-party modules (jpm) - Archive of obsolete content
in your add-on code, you can require() modules by passing a path to the module starting from, but not including "node_modules": var menuitems = require("menuitem"); details create a new directory called, for example, "my-menuitem", navigate to it, type "jpm init" and accept all the defaults: mkdir my-menuitem cd my-menuitem jpm init install the menuitem package from npm: npm install menuitem --save this will install the package in the current directory, under a directory called "node_modu...
... note: in more recent versions of firefox, the menu bar may not be visible by default.
JS XPCOM - Archive of obsolete content
another difference is that queryinterface returns an object, where as instanceof returns a boolean.
...urce://gre/modules/xpcomutils.jsm"); const cc = components.classes; const ci = components.interfaces; function abouthandler() {} abouthandler.prototype = { newchannel: function(uri) { var channel = services.io.newchannel("chrome://mystuff/content/mystuff.xul", null, null); channel.originaluri = uri; return channel; }, geturiflags: function(uri) { // do not return ci.nsiaboutmodule.uri_safe_for_untrusted_content unless // you make sure to set a non-system principal in newchannel.
Sidebar - Archive of obsolete content
for example the code below calls a function defined in the sidebar's context: var sidebarwindow = document.getelementbyid("sidebar").contentwindow; // verify that our sidebar is open at this moment: if (sidebarwindow.location.href == "chrome://yourextension/content/whatever.xul") { // call "yournotificationfunction" in the sidebar's context: sidebarwindow.yournotificationfunction(anyarguments); } testing which sidebar is open the sidebar content may contain different panels (bookmarks, history, webpanel, etc.) and sometimes one wants to only act on the sidebar when it contains a specific panel.
...for this snippet to work, you have to declare mainwindow as in the previous code block then write: mainwindow.document.getelementbyid("sidebar-splitter").hidden = true; be aware that if you change the splitter's hidden attribute, you need to reset it to a safe value when your sidebar is closed, or replaced by another sidebar.
Tree - Archive of obsolete content
d("my-tree"); var cellindex = 0; var celltext = tree.view.getcelltext(tree.currentindex, tree.columns.getcolumnat(cellindex)); alert(celltext); } getting the tree item from the focused row assuming <tree id="my-tree">, you can use the following to get the tree item: var view = document.getelementbyid("my-tree").view; var sel = view.selection.currentindex; //returns -1 if the tree is not focused var treeitem = view.getitematindex(sel); note that the current index may be unselected (for example, a multi-select tree).
...but this will not work.
Common Pitfalls - Archive of obsolete content
in that case you may not be able to use the i/o service because that service calls the newuri method on the appropriate protocol handler, which may be your own handler.
... what not to do all other security checks (including calls to checkloaduri and checkloaduristr) are incorrect, because they do not properly capture the originating principal.
Migrating raw components to add-ons - Archive of obsolete content
components added in this way are invisible to users and cannot be managed through the firefox add-ons manager.
...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.
Chapter 1: Introduction to Extensions - Archive of obsolete content
draft this page is not complete.
... « previousnext » note: if you want contribute to this document please following guidelines from the contribute page.
Introduction - Archive of obsolete content
we'll start with a brief introduction to some key concepts, in case you're not familiar with mozilla and firefox.
... mozilla has spawned several products and projects, the most notable being the mozilla firefox web browser.
Useful Mozilla Community Sites - Archive of obsolete content
you'll also receive feedback that you wouldn't notice by testing only in one language, which can reveal other bugs in your locale handling.
...there are other free hosting sites such as souceforge and google code that are also very good, but not as specialized as mozdev.
Creating a status bar extension - Archive of obsolete content
note: the extension created by this tutorial won't work in firefox that don't have a static status bar (that is, firefox 4 and up).
...this is not a required field, but including it is a nice thing to do.
MozBeforeResize - Archive of obsolete content
bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
List of Former Mozilla-Based Applications - Archive of obsolete content
applications that switched to another technology name description additional information angelsoft tools for startups, vcs, and angel investors switched from xulrunner-based client to a web application autodesk maya 3d modeling tool switched off of gecko for help browser in version 8.5 blam feed reader switched to webkit in version 1.8.6 boxee media center software switched to webkit in version 1.0 epiphany browser switched from gecko to webkit flock social browsing ...
...ng developed name description additional information aphrodite browser inactive aol client for mac internet software no longer available beonex communicator internet software last news item on site from 2004 chameleon theme builder inactive civil netizen p2p file delivery (email attachment replacement) site not updated since 2006 compuserve client internet software no longer available doczilla sgml/xml/html browser last release on site from july 2005 fabula language learning application inactive galeon browser last news item on site from september 2006 gencatrss rss reader domain switched over to domain parking service g...
Visualizing an audio spectrum - Archive of obsolete content
note: you can use the audionode called analysernode to perform real-time fft analysis on an audio stream, rather than the code shown below.
...ard = function(buffer) { var buffersize = this.buffersize, costable = this.costable, sintable = this.sintable, reversetable = this.reversetable, real = this.real, imag = this.imag, spectrum = this.spectrum; if ( buffersize !== buffer.length ) { throw "supplied buffer is not the same size as defined fft.
Chromeless - Archive of obsolete content
[this project may not be active — check github https://github.com/mozilla/chromeless] chromeless is a mozilla labs project in its early stages.
...for example, prism applications could not read/write files directly from/to the computer's file system.
Enabling the behavior - retrieving tinderbox status - Archive of obsolete content
although it is designed to retrieve xml content and parse it into a dom, it can retrieve (but not parse) other kinds of content as well.
... notice that we defined the instance of xmlhttprequest as a global variable.
Tinderbox - Archive of obsolete content
the tool enables mozilla.org to be immediately notified of changes to the code that prevent mozilla from compiling and running (or compromise performance and footprint) so they can get someone to fix the problem or reverse the changes.
...whether or not any clients have failed.
Creating a Release Tag - Archive of obsolete content
it has not been updated for usage of mercurial.
...note that there are a couple of extra files for win32 and macintosh that aren't pulled by the normal script and need to be pulled by hand.
Creating a Skin for Mozilla - Archive of obsolete content
a skin does not totally change the interface, it just defines how it looks.
... you cannot change what happens when the user right clicks on an image, but you can change the look of the right click menu (make it blue with pink polka dots, for example).
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).
Dehydra Frequently Asked Questions - Archive of obsolete content
currently dehydra does not provide the cfg functionality, this functionality is now provided by treehydra.
...note that some of the analyses may require treehydra.
Using Dehydra - Archive of obsolete content
ng c++ code dumptypes.cc: typedef int myint; struct foo { int i; char *c; }; save the following analysis script dumptypes.js: function process_type(t) { print("type found: " + t.name + " location: " + t.loc); } function input_end() { print("hello, world!"); } compile using the following command: $ g++ -fplugin=~/dehydra/gcc_dehydra.so -fplugin-arg=~/dumptypes.js -o/dev/null -c dumptypes.cc note:for g++4.5 and up use -fplugin-arg-gcc_dehydra-script= rather than -fplugin-arg it should print the following results: type found: foo location: test.cc:2:12 type found: myint location: test.cc:1:13 hello, world!
... see documentation for: process_type, input_end, print, .loc property example: using attributes to mark a class as "final" save the following code as final.cc: // this class should not be subclassed!
Download Manager improvements in Firefox 3 - Archive of obsolete content
note: these changes will require some modest revisions to code using the download manager; several methods have had minor changes.
... download manager interfaces nsidownloadmanager gives applications and extensions access to the download manager, allowing them to add and remove files to the download list, retrieve information about past and present downloads, and request notifications as to the progress of downloads.
Drag and drop events - Archive of obsolete content
note: the drag and drop event support advertised in the firefox 3 release notes is not the same as the events described in the drag and drop section of the html 5 working draft.
...firefox 3 does not support the 'drag' event.
Exception logging in JavaScript - Archive of obsolete content
exception reporting in firefox 3 firefox 3 improves reporting of unhandled exceptions by establishing a set of rules that determines whether or not an exception is worth reporting: any methods on interfaces annotated with the [function] attribute in idl (see, for example, nsidomeventlistener) that throw exceptions always report those exceptions into the error console.
...note that the following will have no effect on the ns_nointerface exceptions outlined in rules 3 and 4 above - those exceptions will not be reported in any case.
Extenders - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
... manifest chief mechanism for allowing advanced api use within your jetpack superpowers similar to libraries, superpowers are for adding deeper platform coupling for your jetpack sandboxes safely abstracts library interoperability issues so you don't have to worry about them future api interface method for including not yet finalized functionality in your jetpack ...
Libraries - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
...namespace: jetpack.lib jetpack provides libraries for interacting with web and other services not part of the jetpack core.
First run - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
...first-run page when users install your jetpack, they will be greeted with a new page notifying them that installation was successful.
Jetpack Snippets - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
...nd({ onready: function (slide) { // call out to a global function, passing the slidebar object exinitslidebar(slide); }, ...});function exinitslidebar(aslidebar) { // this variable will now be global slider = aslidebar;} // then, accessing the slidebar htmlvar tl = slider.contentdocument.getelementbyid("thumblist"); // or calling slidebar api methods or accessing propertiesslider.notify(); ...
Settings - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
...settings are private to each jetpack and are not accessible by other jetpacks.
UI - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
...etpack content in a slide-out animated vertical column toolbar including entries and access elements into the toolbar panel a movable, expandable, and custom styled content element to display jetpack content tabs adding events and interacting with browser tabs and their contained documents statusbar low-level functions and basic calls notifications a system for alerting users via provided ui mechanisms selection interacting with user-selected content window mitigates and eases interactions between different browser windows ...
jspage - Archive of obsolete content
tion(){};d.prototype=a[c];var b=new d;a[c]=object.reset(b);break;case"array":a[c]=$unlink(a[c]); break;}return a;};new native({name:"class",initialize:class}).extend({instantiate:function(b){b._prototyping=true;var a=new b;delete b._prototyping;return a; },wrap:function(a,b,c){if(c._origin){c=c._origin;}return function(){if(c._protected&&this._current==null){throw new error('the method "'+b+'" cannot be called.'); }var e=this.caller,f=this._current;this.caller=f;this._current=arguments.callee;var d=c.apply(this,arguments);this._current=f;this.caller=e;return d;}.extend({_owner:a,_origin:c,_name:b}); }});class.implement({implement:function(a,d){if($type(a)=="object"){for(var e in a){this.implement(e,a[e]);}return this;}var f=class.mutators[a];if(f){d=f.call(this,d); if(d==null){return this;}}v...
...witch(b){case"=":return(a==e);case"*=":return(a.contains(e));case"^=":return(a.substr(0,e.length)==e); case"$=":return(a.substr(a.length-e.length)==e);case"!=":return(a!=e);case"~=":return a.contains(e," ");case"|=":return a.contains(e,"-");}return false; }};selectors.pseudo=new hash({checked:function(){return this.checked;},empty:function(){return !(this.innertext||this.textcontent||"").length;},not:function(a){return !element.match(this,a); },contains:function(a){return(this.innertext||this.textcontent||"").contains(a);},"first-child":function(){return selectors.pseudo.index.call(this,0);},"last-child":function(){var a=this; while((a=a.nextsibling)){if(a.nodetype==1){return false;}}return true;},"only-child":function(){var b=this;while((b=b.previoussibling)){if(b.nodetype==1){return false; ...
Measuring add-on startup performance - Archive of obsolete content
the add-on is very lightweight, so it shouldn't have a noticeable negative effect on your baseline and add-on tests.
...main happens very early in the startup process and should not be affected by add-ons being installed.
Nanojit - Archive of obsolete content
internally to nanojit, another set of filters operates on the lir as it passes from the lirbuffer toward the assembler.
...-i ../nanojit -o jittest ../jittest.cpp libjs_static.a note: remove the -ddebug if you have not compiled spidermonkey with --enable-debug, and use whatever you called the sample source file in place of jittest.cpp.
Configuration - Archive of obsolete content
so make sure the identifier is not only unique to the web application, but also to you.
...trayicon indicates that a system tray (notification area) icon should be displayed for the application on windows: yes or no.
Extensions - Archive of obsolete content
most notably, the prism application id and the differences in the user interface (ui).
...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.
FAQ - Archive of obsolete content
ArchiveMozillaPrismFAQ
no, prism is not a mozilla product.
...no, prism is not a platform.
Prism - Archive of obsolete content
minimal user interface: a general-purpose browser ui is not necessary or appropriate for most web apps.
...this includes the ability to create desktop shortcuts, to place the application icon in the tray or dock and to display pop-up notifications.
Hacking wiki - Archive of obsolete content
illa.org/projects/deve...lla.org/trunk/ to see the skins properly, you'll need to also check out <tt>mozilla-org/css</tt> to get the css files needed: export cvsroot=:pserver:anonymous@cvs-mirror.mozilla.org:/www cvs login cvs co mozilla-org/css (when prompted to enter a password, 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.
...if you have problems with setting up the mdc wiki (and not the web server or php or mediawiki), feel free to ask in #devmo.
Remote XUL - Archive of obsolete content
how to use xul delivered from a webserver, not as part of chrome.
... note: support for remote xul has long been a potential security concern; support for it was disabled in gecko 2.0.
Rsyncing the CVS Repository - Archive of obsolete content
this is useful for faster diffs or for attempting to import it into another version control system.
...note that for using this copy, the nolocks line in cvsroot/config will need to be commented out, as it requires a modified cvs binary.
Same origin policy for XBL - Archive of obsolete content
when mozilla needs to decide whether or not xbl is allowed to be loaded, it looks at the nsiprincipal originating the load and the nsiuri to be loaded.
...note that step 2 already denied the load attempt for cases in which the chrome: uri isn't accessible to untrusted content.
SpiderMonkey coding conventions - Archive of obsolete content
and library-private and static data use underscores, not intercaps (but library-private data do use a js_ prefix).
... dll entry points that are not public apis use js_friend_api() instead.
Static Analysis for Windows Code under Linux - Archive of obsolete content
build gcc corss-compiler with plugin support by default gcc does not support plugins.
...build dehydra for a cross compiler has nothing difference with building one for a linux native compiler.
Using Breakpoints in Venkman - Archive of obsolete content
future breakpoints are used when you want to stop in a script that has not yet been compiled.
...(note: by default, venkman hides files file that appear to be part of the browser core; this includes extensions.
XBL - Archive of obsolete content
xbl 1.0 is a mozilla-specific technology, and not a w3c standard.
...it's similar in spirit to mozilla's xbl, but there are a few subtle (and not-so-subtle) differences.
Mac stub installer - Archive of obsolete content
to do this, in addition to the above steps to set up the mac installer to debug you will need to do the following: create a file named xpcom.xpi with the shared libraries in the structure described under the [xpcom] section in: <http://lxr.mozilla.org/seamonkey/sou...ackages-mac#33> note that if you are using the debug target of the installer binary all shared libraries are expected to have the name format <libname>debug.shlb now set a break point at xpi_init() in the mac installer code and step into xpistub and eventually the xpinstall engine will load including symbols so you can set a break point in the xpinstall engine itself.
...note that there are two macro strings in the .jsts: $version$ which is replaced at packages time with the browser version.
Windows Install - Archive of obsolete content
note the disk space verification, the editing of the windows registry, the writing to the installation log, and the error checking before either performinstall or cancelinstall is called.
...do the verification if(spaceavailable < spacerequired) { logcomment("insufficient disk space: " + dirpath); logcomment(" required : " + spacerequired + " k"); logcomment(" available: " + spaceavailable + " k"); return(false); } return(true); } function updatewinreg4ren8dot3() { var fprogram = getfolder("program"); var ftemp = getfolder("temporary"); //notes: // can't use a double backslash before subkey // - windows already puts it in.
execute - Archive of obsolete content
note that file names are case sensitive.
...description the specified file is not actually executed until the performinstall method is called.
modDateChanged - Archive of obsolete content
returns a boolean value indicating whether the file has been modified since the input date or has not.
... err3 = file.moddatechanged(filesource2, err1); logcomment("file.moddatechanged should return 'true' = " + err2); // the reason it expects true is we're comparing // the return 'time stamp' value for // file1.txt with another file, file2.txt, with a different // 'time stamp' value.
windowsShortcut - Archive of obsolete content
ashortcutpath a filespecobject representing the absolute path (not including filename) to where the shortcut is to be created.
... adescription string description for the shortcut to be used as the shortcut name with a .lnk extension (do not include .lnk in the string).
Methods - Archive of obsolete content
exists returns a boolean value indicating whether the specified file exists or not.
... moddatechanged specifies whether the last modification on a file is older than a specified date move moves a file from one location to another.
alert - Archive of obsolete content
if message is not a string, then it is converted into one and displayed.
... returns nothing.
deleteRegisteredFile - Archive of obsolete content
deleteregisteredfile (netscape 6 and mozilla do not currently support this method.) deletes the specified file and removes its entry from the client version registry.
...this method is used to delete files that cannot be removed by the uninstall method or to remove files that are no longer necessary or whose names have changed.
initInstall - Archive of obsolete content
the registry name provided here is not the location of the software on the machine, it is the location of information about the software inside the registry.
...if your script does not call performinstall or cancelinstall, netscape 6 will not be able to clean up properly after your script finishes.
refreshPlugins - Archive of obsolete content
returns nothing.
...note that refreshplugins must be called after the performinstall method that initiates the actual installation.
writeString - Archive of obsolete content
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.
getValue - Archive of obsolete content
getvalue netscape 6 and mozilla do not currently support this method.
...use this method if the value you want is not a string.
getValueString - Archive of obsolete content
returns a string representing the value of the named value-name/value pair or null if there's an error, the value is not found, or the value is not a string.
...if the value is not a string, use the getvalue method instead.
isKeyWritable - Archive of obsolete content
iskeywritable returns whether the given registry key is writable or not.
... method of winreg object syntax boolean iskeywritable( string key); parameters the method has the following parameter: key a string representing the path to the key returns a boolean value: true if the key is writable; false if not.
setValue - Archive of obsolete content
setvalue netscape 6 and mozilla do not currently support this method.
...use this method if the value you want to set is not a string.
XTech 2005 Presentations - Archive of obsolete content
web 1.6: a rope of sand - opening keynote, mike shaver mozilla e4x - brendan eich "ecmascript for xml" (ecma-357), a new standard for writing and processing xml directly in javascript (ecma-262, iso-16262).
...another e4x feature: the ability to bind a w3c dom document to a new xml object, reflecting the dom in e4x terms so that updates to either the dom or the e4x object hierarchy show up in the other.
allowevents - Archive of obsolete content
on listitem and titlebar elements, mouse events normally do not get sent to their children; instead they are retargeted to the listitem and titlebar element itself.
... this means that elements placed inside a listitem do not respond to events, and instead clicking the mouse simply selects that item within the list.
button.type - Archive of obsolete content
if this attribute is not present, a normal button is created.
...this is not the same as a checkbox because it looks like a button.
buttons - Archive of obsolete content
note: if you don't want to display any buttons in the dialog box, set the value of this attribute to "," (a single comma).
... 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 soon, see bug 738797 and bug 1037225).
currentset - Archive of obsolete content
« xul reference home currentset not in seamonkey 1.x type: comma-separated string the current set of displayed items on the toolbar.
...it might not be equal the value of the currentset property which is computed from the actual dom ...
datasources - Archive of obsolete content
for xml datasources, only one source is used, either the url of an xml file or an anchor reference to another element within the same document.
...otherwise, you cannot add one later.
eventnode - Archive of obsolete content
if this attribute is not specified, events are listened to from the tabbox.
... thus, if this attribute is not used, the tabbox or an element inside it must have the focus for the keyboard navigation to apply.
fixed - Archive of obsolete content
« xul reference home fixed type: boolean if true, the size of the column in the tree cannot be adjusted by the user.
...if false or not specified, the user can adjust the size of the column, typically by dragging the column header with the mouse.
iscontainer - Archive of obsolete content
if not specified, the rule may match regardless of whether a node is a container or not.
... false: the rule will only match nodes that are not marked as containers.
modifiers - Archive of obsolete content
keys will map to other keys on platforms that do not have them.
...on macintosh this can only be used in conjunction with another modifier, since alt+letter combinations are reserved for entering special characters in text.
panel.flip - Archive of obsolete content
you will not normally have to use this attribute, since it's automatically applied to arrow panels.
... without flip="slide", the panel would have had its width truncated and the panel would not extend to the left of the anchor.
panel.type - Archive of obsolete content
for example, the site identity panel that appears when you click on the favicon in the url bar in firefox is an arrow panel: note: the arrow will draw as long as the panel doesn't overlap the anchor.
...the panel may not appear on the side of the anchor that you requested in which case the arrow will automatically adjust.
persistence - Archive of obsolete content
« xul reference home persistence type: integer the persistence may be set to a non-zero value so that the notificationbox's removetransientnotifications method does not remove them.
... this may be used to close a set of notifications as a group without affecting other notifications.
priority - Archive of obsolete content
« xul reference home priority type: integer numeric value that specifies the order in which the notifications appear.
... should be one of the constants described in the notificationbox's appendnotification method.
showpopup - Archive of obsolete content
« xul reference home showpopup type: boolean note: applies to: thunderbird, seamonkeyif true, the popup will be shown.
... if false, the popup will not be shown, but the autocomplete results will still be available.
spellcheck - Archive of obsolete content
if not specified, this defaults to false the html the spellcheck attribute uses values of true or false (you cannot simply add the spellcheck attribute to a given element): <!-- spellcheck everything!
... --> <input type="text" spellcheck="true" /><br /> <textarea spellcheck="true"></textarea> <div contenteditable="true" spellcheck="true">i am some content</div> <!-- spellcheck nothing!
state - Archive of obsolete content
« xul reference home state type: one of the values below indicates whether the splitter has collapsed content or not.
... collapsed the content either before or after the splitter is collapsed and is not visible.
textbox.autoFill - Archive of obsolete content
« xul reference home autofill obsolete since gecko 1.9.1 type: boolean note: applies to: thunderbird and seamonkeyif 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.
toolbarbutton.title - Archive of obsolete content
it overrides the value of label, which is used if title is not set.
... this does not affect the button's label when it is in a toolbar, which remains determined by the label attribute.
treecol.src - Archive of obsolete content
you cannot have both an image and a label displayed in the header.
...you should still specify a label for use in the column picker if ignoreincolumnpicker is not true and hidecolumnpicker is not true on the tree.
unread - Archive of obsolete content
« xul reference home unread type: boolean this attribute is set to true if the tab is unread; that is, either it has not yet been selected during the current session, or has changed since the last time it was selected.
... this attribute is not present if the tab is not unread.
width - Archive of obsolete content
the value should not include a unit as all values are in pixels.
... <vbox width="30" align="start" style="background-color: red;"> <label value="vbox xul width 10px red"/> </vbox> note: when used on treecol objects, the width attribute can be used to allow a tree to be scrolled horizontally if the column widths add up to be wider than the containing object.
DOMMenuItemActive - Archive of obsolete content
bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
DOMMenuItemInactive - Archive of obsolete content
bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
broadcast - Archive of obsolete content
bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
commandupdate - Archive of obsolete content
bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
popuphidden - Archive of obsolete content
bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
popuphiding - Archive of obsolete content
bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
popupshowing - Archive of obsolete content
bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
popupshown - Archive of obsolete content
bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
Uploading and Downloading Files - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes.
IO - Archive of obsolete content
ArchiveMozillaXULFileGuideIO
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes.
TOC - Archive of obsolete content
ArchiveMozillaXULFileGuideTOC
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes.
swapDocShells - Archive of obsolete content
« xul reference home swapdocshells( otherbrowser ) return type: no return value swaps the content, history and current state of this browser with another browser.
... note: both browsers must be either standalone browsers or embedded in a tabbrowser.
getElementsByAttribute - Archive of obsolete content
note that like most nodelists (but unlike the nodelist returned by queryselectorall), the nodelist returned by this method is live.
... note that this method is only available on xul elements; it is not part of the w3c dom.
insertItem - Archive of obsolete content
« xul reference home insertitem( id, beforenode, wrapper, beforepermanent ) not in seamonkey 1.x return type: element add an item with the given id to the toolbar.
...the third argument can be used to wrap the new item in another element.
loadOneTab - Archive of obsolete content
and if null or not specified, this parameter will default to the browser.tabs.loadinbackground preference.
... firefox 3.6 note the second form of this method was added in firefox 3.6; it adds the relatedtocurrent parameter, and allows the parameters to be specified by name, in any order.
loadURI - Archive of obsolete content
ArchiveMozillaXULMethodloadURI
« xul reference home note: this is the xul method on <browser> / <tabbrowser>, not the global function in chrome://browser/content/browser.js.
... the first argument should be a string, not a nsiuri object.
openWindow - Archive of obsolete content
if a window with that type is already open, this method will just switch that window to the front and focus it instead of opening another window.
... if a window of the type is not open, a new one is opened displaying the supplied url.
replaceGroup - Archive of obsolete content
« xul reference home replacegroup( group ) not in firefox return type: array of session history objects replaces existing tabs with a new set.
... if there were more tabs before, the additional ones are not removed.
toggleItemSelection - Archive of obsolete content
if it is not selected, it is selected.
... other items in the list box that are selected are not affected, and retain their selected state.
Special per-platform menu considerations - Archive of obsolete content
checkforupdates the item that opens the update dialog for the application, for applications that have one (such as seamonkey; firefox does not have this item).
... notes for firefox extension developers on the mac, some elements, once moved to the application menu, are no longer accessible from xul overlays or from javascript injected into browser.xul.
contentView - Archive of obsolete content
« xul reference contentview type: nsitreecontentview for trees built with a content builder - that is, those that do not have flags set -- the contentview will be a reference to the nsitreecontentview for the tree.
...for trees that are not built with a content builder, the functions of nsitreecontentview will not be available, since there are no dom nodes to retrieve.
firstPermanentChild - Archive of obsolete content
« xul reference firstpermanentchild not in seamonkey 1.x type: element the first permanent child of the toolbar.
... a permanent child is one that is not customizable and remains on the toolbar.
lastPermanentChild - Archive of obsolete content
« xul reference lastpermanentchild not in seamonkey 1.x type: element the last permanent child of the toolbar.
... a permanent child is one that is not customizable and remains on the toolbar.
textbox.label - Archive of obsolete content
gets the label attribute if it is present and not empty.
... note: prior to firefox 3, and always in thunderbird and seamonkey, the label property of an autocomplete textbox returns its value, for compatibility with the menulist element.
toolboxid - Archive of obsolete content
this will either be the toolbox's parent (if it's in a toolbox), or, if the toolbar is an external toolbar (that is, one not contained in a toolbox), the id of the toolbox it should be considered to be part of.
... this makes it possible to have toolbars that are not contained within toolboxes, such as the add-on bar.
Property - Archive of obsolete content
« xul reference accessible accessibletype accesskey align allnotifications allowevents alwaysopenpopup amindicator applocale autocheck autofill autofillaftermatch boxobject browsers builder builderview buttons canadvance cangoback cangoforward canrewind checked checkstate child children classname clickselectsall clientheight clientwidth collapsed color columns command commandmanager completedefaultindex container contentdocument contentprincipal contenttitle contentview contentvieweredit contentviewerfile contentwindow contextmenu control controller controllers crop current currentindex currentitem currentnotification currentpage currentpane currentset currenturi custo...
...k ispm issearching iswaiting itemcount label labelelement lastpermanentchild lastselected left linkedpanel listboxobject locked markupdocumentviewer max maxheight maxlength maxrows maxwidth menu menuboxobject menupopup min minheight minresultsforpopup minwidth minute minuteleadingzero mode month monthleadingzero name next nomatch notificationshidden object observes onfirstpage onlastpage open ordinal orient pack pagecount pageid pageincrement pageindex pagestep parentcontainer palette persist persistence placeholder pmindicator popup popupboxobject popupopen position predicate preferenceelements preferencepanes preferences priority radiogroup readonly readonly r...
Simple Example - Archive of obsolete content
note that this value is a literal rather than a resource.
...you might note that the image's src attribute uses the member variable ?photo <action> <vbox uri="?photo" align="start"> <image src="?photo"/> <label value="?title"/> </vbox> </action> it shouldn't be too difficult to tell what would appear in the window in this example.
Additional Install Features - Archive of obsolete content
if this file does not exist, an error will occur during the installation.
...this will occur if a file or directory cannot be found, there is insufficient disk space or for a number of other reasons.
Creating an Installer - Archive of obsolete content
function donefn ( name , result ){ if (result) alert("an error occured: " + result); } var xpi = new object(); xpi["find files"] = "findfile.xpi"; installtrigger.install(xpi,donefn); the xpi archive note: if you want to create a new xulrunner application, extension, or theme, see bundles.
...these files will typically be placed inside a directory in the archive but they do not have to be.
Groupboxes - Archive of obsolete content
note that the groupbox has a vertical orientation by default which is necessary to have the text elements stack in a single column.
...this could be used to add extra elements within the structure, such as in the following example: example 3 : source view <radiogroup> <radio id="no" value="no" label="no number"/> <radio id="random" value="random" label="random number"/> <hbox> <radio id="specify" value="specify" label="specify number:"/> <textbox id="specificnumber"/> </hbox> </radiogroup> note that the radiogroup element does not draw a border around it.
Install Scripts - Archive of obsolete content
creating an install script note: for firefox extensions, install.js are no longer used.
... it is important to note that during step two, you only indicate which files should be installed and any other operations you wish to have happen.
Persistent Data - Archive of obsolete content
you will typically want to save toolbar states, window positions and whether certain panels are displayed or not, but you can save almost anything.
...you could add additional attributes by adding a space and another attribute name to the persist attribute.
Scroll Bars - Archive of obsolete content
this value does not need a unit.
...the is a numeric value and does not have a unit.
Toolbars - Archive of obsolete content
you do not have to put toolbar elements inside a toolbox.
...notice that the toolbar has been placed inside the vertical box just above the tabbox.
Using multiple DTDs - Archive of obsolete content
<button id="okbutton" label="&okbutton.label"> note that there is no such thing as namespaces with multiple dtds.
... you have to make sure by yourself that the entities defined in the various dtds do not clash.
XUL Changes for Firefox 1.5 - Archive of obsolete content
this lists the most notable changes to xul in firefox 1.5 (gecko 1.8).
... bfcache mozilla now caches the page's dom, so that navigating back and forward does not reload the page, making navigation much more efficient.
XULBrowserWindow - Archive of obsolete content
in order to do so it implements the following interfaces: nsisupports nsixulbrowserwindow nsiwebprogresslistener nsiwebprogresslistener2 nsisupportsweakreference note: this page is not complete at this time.
... methods hidechromeforlocation determines whether or not browser chrome should be hidden for the specified location.
XUL Reference - Archive of obsolete content
button browser checkbox caption clicktoscroll colorpicker column columns commandset command conditions content datepicker deck description dialog dialogheader dropmarker editor grid grippy groupbox hbox iframe image key keyset label listbox listcell listcol listcols listhead listheader listitem member menu menubar menuitem menulist menupopup menuseparator notification notificationbox observes overlay page panel param popupset preference preferences prefpane prefwindow progressmeter query queryset radio radiogroup resizer richlistbox richlistitem row rows rule scale script scrollbar scrollbox scrollcorner separator spacer spinbuttons splitter stack statusbar statusbarpanel stringbundle stringbundleset tab tabbrowse...
...abs controls --- text and images label caption image lists --- trees --- layout --- templates --- scripting --- helper elements other xul lists dialog overlay page window wizard wizardpage preference preferences prefpane prefwindow browser tabbrowser editor iframe titlebar resizer statusbar statusbarpanel dialogheader notification notificationbox menubar menu menuitem menuseparator menupopup panel tooltip popupset toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tabbox tabs tab tabpanels tabpanel groupbox caption separator spacer button checkbox colorpicker datepicker menulist progressmeter radio radio...
XUL accessibility tool - Archive of obsolete content
while not meant to be a comprehensive test suite (meaning that passing all included tests does not guarantee that an application is free of accessibility bugs or issues), many of the most common accessibility mistakes will be found and reported.
...work the following things have been suggested or are planned for a future version of the tool: new tests: (aaronlev) warning: hardcoded color and pixel sizings (aaronlev) error: duplicate accesskey in a dialog (already have this for menus) (aaronlev) error: form control without accesskey (aaronlev) warning: accesskey as lowercase letter with descender (underlined g,j,y,q,p are hard to read, not recommended) (aaronandy) list of things to check manually, such as a list oftrees in the document (make sure they have accessible column picker equivs) or a list of toolbarbuttons (make sure they have accessible alternatives).
dialogheader - Archive of obsolete content
attributes crop, description, title examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing" title="dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <dialogheader title="my dialog" description="example dialog"/> <!-- other widgets --> </dialog> attributes crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by th...
... none the text will be not be cropped using an ellipsis.
progressmeter - Archive of obsolete content
this is used when the length of time to complete an operation is not known beforehand.
...the default value if not specified is 100 such that the value may be used as a percentage.
resizer - Archive of obsolete content
note: starting in gecko 2.0, you can also specify a target element using the element attribute, to use the resizer to resize the specified element instead of the window.
...as some platforms provide this resizing grip automatically, this type of resizer element will be hidden and ensure that the window does not get an extra resizer.
spacer - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element that takes up space but does not display anything.
...if you don't specify that the spacer has a size or is flexible, the spacer does not occupy any space.
template - Archive of obsolete content
if not specified, the variable specified in the uri attribute of the content tag in the template's first rule is used.
...if not specified, the variable specified in the uri attribute in the action body of the template's first rule is used.
toolbarpalette - Archive of obsolete content
it is not displayed, but is used by the toolbar customization dialog to display the list of items.
...do not add the various spacing items, as those are added automatically.
where - Archive of obsolete content
ArchiveMozillaXULwhere
attributes ignorecase, multiple, negate, rel, subject, value examples (example needed) attributes ignorecase type: boolean set to true to indicate that the case does not matter when making comparisons.
...the where clause matches if the condition is false, and does not match if the condition is true.
wizardpage - Archive of obsolete content
this can be used to create wizards that do not have a linear sequence.
...this can be used to create wizards that do not have a linear sequence.
Building XULRunner - Archive of obsolete content
if you do not want to build javaxpcom support, specify --disable-javaxpcom in your configuration.
...z_co_project=xulrunner mk_add_options moz_objdir=@topsrcdir@/obj-xulrunner ac_add_options --enable-application=xulrunner #uncomment the following line if you don't want to build javaxpcom: #ac_add_options --disable-javaxpcom cvs tags and xulrunner versions older xulrunner releases where tagged in cvs with (for instance xulrunner_1_8_0_5_release ) up to version 1.8.0.5 the cvs repository does not have specific tags for xulrunner anymore.
Creating a Windows Inno Setup installer for XULRunner applications - Archive of obsolete content
if your application does not run, neither will the installed version.
...; components: main; flags: ignoreversion recursesubdirs createallsubdirs source: c:\develop\xulrunnerinstaller\myapp\defaults\*; excludes: .svn; destdir: {app}\defaults; components: main; flags: ignoreversion recursesubdirs createallsubdirs source: c:\develop\xulrunnerinstaller\myapp\xulrunner\*; destdir: {app}\xulrunner; components: runtime; flags: ignoreversion recursesubdirs createallsubdirs ; note: don't use "flags: ignoreversion" on any shared system files [icons] name: {group}\my app; filename: {app}\myapp.exe name: {group}\{cm:uninstallprogram,xul explorer}; filename: {uninstallexe} name: {userdesktop}\my app; filename: {app}\myapp.exe; tasks: desktopicon name: {userappdata}\microsoft\internet explorer\quick launch\my app; filename: {app}\myapp.exe; tasks: quicklaunchicon [run] filen...
Dialogs in XULRunner - Archive of obsolete content
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.
...var fp = components.classes["@mozilla.org/filepicker;1"].createinstance(nsifilepicker); fp.init(window, "open file", 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.
XULRunner Hall of Fame - Archive of obsolete content
its goal is to provide a tool like phantomjs, with the same api, except that it runs gecko instead of webkit, and it is not headless (but you can still use xvfb to have a headless slimerjs).
...latest release 7.6.1 january 2010 - xulrunner patches lotus notes / sametime the latest version of ibm lotus notes and sametime can embed xul application.
Using LDAP XPCOM with XULRunner - Archive of obsolete content
actually, the ldap interfaces are available (for exemple, components.interfaces.nsildapconnection is not null), but the components can't be loaded (for example, components.classes["@mozilla.org/network/ldap-connection;1"] is null).
... this is due to the fact that the native ldap library files are not found by the xulrunner process.
XULRunner/Old Releases - Archive of obsolete content
the windows and linux builds will run normal xulrunner applications, but the mac build uses cocoa widgets and will not run xulrunner applications.
...it has known security holes and should not be used in applications that deal with public web content.
Mozilla.dev.apps.firefox-2006-09-29 - Archive of obsolete content
ly to recieve "major update" offer mike beltnzer announced that 'users running the bon echo 20060921 nightly build will be offered the chance to upgrade to a "new version"' firefox start up performance boris zbarsky recently performed some profiling of firefox's start up - these are some of the details discussions problem handling dmg files on mac discussion about why sometimes dmg files are not mounted correctly after they are downloaded.
... firefox 2 on windows vista discussion about the "state of affairs" of firefox 2 on windows vista rc1 - update for rc1 listed in update history as 'install pending' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project?
2006-09-29 - Archive of obsolete content
ly to recieve "major update" offer mike beltnzer announced that 'users running the bon echo 20060921 nightly build will be offered the chance to upgrade to a "new version"' firefox start up performance boris zbarsky recently performed some profiling of firefox's start up - these are some of the details discussions problem handling dmg files on mac discussion about why sometimes dmg files are not mounted correctly after they are downloaded.
... firefox 2 on windows vista discussion about the "state of affairs" of firefox 2 on windows vista rc1 - update for rc1 listed in update history as 'install pending' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project?
2006-10-13 - Archive of obsolete content
nsapprunner.o compile error: some_const not declared in scope compile error while compiling first build.
... firefox browser problem: width:30ex does not respect font discussion about a font rendering problem with firefox print on the firefox context menu user would like discussion about why the bug https://bugzilla.mozilla.org/show_bug.cgi?id=204519 is a wontfix.
2006-10-26 - Archive of obsolete content
fx 1.5.0.x (linux) not building since 20-oct-2006 17:45 pdt?
... nsialertsservice under linux an inqury about why nsialertsservice is not a service found in firefox 2.
2006-10-27 - Archive of obsolete content
fx 1.5.0.x (linux) not building since 20-oct-2006 17:45 pdt?
... nsialertsservice under linux an inqury about why nsialertsservice is not a service found in firefox 2.
2006-11-03 - Archive of obsolete content
links in tb is not sent to firefox directly cédric corazza provided a code solution for this problem.
... meetings calendar project weekly status meeting - 2006/11/01 17:00 utc (meeting notes) calendar project weekly qa chat - 2006/11/02 16:30 utc (meeting notes) ...
2006-10-20 - Archive of obsolete content
christopher would not like to learn how to create a build of firefox with custom extensions and not have those extensions appear in the addons window.
...paul reed restates his overall goal that are "getting us to not rely on hardware that you have to have in a certain position for it to boot" to use standard known configuration for every nightly build that is produced.
2006-11-03 - Archive of obsolete content
problem compiling with vs 2003 .net phil is trying to compile firefox for the first time and is getting an error when doing so: building deps for /cygdrive/c/mozilla/toolkit/airbag/airbag/src/common/windows/guid_string.cc make[1]: leaving directory `/cygdrive/c/mozilla/obj-i686-pc-cygwin' make: *** [build] error 2 he also noted that he is using make 3.80-1.
...he also noted that he has had different results (error messages when compiling) on different machines.
2006-11-10 - Archive of obsolete content
he stated that he set is home variable to c:\mozilla, and is not sure what he is doing wrong.
...ink failed: nonrepresentable section on output collect2: ld returned 1 exit status gmake[3]: *** [testtarray] error 1 gmake[3]: leaving directory `/usr/mozilla2/src/mozilla/xpcom/tests' gmake[2]: *** [libs] error 2 gmake[2]: leaving directory `/usr/mozilla2/src/mozilla/xpcom' gmake[1]: *** [tier_2] error 2 gmake[1]: leaving directory `/usr/mozilla2/src/mozilla' make: *** [default] error 2 he is not sure what is wrong with his build, and is asking for help on how to resolve the build error.
2006-10-27 - Archive of obsolete content
meeting notes gecko 1.9 bug triage meeting gecko 1.9 bug triage meeting - 3pm pdt final bon echo status meeting the final bon echo status meeting happened on october 24th, 2006.
... meeting notes ...
2006-11-10 - Archive of obsolete content
benjamin smedberg crossposted a notice about unit testing for the mozilla toolkit, letting developers know about the importance of testing for the improvement of mozilla 2, and asks for complete coverage.
...neil deakin points out that "downloads and other network operations are always done in another thread so you shouldn't be creating one yourself".
2006-11-17 - Archive of obsolete content
summary: mozilla.dev.platform - november 11th - november 17th, 2006 announcements no announcements this week traffic xulrunner: <browser> not allowing javascript popup windows b notes that when using xul elements <browser/> and <tabbrowser/> the javascript popup windows don't work out of the box and asks what needs to be implement.
... alex vincent ran into some difficulty with xulrunner extension manager not recognizing xulwidgets for verbosio?
2006-11-24 - Archive of obsolete content
discussions continuing discussions on the extended validation certificates large amount of activity this week regarding the extended validation certificates, duane posted several snippets of interesting debates as to whether or not the protocol should be introduced.
...yet more people disgruntled by ev proposal mozilla, opera and co only tout open standards as it suits them in addition eddy nigg posted an alternative proposal for the use of extended validation certificates ev certificates / another proposal meetings none during this week.
2006-11-17 - Archive of obsolete content
site not loading with seamonkey a user built seamonkey in debug mode and is currently receiving a "bad request" error on some websites.
...users are asked to file bugs on encountered problems that are not present on the current trunk builds.
NPAPI plugin developer guide - Archive of obsolete content
they are not available on most mobile devices.
...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.
Logging Multi-Process Plugins - Archive of obsolete content
windows make sure firefox is not running.
...linux make sure firefox is not running.
Browser-side plug-in API - Archive of obsolete content
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_requestread npn_setvalue npn_setvalueforurl npn_status npn_useragent npn_version npn_write ...
NPEvent - Archive of obsolete content
the event type may be any of the ollowing: graphicsexpose focusin focusout enternotify leavenotify motionnotify buttonpress buttonrelease keypress keyrelease description microsoft windows description the type npevent represents an event passed by npp_handleevent() to a windowless plug-in.
...as the xevents sent to the plug-in are synthesized and there is not a native window corresponding to the plug-in rectangle, some of the members of the xevent structures are not set to their normal xserver values.
NPFullPrint - Archive of obsolete content
printone not currently in use.
...the pluginprinted field of this structure determines whether the plug-in prints in full-page mode or not.
NPN_MemFlush - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary note: this function is only implemented on mac os x.
... description the plug-in calls npn_memflush() when it is not possible to call npn_memalloc(), for example, when calling system apis that indirectly allocate memory.
NPN NewStream - Archive of obsolete content
if unsuccessful, the plug-in is not loaded and the function returns an error code.
...a plug-in can create another instance of itself by specifying its own mime type and a new target name in a call to npn_newstream.
NPN_ReleaseObject - Archive of obsolete content
if the reference count reaches 0, the npobject is deallocated by calling its deallocate function if one is provided; if one is not provided, free() is used.
... returns nothing.
NPN_SetValueForURL - Archive of obsolete content
(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.
...note: the value may have internal null bytes and may not be null-terminated.
NPN_Version - Archive of obsolete content
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 browser is not loaded.
NPP_HandleEvent - Archive of obsolete content
mac os the browser does not give a windowed plug-in a native window, because the mac os platform does not support child windows.
...a plug-in does not need to set up the current port for mouse coordinate translation.
NPSavedData - Archive of obsolete content
can be any reasonable size; its contents are private to the plug-in and are not modified by the browser.
...this information can be returned to another instance of the same plug-in if the user returns to the web page that contains it.
NPString - Archive of obsolete content
note: whenever an npstring owns its string data and the data may be released through a call to npn_releasevariantvalue(), the string data must be allocated using npn_memalloc().
...utf8length the number of bytes in the utf-8 string (not the number of characters).
Samples and Test Cases - Archive of obsolete content
the samples may not build any more on all platforms.
...however, even if one cannot build the samples they can still be very valuable as code references.
Writing a plugin for Mac OS X - Archive of obsolete content
notes and tips this section provides some additional information that may be helpful if you're trying to get a plugin building on your own.
... some symbols must be visible as standard c symbols so the browser can find them, which means they need to be prefixed by an underscore, and must not have the c++ obfuscation that is generated by the c++ compiler.
XEmbed Extension for Mozilla Plugins - Archive of obsolete content
as an implementation note, this is really the xid of a gtksocket window.
...if you return with an error from your initialization function the plugin will not be used which avoids crashes and other problems.
Entity list - Archive of obsolete content
note: there are 3 different versions of rss 0.91.
...(userland's rss 0.91 does not use this dtd.) entity decimal character rss version 0.90 n 0.91 r1 n 0.91 r3 u 0.91 0.92 0.93 0.94 1.0 2.0 á # á ✔ ✔ ✔ ?
Element - Archive of obsolete content
ArchiveRSSModuleSlashElement
rss slash module elements note: in the list of elements below the slash xml namespace prefix is used (since it is a popular choice).
... however, use of slash as the xml namespace prefix is not necessary.
Element - Archive of obsolete content
rss well-formed web module elements note: in the list of elements below the wfw xml namespace prefix is used (since it is a popular choice).
... however, use of wfw as the xml namespace prefix is not necessary.
Proposal - Archive of obsolete content
note: those in the list below that are marked "in development" should not be implemented.
...the transform must already exist on the machine running newsgator; stylesheets will not be downloaded or installed automatically.
title - Archive of obsolete content
note: in userland's rss 0.91 there is a 100 character maximum limit.
...://www.advogato.org/article/</link> <description>recent advogato articles</description> <language>en-us</language> <image> <link>http://www.advogato.org/</link> <title>advogato</title> <url>http://www.advogato.org/image/tinyadvogato.png</url> </image> <item> <title>why can i not get any tang?!</title> <link>http://www.advogato.org/article/10101.html</link> <description>seriously.
Solaris 10 Build Prerequisites - Archive of obsolete content
the installer will try to install the sunwsmbas package, which is not available in newer versions of sxde.
... the installer may tell you your c compiler is not the recommended compiler, but the compiler you installed will work fine, so you should tell the installer to use the compiler anyway.
The Basics of Web Services - Archive of obsolete content
the basics web services are not really anything that new, and actually, if you've ever used an rss or atom feed to pull news from a website, you have an idea of how a web service might work.
... 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.
Making sure your theme works with RTL locales - Archive of obsolete content
note that not all elements will have the chromedir attribute, so you may need to refer to an ancestor element that does.
...rt -moz-margin-end -moz-border-start -moz-border-start-color -moz-border-start-style -moz-border-start-width -moz-border-end -moz-border-end-color -moz-border-end-style -moz-border-end-width #urlbar-search-splitter { min-width: 8px; -moz-margin-start: -4px; border: none; background: transparent; } testing your theme testing your theme for rtl compatibility is easy, and you do not even have to go through the hassle of downloading a rtl locale.
Theme changes in Firefox 3.5 - Archive of obsolete content
draft this page is not complete.
...to do this only for 3.5 use a css selector that is only supported in 3.5, like so: window:not([active="true"]) menubar>menu:nth-child(1n) { color:threedshadow } private browsing: show private browsing state by coloring the url bar, or by adding an icon to the toolbox/tabbrowserbar.
Settings - Archive of obsolete content
ignore caught exceptions if this option is set (it is set by default) and "pause on exceptions" is set, then execution will pause on an exception only if that exception is not caught.
... show only enumerable properties do not display non-enumerable javascript properties.
Updating an extension to support multiple Mozilla applications - Archive of obsolete content
that's because there's nothing telling those two applications what to do with the chrome provided by the extension.
...as you may (or may not) recall, that file tells the application what xul code your extension's interface needs to overlay onto.
Browser Feature Detection - Archive of obsolete content
you should not rely on any information here.
... note: this reprinted article was originally part of the devedge site.
-moz-border-bottom-colors - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted.
...kground-color: gray; border: 10px solid black; -moz-border-top-colors: #e00 #c30 #c50 #c60 #c70 #c80 #c90 #ca0 #cb0 #cc0; -moz-border-right-colors: red #f60 #f80 #f90 #fa0 #fb0 #fc0 #fd0 #fe0 #ff0; -moz-border-bottom-colors: red #f60 #f80 #f90 #fa0 #fb0 #fc0 #fd0 #fe0 #ff0; -moz-border-left-colors: #e00 #c30 #c50 #c60 #c70 #c80 #c90 #ca0 #cb0 #cc0; } specifications this property is not part of any specification.
-moz-border-left-colors - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted.
...kground-color: gray; border: 10px solid black; -moz-border-top-colors: #e00 #c30 #c50 #c60 #c70 #c80 #c90 #ca0 #cb0 #cc0; -moz-border-right-colors: red #f60 #f80 #f90 #fa0 #fb0 #fc0 #fd0 #fe0 #ff0; -moz-border-bottom-colors: red #f60 #f80 #f90 #fa0 #fb0 #fc0 #fd0 #fe0 #ff0; -moz-border-left-colors: #e00 #c30 #c50 #c60 #c70 #c80 #c90 #ca0 #cb0 #cc0; } specifications this property is not part of any specification.
-moz-border-right-colors - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted.
...kground-color: gray; border: 10px solid black; -moz-border-top-colors: #e00 #c30 #c50 #c60 #c70 #c80 #c90 #ca0 #cb0 #cc0; -moz-border-right-colors: red #f60 #f80 #f90 #fa0 #fb0 #fc0 #fd0 #fe0 #ff0; -moz-border-bottom-colors: red #f60 #f80 #f90 #fa0 #fb0 #fc0 #fd0 #fe0 #ff0; -moz-border-left-colors: #e00 #c30 #c50 #c60 #c70 #c80 #c90 #ca0 #cb0 #cc0; } specifications this property is not part of any specification.
-moz-border-top-colors - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted.
...kground-color: gray; border: 10px solid black; -moz-border-top-colors: #e00 #c30 #c50 #c60 #c70 #c80 #c90 #ca0 #cb0 #cc0; -moz-border-right-colors: red #f60 #f80 #f90 #fa0 #fb0 #fc0 #fd0 #fe0 #ff0; -moz-border-bottom-colors: red #f60 #f80 #f90 #fa0 #fb0 #fc0 #fd0 #fe0 #ff0; -moz-border-left-colors: #e00 #c30 #c50 #c60 #c70 #c80 #c90 #ca0 #cb0 #cc0; } specifications this property is not part of any specification.
-ms-content-zooming - Archive of obsolete content
the element is not zoomable.
... formal syntax none | zoom specifications not part of any specification.
-ms-high-contrast-adjust - Archive of obsolete content
none indicates the applicable css properties will not be adjusted when the system is in high contrast mode.
... formal syntax auto | none specifications not part of any specification.
-ms-scroll-chaining - Archive of obsolete content
ontainer { -ms-scroll-chaining: chained; -ms-overflow-style: none; -ms-content-zooming: zoom; -ms-scroll-rails: none; -ms-content-zoom-limit-min: 100%; -ms-content-zoom-limit-max: 500%; -ms-scroll-snap-type: proximity; -ms-scroll-snap-points-x: snaplist(100%, 200%, 300%, 400%, 500%); -ms-overflow-style: none; width: 480px; height: 270px; overflow: auto; } specifications not part of any specification.
...for keyboard input the scroll does not chain regardless of the –ms-scroll-chaining value, and for mouse input the scroll will always chain up to the nearest scrollable ancestor element.
-ms-scroll-snap-points-x - Archive of obsolete content
initial valuesnapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values note: a <length-percentage> is a value that can be either a <length> or a <percentaqe>.
... .imagecontainer { -ms-scroll-chaining: chained; -ms-overflow-style: none; -ms-content-zooming: zoom; -ms-scroll-rails: none; -ms-scroll-limit-x-min: 100%; -ms-scroll-limit-x-max: 500%; -ms-scroll-snap-type: proximity; -ms-scroll-snap-points-x: snaplist(100%, 200%, 300%, 400%, 500%); -ms-overflow-style: none; width: 480px; height: 270px; overflow: auto; } specifications not part of any specification.
-ms-scroll-snap-points-y - Archive of obsolete content
initial valuesnapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values note: a <length-percentage> is a value that can be either a <length> or a <percentaqe>.
... .imagecontainer { -ms-scroll-chaining: chained; -ms-overflow-style: none; -ms-content-zooming: zoom; -ms-scroll-rails: none; -ms-scroll-limit-y-min: 100%; -ms-scroll-limit-y-max: 500%; -ms-scroll-snap-type: proximity; -ms-scroll-snap-points-y: snaplist(100%, 200%, 300%, 400%, 500%); -ms-overflow-style: none; width: 480px; height: 270px; overflow: auto; } specifications not part of any specification.
-ms-scroll-translation - Archive of obsolete content
formal syntax none | vertical-to-horizontal specifications not part of any specification.
... if your javascript is listening for scroll wheel document object model (dom) events, the events that occur when the user scrolls vertically will always be vertical scroll events, not horizontal scroll events.
-ms-scrollbar-base-color - Archive of obsolete content
note that scrollbar-base-color sets the scroll bar face color and highlight color to different shades of the same base color.
... specifications not part of any specification.
-ms-text-autospace - Archive of obsolete content
formal syntax none | ideograph-alpha | ideograph-numeric | ideograph-parenthesis | ideograph-space specifications not part of any specification.
... an ideograph is a character in an asian writing system that represents a concept or an idea, but not a particular word or pronunciation.
-ms-touch-select - Archive of obsolete content
none the grippers are always off and default touch selection functionality is not provided.
... formal syntax grippers | none specifications not part of any specification.
:-moz-system-metric(scrollbar-end-backward) - 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.
... specifications not part of any specification.
:-moz-system-metric(scrollbar-end-forward) - 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.
... specifications not part of any specification.
:-moz-system-metric(scrollbar-start-backward) - 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.
... specifications not part of any specification.
:-moz-system-metric(scrollbar-start-forward) - 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.
... specifications not part of any specification.
:-moz-system-metric(scrollbar-thumb-proportional) - 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.
... specifications not part of any specification.
:-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.
... specifications not part of any specification.
:-moz-system-metric() - 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.
... formal syntax syntax not found in db!
-moz-mac-graphite-theme - Archive of obsolete content
note: since firefox 58, this media feature is no longer available to web content — it is only available internally (e.g.
...if the user is using the standard blue appearance, or is not on mac os x, this is 0.
-moz-windows-glass - Archive of obsolete content
note: since firefox 58, this media feature is no longer available to web content — it is only available internally (e.g.
...note that this only exists for windows 7 and earlier.
The global XML object - Archive of obsolete content
extending xml.prototype xml.prototype and xmllist.prototype (xmllist.prototype is actually just xml.prototype) cannot be extended in the same conventional way as other constructors such as object.
... you can only define methods in xml.prototype and not fields.
Array.unobserve() - Archive of obsolete content
the callback should be a reference to a function and not an anonymous function, because this reference will be used to unset the previous observer.
... it's useless to call array.unobserve() with an anonymous function as callback, it will not remove any observer.
ArrayBuffer.transfer() - Archive of obsolete content
ue is still 40 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 another arraybuffer.
Generator comprehensions - Archive of obsolete content
do not use!
...do not use it!
Debug.debuggerEnabled - Archive of obsolete content
debugging may be enabled or disabled whether or not a debugger is attached.
... 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
if the script is not being debugged, the debug.write function has no effect.
... note: to run this example, you must have a script debugger installed and the script must run in debug mode.
VBArray.dimensions - Archive of obsolete content
do not use!
...not supported in windows 8.x store apps.
VBArray.getItem - Archive of obsolete content
do not use!
...not supported in windows 8.x store apps.
VBArray.lbound - Archive of obsolete content
do not use!
...not supported in windows 8.x store apps.
VBArray.toArray - Archive of obsolete content
do not use!
...not supported in windows 8.x store apps.
VBArray.ubound - Archive of obsolete content
do not use!
...not supported in windows 8.x store apps.
New in JavaScript 1.7 - Archive of obsolete content
the features that do not introduce new keywords (destructuring assignment and array comprehensions) can be used without specifying 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.
New in JavaScript 1.8 - Archive of obsolete content
</script> another way (not recommended) to do this is to use the deprecated <script> language attribute and define it as "javascript1.8".
...the features that do not introduce new keywords (such as generator expressions) can be used without specifying the javascript version.
Object.observe() - Archive of obsolete content
bject.observe(user, function(changes) { changes.foreach(function(change) { // any time name or title change, update the greeting if (change.name === 'name' || change.name === 'title') { updategreeting(); } }); }); custom change type // a point on a 2d plane var point = {x: 0, y: 0, distance: 0}; function setposition(pt, x, y) { // performing a custom change object.getnotifier(pt).performchange('reposition', function() { var olddistance = pt.distance; pt.x = x; pt.y = y; pt.distance = math.sqrt(x * x + y * y); return {olddistance: olddistance}; }); } object.observe(point, function(changes) { console.log('distance change: ' + (point.distance - changes[0].olddistance)); }, ['reposition']); setposition(point, 3, 4); // distance change: 5 s...
...pecifications not part of any standard.
Reflect.enumerate() - Archive of obsolete content
exceptions a typeerror, if target is not an object.
... examples using reflect.enumerate() var obj = { x: 1, y: 2 }; for (var name of reflect.enumerate(obj)) { console.log(name); } // logs "x" and "y" specifications not part of any standard.
String.prototype.quote() - Archive of obsolete content
also note the third column where a wrapped eval() evaluates the escape sequences again.
... " \ — ' "\" \\ \u2014 '" " \ — ' specifications not part of any standard.
arguments.caller - Archive of obsolete content
description this property is not available anymore, but you can still use function.caller.
... function whocalled() { if (arguments.caller == null) console.log('i was called from the global scope.'); else console.log(arguments.caller + ' called me!'); } specifications not part of any standard.
handler.enumerate() - Archive of obsolete content
var p = new proxy({}, { enumerate(target) { return 1; } }); for (var x in p) {} // typeerror is thrown note: both examples make use of the shorthand syntax for method definitions.
... specifications not part of any standard.
JavaArray - Archive of obsolete content
backward compatibility javascript 1.3 and earlier the methods of java.lang.object are not inherited by javaarray.
...you cannot use a javaclass object for the componenttype parameter.
Sharp variables in JavaScript - Archive of obsolete content
you cannot assign primitives (including strings) to sharp variables.
... #1 = {}; // this doesn't do much since the sharp variable is out of scope immediately after a = #2 = {}; // slightly more useful since we retain a reference to the new object to reference the sharp variable, simply append another sharp (#) to the end of the variable name.
Building Mozilla XForms - Archive of obsolete content
the following table gives you an overview of which version you want to build: firefox version gecko/toolkit version source code notes status firefox 2.0 gecko 1.8.1 cvs, branch mozilla_1_8_branch not developed any more last release: 0.8.5ff2 firefox 3.0 gecko 1.9.0 cvs, branch head not developed any more last release: 0.8.5ff3 firefox 3.5 gecko 1.9.1 xforms/schema-validation code does not build with firefox 3.5 any more not supported firefox 3.6 gecko 1.9.2 xforms/schema-validation code does not build with firefox...
... 3.6 any more not developed any more last release: 0.8.6 firefox 4 gecko 2.0 mercurial, repositories mozilla-central xforms schema-validation mostly works upcoming 0.8.7 release if you have your first working firefox build, you can go on with building the xforms extension.
Requests For Enhancement - Archive of obsolete content
ArchiveWebXFormsRFE
but a form author is not restricted to only those xml languages that gecko knows.
... xforms extension ui this section should be for used for noting potiential ui improvements to the mozilla xforms extension.
XForms Output Element - Archive of obsolete content
characteristics text is presented to the user when there is no type given for the bound node or a type is specified that is not handled by one of the other widgets (as documented below).
... analogous widgets are <xhtml:span/> and <xul:description/> calendar a form author may notice a xforms output element represented by a calendar widget in the mozilla xforms processor if the control meets the following criteria (xhtml/xul).
XForms Repeat Element - Archive of obsolete content
since html:table doesn't (and probably never will) allow xforms:repeat elements as children, another syntax is needed.
...note, we don't fully support attribute-based repeats.
XForms Switch Module - Archive of obsolete content
form controls, groups, switches, repeats and host language elements) within a non-selected case are not rendered.
...if multiple cases within a switch are marked as selected="true", the first selected case will appear and all others will not be visible.
XForms - Archive of obsolete content
note: support for xforms was removed from firefox in firefox 19.
...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.
Describing microformats in JavaScript - Archive of obsolete content
virtual a boolean value indicating whether or not the property is virtual.
... the microformat is registered with the microformat api by calling microformats.add(), like this: microformats.add("adr", adr_definition); note: to be clear: since the adr microformat is included by default in firefox 3 and later, you don't need to add it yourself if you wish to make use of it.
Popup Window Controls - Archive of obsolete content
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?
...ng popup controls</title> <script type="text/javascript"> <!-- // attempt to open an unsolicited window var popup = window.open('about:blank', 'popup'); if (!popup) { // the user has suppressed the popup } // --> </script> </head> <body> <!-- your page here --> </body> </html> if your popup window is crucial to the operation of your web site you can notify the user and ask them to add your site to the list of sites which are allowed to use unsolicited popup windows.
XUL Parser in Python - Archive of obsolete content
this is another hard-coded thing i have to open up.
...note also that i wrote the build number into the header myself, and haven't figured out yet how to get that written automatically.
Using the DOM File API in chrome code - Extensions
in bootstrap scope, this must be imported in like so: cu.importglobalproperties( [ "file" ] ) accessing a file by hard-coded pathname to reference a file by its path, you can simply use a string literal: var file = file.createfromfilename("path/to/some/file"); cross platform note: however using hard-coded paths raises cross platform issues since it uses a platform-dependent path separator (here "/").
... notes starting in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5), you can also do this in component code.
Building up a basic demo with PlayCanvas - Game development
note: check out the list of featured demos to find more examples.
...this can be a more pleasant working environment if you are not someone who likes to code.
3D games on the Web - Game development
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.
...we have information available for you to learn from: 2d collision detection 3d collision detection webxr the concept of virtual reality is not new, but it's storming onto the web thanks to hardware advancements such as the oculus rift, and the (currently experimental) webxr api for capturing information from vr and ar hardware and making it available for use in javascript applications.
Async scripts for asm.js - Game development
when is async not async?
... two common situations in which a script is *not* async (as defined by the html spec) are: <script async>code</script> and var script = document.createelement('script'); script.innerhtml = "code"; document.body.appendchild(script); both are counted as 'inline' scripts and get compiled and then run immediately.
Unconventional controls - Game development
proximity api another interesting idea is to use the built-in proximity sensors of your hardware to detect how far an object, for example a hand, is from the given sensor.
... note: see the deviceproximityevent reference page for more details.
Implementing game control mechanisms - Game development
streamlining cross device differences creates multiple challenges, not least when providing appropriate controls for different contexts.
... unconventional controls — the final article showcases some unconventional control mechanisms, from the experimental to the slightly crazy, which you might not believe could be used to play the game.
Bounce off the walls - Game development
we have another problem however — when the ball hits each wall it sinks into it slightly before changing direction: this is because we're calculating the collision point of the wall and the center of the ball, while we should be doing it for its circumference.
... the ball should bounce right after if touches the wall, not when it's already halfway in the wall, so let's adjust our statements a bit to include that.
Collision detection - Game development
it's our decision how to implement this, of course, but it can be tough to calculate whether the ball is touching the rectangle or not because there are no helper functions in canvas for this.
...we can do that by adding an extra parameter to indicate whether we want to paint each brick on the screen or not.
Game over - Game development
it's fun to watch the ball bouncing off the walls and be able to move the paddle around, but other than that the game does nothing and doesn't have any progression or end goal.
...if yes, then it bounces off just like you'd expect; if not then the game is over as before.
Paddle and keyboard controls - Game development
it's not a game if you cannot control it!
...add these lines somewhere near the rest of your variables: var rightpressed = false; var leftpressed = false; the default value for both is false because at the beginning the control buttons are not pressed.
Randomizing gameplay - Game development
our game appears to be completed, but if you look close enough you'll notice that the ball is bouncing off the paddle at the same angle throughout the whole game.
...it's not completely random of course, but it does make the gameplay a bit more unpredictable and therefore more interesting.
Game development
note: creating games on the web draws on a number of core web technologies such as html, css, and javascript.
...generated from c/c++ using clang, or from another language) and compiles that into asm.js, which can be run on the web.
Callback function - MDN Web Docs Glossary: Definitions of Web-related terms
a callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action.
... note, however, that callbacks are often used to continue code execution after an asynchronous operation has completed — these are called asynchronous callbacks.
Control flow - MDN Web Docs Glossary: Definitions of Web-related terms
to do this, the script uses a conditional structure or if...else, so that different code executes depending on whether the form is complete or not: if (field==empty) { promptuser(); } else { submitform(); } a typical script in javascript or php (and the like) includes many control structures, including conditionals, loops and functions.
... control flow means that when you read a script, you must not only read from start to finish but also look at program structure and how it affects order of execution.
Distributed Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
the overflow of data to the target causes saturation in the target machine so that it cannot respond or responds very slowly to legitimate traffic (hence the name "denial of service").
...both kaspersky labs and symantec have identified botnets -- not spam, viruses, or worms -- as the biggest threat to internet security.
Dynamic programming language - MDN Web Docs Glossary: Definitions of Web-related terms
this is opposed to so-called static programming languages, in which such changes are normally not possible.
... note that while there is indeed a connection between this dynamic/static property of programming languages and dynamic/static-typing, the two are far from synonymous.
Element - MDN Web Docs Glossary: Definitions of Web-related terms
in xml and html, an element may contain a data item or a chunk of text or an image, or perhaps nothing.
... elements and tags are not the same things.
Fallback alignment - MDN Web Docs Glossary: Definitions of Web-related terms
in css box alignment, a fallback alignment is specified in order to deal with cases where the requested alignment cannot be fullfilled.
...if there is not, the fallback alignment is used.
Falsy - MDN Web Docs Glossary: Definitions of Web-related terms
"" empty string value null null - the absence of any value undefined undefined - the primitive value nan nan - not a number objects are falsy if and only if they have the [[ishtmldda]] internal slot.
... this slot only exists in document.all and cannot be set using javascript.
Forbidden header name - MDN Web Docs Glossary: Definitions of Web-related terms
a forbidden header name is the name of any http header that cannot be modified programmatically; specifically, an http request header name (in contrast with a forbidden response header name).
... forbidden header names start with proxy- or sec-, or are one of the following names: accept-charset accept-encoding access-control-request-headers access-control-request-method connection content-length cookie cookie2 date dnt expect feature-policy host keep-alive origin proxy- sec- referer te trailer transfer-encoding upgrade via note: the user-agent header is no longer forbidden, as per spec — see forbidden header name list (this was implemented in firefox 43) — it can now be set in a fetch headers object, or via xhr setrequestheader().
Graceful degradation - MDN Web Docs Glossary: Definitions of Web-related terms
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 still delivers essential content and functionality in older browsers.
...in reality both approaches are valid and can often complement one another.
Hyperlink - MDN Web Docs Glossary: Definitions of Web-related terms
hyperlinks connect webpages or data items to one another.
... in html, <a> elements define hyperlinks from a spot on a webpage (like a text string or image) to another spot on some other webpage (or even on the same page).
IDL - MDN Web Docs Glossary: Definitions of Web-related terms
idl attributes are not always strings; for example, input.maxlength is a number (a signed long).
...if you pass another type, it is automatically converted to a number as specified by the standard javascript rules for type conversion.
IIFE - MDN Web Docs Glossary: Definitions of Web-related terms
the variable within the expression can not be accessed from outside it.
... (function () { var aname = "barry"; })(); // variable aname is not accessible from the outside scope aname // throws "uncaught referenceerror: aname is not defined" assigning the iife to a variable stores the function's return value, not the function definition itself.
Mutable - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, only objects and arrays are mutable, not primitive values.
... immutables are the objects whose state cannot be changed once the object is created.
NaN - MDN Web Docs Glossary: Definitions of Web-related terms
nan (not a number) is a numeric data type that means an undefined value or value that cannot be represented, especially results of floating-point calculations.
...fortunately, since the result will be nan and i know my divisor may turn out to be 0, i can set up testing conditions that prevent any such computations in the first place or notify me of where they happen.
Normative - MDN Web Docs Glossary: Definitions of Web-related terms
normative is a word commonly used in software specifications to denote sections that are standardized and must be followed as a rule.
... specifications might also contain sections that are marked as non-normative or informative, which means those are provided there for the purpose of helping the reader understand the specifications better or to showcase an example or best practice, which need not be followed as a rule.
Parameter - MDN Web Docs Glossary: Definitions of Web-related terms
note the difference between parameters and arguments: function parameters are the names listed in the function's definition.
... output/return parameters primarily return multiple values from a function, but not recommended since they cause confusion learn more general knowledge difference between parameter and argument on wikipedia technical reference function declaration function expression ...
Polyfill - MDN Web Docs Glossary: Definitions of Web-related terms
a polyfill is a piece of code (usually javascript on the web) used to provide modern functionality on older browsers that do not natively support it.
... the reason why polyfills are not used exclusively is for better functionality and better performance.
SLD - MDN Web Docs Glossary: Definitions of Web-related terms
a domain name is not limited to a tld and an sld.
... as another example, in developer.mozilla.org, the developer subdomain is used to specify that the subdomain contains the developer section of the mozilla website.
Second-level Domain - MDN Web Docs Glossary: Definitions of Web-related terms
a domain name is not limited to a tld and an sld.
... as another example, in developer.mozilla.org, the developer subdomain is used to specify that the subdomain contains the developer section of the mozilla website.
Semantics - MDN Web Docs Glossary: Definitions of Web-related terms
consider the following: <span style="font-size: 32px; margin: 21px 0;">is this a top level heading?</span> this will render it to look like a top level heading, but it has no semantic value, so it will not get any extra benefits as described above.
... html should be coded to represent the data that will be populated and not based on its default presentation styling.
Shadow tree - MDN Web Docs Glossary: Definitions of Web-related terms
the hidden nodes are not directly visible using regular dom functionality, but require the use of a special shadow dom api to access.
... nodes within the shadow tree are not affected by anything applied outside the shadow tree, and vice versa.
State machine - MDN Web Docs Glossary: Definitions of Web-related terms
this is like the "if" statement in that if x == true then dothis else dothat is not possible.
... note that any regular expression can be represented by a state machine.
Static method - MDN Web Docs Glossary: Definitions of Web-related terms
examples in the notifications api, the notification.requestpermission() method is called on the actual notification constructor itself — it is a static method: let promise = notification.requestpermission(); the notification.close() method on the other hand, is an instance method — it is called on an specific notification object instance to close the system notification it represents: let mynotification = new...
... notification('this is my notification'); mynotification.close(); ...
Synchronous - MDN Web Docs Glossary: Definitions of Web-related terms
a human example is the telephone — during a telephone call you tend to respond to another person immediately.
... many programming commands are also synchronous — for example when you type in a calculation, the environment will return the result to you instantly, unless you program it not to.
Tag - MDN Web Docs Glossary: Definitions of Web-related terms
note that the end tag's name is preceded by a slash character, </p>, and that in empty elements, the end tag is neither required nor allowed.
... if attributes are not mentioned, default values are used in each case.
Type - MDN Web Docs Glossary: Definitions of Web-related terms
for example, a value of type number can be multiplied by another number, but not by a string - even if that string contains only a number, such as the string "2".
...comparison between structured types is not always an easy assumption, as even if the previous data structure is the same, there could be inherited structures inside of the prototype chain.
UDP (User Datagram Protocol) - MDN Web Docs Glossary: Definitions of Web-related terms
udp is suitable for purposes where error checking and correction are either not necessary or are performed in the application; udp avoids the overhead of such processing in the protocol stack.
... time-sensitive applications often use udp because dropping packets is preferable to waiting for packets delayed due to retransmission, which may not be an option in a real-time system.
Unicode - MDN Web Docs Glossary: Definitions of Web-related terms
for example, one character set would store japanese characters, and another would store the arabic alphabet.
... if it was not clearly marked which parts of the data were in which character set, other programs and computers would display the text incorrectly, or damage it during processing.
XLink - MDN Web Docs Glossary: Definitions of Web-related terms
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.
... 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.
lossy compression - MDN Web Docs Glossary: Definitions of Web-related terms
the process of such compression is irreversible; once lossy compression of the content has been performed, the content cannot be restored to its original state.
... therefore, content that has undergone lossy compression should generally not be further edited.
Test your skills: CSS and JavaScript accessibility - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... but it is not very accessible — in its current state you can only operate it with the mouse.
Creating fancy letterheaded paper - Learn web development
note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page.
... 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.
Test your skills: Images and Form elements - Learn web development
note: you can try out solutions in the interactive editors below, however, it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
...we want the image to scale down to fit inside the box without any extra white space, but we do not mind if some part of the image is cropped.
Test your skills: Overflow - Learn web development
note: you can try out solutions in the interactive editors below, however, it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
...test by removing some of the text from the html, that if there is only a small amount of text that does not overflow, no scrollbar appears.
Test your skills: tables - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
...in this task we are going to style the same table, but using some good practices for table design as outlined in the external article web typography: designing tables to be read not looked at.
Test your skills: backgrounds and borders - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... make sure that the heading text does not overlay the image, and that it is centered — you will need to use techniques learned in previous lessons to achieve this.
CSS building blocks - Learn web development
note: if you are working on a computer/tablet/another device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... overflowing content in this lesson we will look at another important concept in css — overflow.
Test your skills: Flexbox - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... flex layout three there are two elements in the html below, a div with a class of .parent which contains another div with a class of .child.
Floats - Learn web development
but web developers quickly realized that you can float anything, not just images, so the use of float broadened, for example to fun layout effects such as drop-caps.
... floats have commonly been used to create entire web site layouts featuring multiple columns of information floated so they sit alongside one another (the default behavior would be for the columns to sit below one another, in the same order as they appear in the source).
Test your skills: Grid Layout - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
...you do not need to make any changes to the html in order to do this.
Using your new knowledge - Learn web development
note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page.
... afterwards try looking up some properties not mentioned on this page in the mdn css reference and get adventurous!
Learn to style HTML using CSS - Learn web development
now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another.
...but there's not much you can't do once you have a solid understanding of even the basics of css.
What HTML features promote accessibility? - Learn web development
tabbing users who do not or cannot use pointing devices can tab through links and, as such, links should be in a logical tabbing order.
... <ul> <li><a href="here.html" tabindex="1">here</a></li> <li><a href="there.html" tabindex="3">there</a></li> <li><a href="anywhere.html" tabindex="2">anywhere</a></li> </ul> in this example (which is used purely as a demonstration—do not do this), tabbing would jump from “here” to “anywhere” to “there”.
How do you set up a local testing server? - Learn web development
some browsers (including chrome) will not run async requests (see fetching data from the server) if you just run the example from a local file.
... note: if you already have something running on port 8000, you can choose another port by running the server command followed by an alternative port number, e.g.
Common questions - Learn web development
this section of the learning area is designed to provide answers to common questions that may come up, which are not necessarily part of the structured core learning pathways (e.g.
... when you're launching a website, you may spend nothing or your costs may go through the roof.
Test your skills: Form validation - Learn web development
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.
... note: regular expressions are really challenging if you are new to them, but don't despair — have a go and see where you get to; there is no shame in asking for some help.
Marking up a letter - Learn web development
note: if you get stuck, then ask us for help.
...each line of the address should sit on a new line, but not be in a new paragraph.
Structuring a page of content - Learn web development
note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page.
... you need to add a suitable wrapper for: the header the navigation menu the main content the welcome text the image sidebar the footer you should also: apply the provided css to the page by adding another <link> element just below the existing one provided at the start.
Introduction to HTML - Learn web development
note: if you are working on a computer/tablet/other devices that doesn't let you create your own files, you can try out (most of) the code examples in an online coding program such as jsbin or glitch.
...metadata in html the head of an html document is the part that is not displayed in the web browser when the page is loaded.
Test your skills: HTML images - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... add some alternative text to an appropriate attribute to describe the image, for people that cannot see it.
Asynchronous JavaScript - Learn web development
if you are not familiar with the concept of asynchronous programming, you should definitely start with the general asynchronous programming concepts article in this module.
... note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you can try out (most of) the code examples in an online coding program such as jsbin or glitch.
JavaScript building blocks - Learn web development
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... functions — reusable blocks of code another essential concept in coding is functions.
Test your skills: variables - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... note: in the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
JavaScript First Steps - Learn web development
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... useful string methods now we've looked at the very basics of strings, let's move up a gear and start thinking about what useful operations we can do on strings with built-in methods, such as finding the length of a text string, joining and splitting strings, substituting one character in a string for another, and more.
Test your skills: Object-oriented JavaScript - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... note: in the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
The business case for web performance - Learn web development
we know that not prioritizing web performance can result in a loss of business revenue.
... area of conflict - not prioritizing web performance, but expecting good business metrics (see the three above).
Multimedia: video - Learn web development
if not, there are online tools, such as ffmpeg (discussed in section below), that encode, decode, convert, and perform other optimization functions.
...if not, a free utility called ffmpeg can do it for you.
The "why" of web performance - Learn web development
a good goal for web performance is for users to not notice performance.
...good performance may not be obvious to most site visitors, but most will immediately recognize a sluggish site.
Server-side website programming - Learn web development
basic knowledge of programming concepts (or of a particular programming language) is useful, but not essential.
... similarly, expertise in client-side coding is not required, but a basic knowledge will help you work better with the developers creating your client-side web "front end".
Using Vue computed properties - Learn web development
currently, we're not actually tracking the "done" data in any fashion, so the number of completed items does not change.
... since we're not relying on a button press to trigger the change, we can attach a @change event handler to each checkbox instead of using v-model.
Vue resources - Learn web development
vue school — another paid education platform specializing in vue.
... note: the vue cli docs also include a specific guide on how to publish your app to many of the common hosting platforms.
Accessibility Features in Firefox
for example, prefs.js gives access to a large number of configuration options not available in the preferences window.
...the two companies anticipate that in 2007, firefox will support topnotch screen reader accessibility on unix and linux.
Accessibility Information for Core Gecko Developers
html accessibility 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 often not even keyboard focusable, and assistive technologies do not understand these widgets.
Links and Resources
wave 3.0 (web accessibility versatile evaluator) from webaim and sponsored by temple university institute on disabilities wave 3.0 is another powerful, mature, free online webpage accessibility validation service that identifies accessibility errors and reports accessibility warnings about webpage related to section 508 standards and/or the wcag guidelines.
... dive into accessibility - another great, easy-to-understand resource on accessible website authoring.
Adding phishing protection data providers
optional preferences browser.safebrowsing.provider.idnum.reporturl an url used for reporting when users visit phishing pages and whether or not they decided to heed the warning or to ignore it.
... browser.safebrowsing.provider.idnum.reportgenericurl not currently used; intended for use in reporting other issues with the phishing protection service.
Building Firefox with Debug Symbols
by default, a release build of firefox will not generate debug symbols suitable for debugging or post-processing into the breakpad symbol format.
...this value takes precedence over the flags set in moz_debug_flags note that this will override the values provided for cflags and cxxflags.
Updating NSPR or NSS in mozilla-central
do not check in individual changes.
... (because some developers might not be aware that nspr/nss are separately maintained and released, the mozilla hg server rejects accidental changes/forking, if the required keywords are missing in the commit comment.) if nspr or nss must be upgraded to a new static tag, follow this procedure: before starting, make sure your local repository is updated to mozilla-central tip and that there are no local changes: $ hg status -mard pull the new sources $ python client.py update_nspr nspr_tag_name or $ python client.py update_nss nss_tag_name if you update a branch older than mozilla 17 (without the change from bug 782784), you must manual...
Process scripts
similarly, some observer notifications must be registered in the content process, but if you do this in a frame script, and the frame script is loaded more than once, then you will get multiple notifications for that event.
... retrieving the content frame message manager for a content window when an observer notification in a process script contains a content document or window it can be useful to not use talk through the child/parent process message managers but through the window's content frame message manager, e.g.
Firefox and the "about" protocol
see firefox reader view for clutter-free web pages about:rights displays rights information about:robots special page showing notes about robots about:serviceworkers displays currently running service workers about:studies lists the shield studies that are installed about:sessionrestore session restoration (displayed after a firefox crash) about:support troubleshooting information (also available through firefox menu > ?
... note: you must access about: protocol pages by typing them into the address bar.
Firefox UI considerations for web developers
note: only "rich" icons (apple-touch-icon and fluid-icon) support 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).
HTMLIFrameElement.addNextPaintListener()
note: the handler will receive the event once and then be thrown away.
... examples var browser = document.queryselector('iframe'); function onnextpaint() { console.log("paint has occured"); } browser.addnextpaintlistener(onnextpaint); specification not part of any specification.
HTMLIFrameElement.clearMatch()
note: use of the browser api requires a privileged app, and browser and/or embed-apps permissions, depending on what you want to do.
...(search.getattribute('class') === 'search') { search.setattribute('class', 'search shifted'); } else if(search.getattribute('class') === 'search shifted') { search.setattribute('class', 'search'); if(searchactive) { browser.clearmatch(); searchactive = false; prev.disabled = true; next.disabled = true; searchbar.value = ''; } } }); specification not part of any specification.
HTMLIFrameElement.findAll()
note: use of the browser api requires a privileged app, and browser and/or embed-apps permissions, depending on what you want to do.
... searchform.addeventlistener('submit', function(e) { e.preventdefault(); browser.findall(searchbar.value, 'case-sensitive'); searchactive = true; prev.disabled = false; next.disabled = false; searchbar.blur(); }); specification not part of any specification.
HTMLIFrameElement.findNext()
note: use of the browser api requires a privileged app, and browser and/or embed-apps permissions, depending on what you want to do.
... prev.addeventlistener('touchend',function() { browser.findnext('backward'); }); next.addeventlistener('touchend',function() { browser.findnext('forward'); }); specification not part of any specification.
HTMLIFrameElement.getContentDimensions()
note: the values returned are equivalent to document.body.scrollwidth and document.body.scrollheight.
... examples var browser = document.queryselector('iframe'); var request = browser.getcontentdimensions(); request.onsuccess = function() { console.log("page size:", request.result.width + "x" + request.result.height); } request.onerror = function() { console.log("download error"); } specification not part of any specification.
:-moz-lwtheme-brighttext
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.
:-moz-lwtheme-darktext
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.
:-moz-lwtheme
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.
::-moz-tree-row
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.
Chrome-only CSS reference
MozillaGeckoChromeCSS
ua stylesheets.) note: most of the css properties exposed to the web in general are also usable in chrome stylesheets: see the css documentation for a list of these.
... -moz-window-draggingthe -moz-window-dragging css property specifies whether a window is draggable or not.
smartcard-insert
bubblesread only boolean whether the event normally bubbles or not.
... cancelableread only boolean whether the event is cancellable or not.
smartcard-remove
bubblesread only boolean whether the event normally bubbles or not.
... cancelableread only boolean whether the event is cancellable or not.
How to add a build-time test
note that the following variables are supplied by the rules.mk file: cppsrcs, simple_programs, run_test_program.
...you can of course use unit or test if you're not feeling creative.
Add-on Manager
for example: components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getalladdons(function(aaddons) { // here aaddons is an array of addon objects }); // this code will execute before the code inside the callback notifications about changes to installed add-ons are dispatched to any registered addonlisteners.
... for example, to take a look at the add-ons that were disabled at startup: components.utils.import("resource://gre/modules/addonmanager.jsm"); let addonids = addonmanager.getstartupchanges(addonmanager.startup_change_disabled); if (addonids.length > 0) { // addonids is now an array of the add-on ids that have been disabled alert("note: " + addonids.length + " add-ons have been disabled."); } open add-on manager tab the add-on manager tab can be opened programatically with the function browseropenaddonsmgr which is available on chrome window of "navigator:browser" type.
Widget Wrappers
this array is not live.
...note that you may prefer to use the group wrapper's getter/setter instead.
Log.jsm
something bad happened!"); log.debug("details about bad thing only useful during debugging", {someinfo: "nothing"}); log.warn("here is an error", new error("ouch")); logger levels fatal severe errors that cause premature termination.
... warn use of deprecated apis, poor use of api, 'almost' errors, other runtime situations that are undesirable or unexpected, but not necessarily "wrong".
JavaScript code modules
note: these are not the same thing as standard javascript modules.
... popupnotifications.jsm gives an easy way to present non-modal notifications to users.
Localization: Frequently asked questions
this page lists tweaks and tips that may not require a complete page on its own.
... how can i not display a variable in a .properties entry?
Localizing extension descriptions
if you do not currently have them, create localized properties files.
... add the following line to each of your localization properties files (where extension_id matches your extension id (<em:id> from install.rdf) and localized_description is the description of your extension that you want to appear in the given language): extensions.extension_id.description=localized_description if you do not currently have one, create a default preferences file.
Localization quick start guide
note: this guide is written for two types of contributors: those starting a new localization and those joining an existing localization.
...to help you filter through to the most applicable information, note that all information that is unique to those starting a new localization will be in orange font.
Uplifting a localization from Central to Aurora
this looks something like searching for changes adding changesets adding manifests adding file changes added 22 changesets with 23 changes to 46 files (+1 heads) (run 'hg heads' to see heads, 'hg merge' to merge) ok, let's make sure we're not talking relbranches: hg heads --template '{node} {branches}\n' this is printing something like 5131e147fa50c28ec858c7d9fd1ba201ea2a433b 4da525ed77699794c56081791bd46cc85983f6f8 9bc7e6c58fc091c8cd0e8d9e1dbc7e6f592772a7 gecko20b12_2011022218_relbranch 230e99fada602842d9630e673077ef9f1ab34247 gecko20b12pre_20110216_relbranch 41a4357884d7bcc50e69c71014124d3af2482afe comm20b11_2...
...you don't want to push this to aurora before there's been the notification that the status of aurora has been lifted up to beta.
Creating localizable web content
images check that images are not going to be a problem for the audience (cultural references, positionning, mirroring for rtl, text in images...) and spot what sizes/margins can be tweaked by css or have to be fixed for all locales but english don't use text in icons images 1&2.
... if however the screenshot shows a third-party application or website, it's acceptable to use the english version if it's not available in the target language.
Extras
mathml extras this is a technology demonstration of some of the extras in mozilla but not defined in the mathml spec, and not prevented by the spec either.
... they are not portable and are meant to showcase a few interesting upshots from building natively upon the browser environment.
Updates
this page is not maintained frequently.
...some improvements are particularly worth noting: a new html parser, which lets you use mathml inside non-xhtml documents.
MathML Demo: <mo> - operator, fence, separator, or accent
in latex, the lspace on a left side fence delimiter and the rspace on a right side fence delimiter is not 0.
...fixed sized fences are useful with nested fences as in the following example [ [ a b ] + [ b a ] ] + [ a b ] latex fences that are built into fractions (\binom, etc.) are not stretchy, but they are taller in displays.
MathML Demo: <mtable> - tables and matrices
by default -- when the align attribute is not set, or when align="axis", the middle of the table coincides with the math axis.
...d+p ( α β γ δ ) ...--- , but note that setting the baseline relative to a particular row is meaningless if the row doesn't have at least one cell with "rowalign=baseline" where to anchor the baseline (in which case mozilla will behave as if it was align="center#rownumber").
mozilla::MutexAutoUnlock
because of mozilla::mutexautolock, the rule for determining if your code does not own the mutex underlying the mutexautounlock is slightly more complicated than that for monitorautoenter.
...important: when a mozilla::mutexautounlock is the mutex raii wrapper most recently pushed on the stack, your code is guaranteed not to own the underlying mozilla::mutex.
GC and CC logs
as noted in the previous section, with multiprocess firefox, you can't record logs from the content process, due to sandboxing.
...note that just moz_cc_log_directory=.
GPU performance
not that useful for firefox because all of our shaders are pretty simple.
... amd gpu perfstudio - i had trouble getting this to work, and can't remember whether i actually did or not.
Profiling with the Gecko Profiler and Local Symbols on Windows
follow the steps below: note: you only need to do this if you're on windows and you've built firefox yourself.
... for any official release of firefox (nightly, beta, etc), you do not need to use these steps.
perf
note: the power profiling overview is worth reading at this point if you haven't already.
... performance counter stats for 'system wide': 51.58 joules power/energy-pkg/ [100.00%] 14.80 joules power/energy-cores/ [100.00%] 9.93 joules power/energy-gpu/ [100.00%] 27.38 joules power/energy-ram/ [100.00%] 5.003049064 seconds time elapsed it's not clear from the output, but the following relationship holds.
nglayout.debug.disable_xul_cache
the effect is that the source xml file is not read and re-parsed each time the chrome in question is displayed.
...possible values and their effects: true: do not cache parsed xul documents and do not save the cache to the xul fastload file on exit; re-read the source files each time the window or dialog needs to be displayed.
Emscripten
generated from c/c++ using clang, or from another language) and compiles that into javascript, which can be run on the web.
... note: sound interesting?
Installing JSHydra
prerequisites for building spidermonkey spidermonkey is part of the build process, but since jshydra will get the code if required, you do not need to worry about obtaining the right version of spidermonkey.
...there is not yet a repository for this information, but bug 506128 contains more information.
L20n
note: this document is in draft form/out-of-date — for current documentation please see our documentation on github.
...it allows to adapt your web application not only to languages and cultures, but also contextual data, user gender and screen dimensions.
Anonymous Shared Memory
this restricts processes that do not inherit the shared memory from opening the file and reading or writing its contents.
...if you are not paranoid, you're not paying attention.
Atomic Operations
since not all operating environments provide access to such functions, their performance may vary considerably.
...on systems that do not provide direct access to atomic operators, nspr emulates the capabilities by using its own locking mechanisms.
Date and Time
there is no notion of time zone.
... note that absolute and clock times are not normally used in timing operations.
Locks
monitors in this generic sense should not be confused with monitors used in java programming.
... in addition to prlock, nspr provides another mutex type, prmonitor, which is reentrant and can have only one associated condition variable.
NSPR LOG MODULES
level is a numeric value between 0 and 5, with the values having the following meanings: 0 = pr_log_none: nothing should be logged 1 = pr_log_always: important; intended to always be logged 2 = pr_log_error: errors 3 = pr_log_warning: warnings 4 = pr_log_debug: debug messages, notices 5: everything!
... if not specified, the existing contents of nspr_log_file will be lost as a new file is created with the same filename.
Named Shared Memory
shared memory protocol named shared memory functions shared memory protocol using named shared memory functions pr_opensharedmemory creates the shared memory segment, if it does not already exist, or opens a connection with the existing shared memory segment if it already exists.
...following a call to pr_closesharedmemory, the prsharedmemory object is invalid and cannot be reused.
PLHashEnumerator
remark the meaning of ht_enumerate_unhash is not clear.
...the entries are unlinked from the table, they are not freed, but the entry count (the nentries field of the plhashtable structure) is not decremented.
PL_HashTableAdd
the default freeentry function does not free the value of the entry.
... pl_hashtableadd returns null if there is not enough memory to create a new entry.
PL_NewHashTable
the hash table library functions do not make a copy of this structure.
...note that the default freeentry function does not free the value of the entry.
PRCallOnceType
syntax #include <prinit.h> typedef struct prcalloncetype { printn initialized; print32 inprogress; prstatus status; } prcalloncetype; fields the structure has these fields: initialized if not zero, the initialization process has been completed.
... inprogress if not zero, the initialization process is currently being executed.
PRErrorCode
the error number namespace is not well managed.
...nspr does not attempt to address this issue.
PRIOMethods
not all functions in the methods table are implemented for all types of files.
... for example, the seek method is implemented for normal files but not for sockets.
PRNetAddr
prnetaddr is binary-compatible with the socket address structures in the familiar berkeley socket interface, although this fact should not be relied upon.
...(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.
PRThreadPriority
however, because of the multiple strategies nspr uses to implement threading on various host platforms, nspr priorities are not precisely defined.
...this preference is still subject to resource availability and must not be used in place of proper synchronization.
PRTime
although utc and gmt are not exactly the same in their precise definitions, they can generally be treated as if they were.
... note: keep in mind that while prtime stores times in microseconds since epoch, javascript date objects store times in milliseconds since epoch.
PR_ASSERT
returns nothing description this macro evaluates the specified expression.
... this macro compiles to nothing if compile-time options are not specified to enable logging.
PR_Accept
if the addr parameter is not null, pr_accept stores the address of the connecting entity in the prnetaddr object pointed to by addr.
...if the timeout parameter is not pr_interval_no_timeout and no pending connection can be accepted before the time limit, pr_accept returns null with the error code pr_io_timeout_error.
PR_Assert
returns nothing description this function displays data in the log.
... normally an application would not call this function directly; use pr_assert instead.
PR_CreateThread
nspr does not assess the type or the validity of the value passed in this parameter.
...you can then use pr_jointhread to synchronize the termination of another thread.
PR_EnumerateHostEnt
this parameter is not checked for validity.
...the principle input, the prhostent structure, is not modified.
PR_FREEIF
returns nothing.
... description this macro returns memory to the heap when _ptr is not null.
PR_FindSymbolAndLibrary
if the symbol could not be found, returns null.
...the order in which the known libraries are searched in not specified.
PR_GetLibraryName
this function does not test for existence of the specified file, it just constructs the full filename.
... if sufficient storage cannot be allocated to contain the constructed path name, the function returns null.
PR_GetOpenFileInfo
if file information is not successfully obtained, pr_failure.
...to get equivalent information on a file that's not already open, use pr_getfileinfo.
PR_GetOpenFileInfo64
if file information is not successfully obtained, pr_failure.
...to get equivalent information on a file that's not already open, use pr_getfileinfo64.
PR_GetThreadPrivate
returns null if the data has not been set.
...do not delete the object that the private data refers to without first clearing the thread's value.
PR ImportTCPSocket
the caller must not do anything to the native file descriptor before the pr_importtcpsocket call that will prevent the native file descriptor from working in non-blocking mode.
...if you are not sure whether pr_importtcpsocket is right for you, please ask in the mozilla.dev.tech.nspr newsgroup.
PR_InitializeNetAddr
this may occur, for example, if the value of val is not within the ranges defined by prnetaddrvalue.
... the special network address values are identified by the enum prnetaddrvalue: typedef enum prnetaddrvalue{ pr_ipaddrnull, pr_ipaddrany, pr_ipaddrloopback } prnetaddrvalue; the enum has the following enumerators: pr_ipaddrnull do not overwrite the ip address.
PR_Lock
acquiring the lock is not an interruptible operation, nor is there any timeout mechanism.
... pr_lock is not reentrant.
PR_MkDir
all the path components up to but not including the leaf component must already exist.
...all the path components up to but not including the leaf component must already exist.
PR_NormalizeTime
returns nothing; the time parameter is altered by the callback function.
... to convert from one time zone to another.
PR_Now
you cannot assume that the values returned by pr_now() are monotonically increasing because the system clock of the computer may be reset.
... to obtain monotonically increasing time stamps suitable for measuring elapsed time, use pr_intervalnow().
PR_OpenSemaphore
syntax #include <pripcsem.h> #define pr_sem_create 0x1 /* create if not exist */ #define pr_sem_excl 0x2 /* fail if already exists */ nspr_api(prsem *) pr_opensemaphore( const char *name, printn flags, printn mode, pruintn value ); parameters the function has the following parameters: name the name to be given the semaphore.
...if pr_sem_create is not specified, the third and fourth arguments are ignored.
PR_Poll
if pr_poll returns 0 or -1, the out_flags fields do not contain meaningful values and must not be used.
... note that the pr_poll_err and pr_poll_nval flags are used only in out_flags.
PR_PopIOLayer
if the layer is not found in the stack or cannot be popped (for example, the bottommost layer), the function returns null with the error code pr_invalid_argument_error.
... even if the identity indicates the top layer of the stack, the reference returned is not the file descriptor for the stack and that file descriptor remains valid.
PR_ReadDir
do not skip any files.
...the caller must not free the prdirentry structure.
PR_Rename
if file is not successfully renamed, pr_failure.
...in this case, pr_rename does not overwrite the existing filename.
PR_STATIC_ASSERT
an expression which cannot be evaluated at compile time will cause a compiler error; see pr_assert for a runtime alternative.
... returns nothing description this macro evaluates the specified expression.
PR_SetErrorText
if not null, and if text is zero, the string is assumed to be a null-terminated c string.
...the new value is copied into storage allocated and owned by nspr and remains there until the next call to pr_seterror or another call to pr_seterrortext.
PR_SetLibraryPath
the syntax of the pathname is not defined, nor whether that pathname should be absolute or relative.
...this may indicate that the function cannot allocate sufficient storage to make a copy of the path string description this function registers a default library pathname with the runtime.
PR_SetLogBuffering
returns nothing description this function sets the size of the buffer used in nspr logging.
... ordinarily, a user application need not use this function, as nspr initializes logging at nspr startup.
PR_StringToNetAddr
description for ipv4 addresses, the input string represents numbers in the internet standard "." notation.
...otherwise, use of anything other than ipv4 dotted notation results in an error.
NSPR API Reference
sert_before pr_insert_after dynamic library linking library linking types prlibrary prstaticlinktable library linking functions pr_setlibrarypath pr_getlibrarypath pr_getlibraryname pr_freelibraryname pr_loadlibrary pr_unloadlibrary pr_findsymbol pr_findsymbolandlibrary finding symbols defined in the main executable program platform notes dynamic library search path exporting symbols from the main executable program process management and interprocess communication process management types and constants prprocess prprocessattr process management functions setting the attributes of a new process creating and managing processes multiwait receive system information and environmen...
...t variables logging conditional compilation and execution log types and variables prlogmoduleinfo prlogmodulelevel nspr_log_modules nspr_log_file logging functions and macros pr_newlogmodule pr_setlogfile pr_setlogbuffering pr_logprint pr_logflush pr_log_test pr_log pr_assert pr_assert pr_not_reached use example instrumentation counters named shared memory shared memory protocol named shared memory functions anonymous shared memory anonymous memory protocol anonymous shared memory functions ipc semaphores ipc semaphore functions thread pools thread pool types thread pool functions random number generator random number generator function hash tables hash tables and type constants hash table func...
Building NSS
to check out the latest sources for nss and nspr--which may not be part of a stable release--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.
... use_asan 0 do not create an addresssanitizer build.
Getting Started With NSS
(unfortunately the nss project doesn't have a technical writer at this time, so our documentation is not as organized as we would like it to be.
... note that we don't land code that isn't both reviewed and tested.
Using JSS
MozillaProjectsNSSJSSUsing JSS
not present on all platforms.
...it is not just the directory that contains jss42.jar.) ld_library_path (unix) / path (windows) include the path to the nspr, nss, and jss shared libraries.
NSS Key Log Format
note: starting with nss 3.24 (used by firefox 48 and 49 only), the sslkeylogfile approach is disabled by default for optimized builds using the makefile (those using gyp via build.sh are not affected).
...(see bug 1188657.) notably, debian does not have this option enabled, see debian bug 842292.
NSS Sample Code sample3
* this code uses the simplest of the init functions, which does not * require a nss database to exist */ nss_nodb_init("."); /* get a slot to use for the crypto operations */ slot = pk11_getinternalkeyslot(); if (!slot) { cout << "getinternalkeyslot failed" << endl; status = 1; goto done; } /* * part 1 - simple hashing */ cout << "part 1 -- simple hashing" << endl; /* initialize data */ memset(data, 0xbc, sizeof dat...
...- hashing with included secret key */ cout << "part 2 -- hashing with included secret key" << endl; /* initialize data */ memset(data, 0xbc, sizeof data); /* create a key */ key = pk11_keygen(slot, ckm_generic_secret_key_gen, 0, 128, 0); if (!key) { cout << "create key failed" << endl; goto done; } cout << (void *)key << endl; /* create parameters for crypto context */ /* note: params must be provided, but may be empty */ secitem noparams; noparams.type = sibuffer; noparams.data = 0; noparams.len = 0; /* create context using the same slot as the key */ // context = pk11_createdigestcontext(sec_oid_md5); context = pk11_createcontextbysymkey(ckm_md5, cka_digest, key, &noparams); if (!context) { cout << "createdigestcontext failed" << endl; goto done; } ...
NSS Sample Code sample4
the db password should be "test" and the cert * nickname should be "testca" * here is one way of doing it: * # create ca cert db, if -f not provided, prompts for passwd * $ certutil -n -d .
... * * this example does not do any padding.
NSS sources building testing
any c function that isn't contained in .def files is strictly for private use within nss, and applications and test tools are not allowed to call them.
...the results directory ends up next to the nss directory, not within it).
NSS Tools sslstrength
however, the port number is an optional argument, and if not given, will default to the https port (443).
... policy will default to domestic if not specified.
PKCS11 module installation
note: the information in this article is specific to firefox 3.5 and newer.
...note: there is currently a bug in firefox where international characters may cause problems.
Sample manual installation
the nss build system does not include a target to install header files and shared libraries in the system directories, so this needs to be done manually.
...if the destination directories are not what's standard for the system (e.g.
FC_GetFunctionStatus
description fc_getfunctionstatus is a legacy function that simply returns ckr_function_not_parallel.
... return value fc_getfunctionstatus always returns ckr_function_not_parallel.
FC_InitPIN
the module only allows the pkcs #11 so to log in if the normal user's pin has not yet been set or has been reset.
... ckr_user_not_logged_in: the session is not in the "r/w so functions" state.
FC_Initialize
ckr_cant_lock: the ckf_os_locking_ok flag is not set in pinitargs->flags.
...(note: we probably should return ckr_host_memory instead.) the software integrity test or power-up self-tests failed.
FC_WaitForSlotEvent
description this function is not supported by the nss cryptographic module.
... return value fc_waitforslotevent always returns ckr_function_not_supported.
NSS reference
initial notes we are migrating the ssl reference into the format described in the mdn style guide.
... nss environment variables nss cryptographic module nss tech notes nss tech notes nss memory allocation tools based on nss tools documentation.
NSS Tools
source, documentation, dbck 1.0 analyze and repair certificate databases (not working in nss 3.2) source, tasks/plans modutil 1.1 manage the database of pkcs11 modules (secmod.db).
...the ssltap tool does not decrypt data, but it shows things like the type of ssl message (clienthello, serverhello, etc) and connection data (protocol version, cipher suite, etc).
Utility functions
mxr 3.2 and later sec_asn1decode mxr 3.4 and later sec_asn1decodeinteger mxr 3.2 and later sec_asn1decodeitem mxr 3.2 and later sec_asn1decoderabort mxr 3.9 and later sec_asn1decoderclearfilterproc mxr 3.2 and later sec_asn1decoderclearnotifyproc mxr 3.2 and later sec_asn1decoderfinish mxr 3.2 and later sec_asn1decodersetfilterproc mxr 3.2 and later sec_asn1decodersetnotifyproc mxr 3.2 and later sec_asn1decoderstart mxr 3.2 and later sec_asn1decoderupdate mxr 3.2 and later ...
... sec_asn1encode mxr 3.2 and later sec_asn1encodeinteger mxr 3.2 and later sec_asn1encodeitem mxr 3.2 and later sec_asn1encoderabort mxr 3.9 and later sec_asn1encoderclearnotifyproc mxr 3.2 and later sec_asn1encoderclearstreaming mxr 3.2 and later sec_asn1encodercleartakefrombuf mxr 3.2 and later sec_asn1encoderfinish mxr 3.2 and later sec_asn1encodersetnotifyproc mxr 3.2 and later sec_asn1encodersetstreaming mxr 3.2 and later sec_asn1encodersettakefrombuf mxr 3.2 and later sec_asn1enc...
NSS Tools sslstrength
however, the port number is an optional argument, and if not given, will default to the https port (443).
... policy will default to domestic if not specified.
NSS tools : signver
MozillaProjectsNSStoolssignver
if the prefix sql: is not used, then the tool assumes that the given databases are in the old format.
... most applications do not use the shared database by default, but they can be configured to use them.
The Necko HTTP module
notes class overview this document provides an overview of the classes used to implement the http module.
... http cache (v2) describes in detail the api and the implementation details of the content (http, but not only) cache.
Download Rhino
binaries release release date change log download link rhino 1.7r4 2012-06-18 new in rhino 1.7r4 rhino1_7r4.zip rhino 1.7r5 2015-01-29 release notes rhino1_7r5.zip rhino 1.7.6 2015-04-15 release notes rhino1.7.6.zip rhino 1.7.7 2015-06-17 release notes rhino1.7.7.zip rhino 1.7.7.1 2016-02-01 release notes rhino1.7.7.1.zip rhino 1.7.7.2 2017-08-24 release notes rhino1.7.7.2.zip rhino 1.7.8 2018-01-22 release notes rhino1.7.8.zip rhino 1.7.9 2018-03-15 release notes rhino1.7.9.zip rhino 1.7.10 2018-04-09 release notes rhino1.7.10.zip ...
... rhino 1.7.11 2019-05-30 release notes rhino1.7.11.zip rhino 1.7.12 2020-01-13 release notes rhino1.7.12.zip to download older rhino versions, see the rhino downloads archive.
Rhino downloads archive
(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 then download one of the zip files above and unzip it.
Rhino serialization
exceptions will be thrown if foo or foo.prototype cannot be found the scopes used in either scriptableoutputstream or scriptableinputstream.
...however, you can run into problems with serialization of compiled functions and scripts: $ cat test.jsfunction f() { return 3; } serialize(f, "f.ser"); g = deserialize("f.ser"); print(g()); $ java org.mozilla.javascript.tools.shell.main -opt -1test.js 3 $ java org.mozilla.javascript.tools.shell.main test.js js: uncaught javascript exception: java.lang.classnotfoundexception:c1 the problem is that java serialization has no built-in way to serialize java classes themselves.
How to embed the JavaScript engine
on windows, do not install the spidermonkey source code under the msys root directory (which is usually c:\mozilla-build\msys).
...and say: ok = js_definefunctions(cx, global, my_functions); how to call javascript functions from c first, create arguments for the call, here i create arguments with 2 items: // [spidermonkey 24] js::autovaluearray is not defined.
INT_TO_JSVAL
before spidermonkey 1.8.5, not all integers can be stored in a jsval; use int_fits_in_jsval to test.
... starting in spidermonkey 1.8.5, jsval can store a full 32-bit integer, so this check isn't needed any longer for 32-bit integers.") }} if i does not fit into a jsval (see int_fits_in_jsval), the behavior is undefined.
JS::Add*Root
(for example, it must not be an uninitialized local variable.
...note that this means that if the root is meant to live past the end of a function, the address of a local (stack-based) variable may not be used for vp/rp.
JS::DoubleNaNValue
this article covers features introduced in spidermonkey 24 create a not-a-number (nan) floating-point number as a value of type js::value.
... syntax js::value js::doublenanvalue() description js::doublenanvalue returns a value of type js::value that represents an ieee floating-point quiet not-a-number (nan).
JS::NewFunctionFromSpec
unlike js_definefunctions, this does not treat fs as an array.
... *fs must not be js_fs_end.
JS::PropertySpecNameToPermanentId
this article covers features introduced in spidermonkey 38 create a jsid that does not need to be marked for gc.
... description js::propertyspecnametopermanentid creates a jsid that does not need to be marked for gc from jspropertyspec::name or jsfunctionspec::name.
JS::SetOutOfMemoryCallback
added in spidermonkey 38 description unlike the error reporter, which is only called if the exception for an oom bubbles up and is not caught, the js::outofmemorycallback is called immediately at the oom site to allow the embedding to capture the current state of heap allocation before anything is freed.
... if the large-allocation-failure callback is called at all (not all allocation sites call the large-allocation-failure callback on failure), it is called before the out-of-memory callback; the out-of-memory callback is only called if the allocation still fails after the large-allocation-failure callback has returned.
JS::SourceBufferHolder
this not only groups the buffer and length values, it also provides a way to optionally pass ownership of the buffer to the js engine without copying.
... if ownership is not given to the sourcebufferholder, then the memory must be kept alive until the js compilation is complete.
JSClass.call
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!
JSConvertOp
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.
JSEnumerateOp
it should define any remaining lazy properties that should be enumerable but are not yet defined in obj.
... this hook does not implement iteration: once the properties are defined, the javascript engine can enumerate them.
JSNative
the callback does not need to call js_beginrequest()).
...this causes the function not to appear on the stack in javascript debuggers.
JSObjectOps.defaultValue
jsobjectops is not a supported api.
...this documentation should be considered spidermonkey internals documentation, not api documentation.
JSObjectOps.defineProperty
jsobjectops is not a supported api.
...this documentation should be considered spidermonkey internals documentation, not api documentation.
JSObjectOps.destroyObjectMap
jsobjectops is not a supported api.
...this documentation should be considered spidermonkey internals documentation, not api documentation.
JSObjectOps.enumerate
jsobjectops is not a supported api.
...this documentation should be considered spidermonkey internals documentation, not api documentation.
JSObjectOps.getAttributes
jsobjectops is not a supported api.
...this documentation should be considered spidermonkey internals documentation, not api documentation.
JSObjectOps.getProperty
jsobjectops is not a supported api.
...this documentation should be considered spidermonkey internals documentation, not api documentation.
JSObjectOps.setProto
jsobjectops is not a supported api.
...this documentation should be considered spidermonkey internals documentation, not api documentation.
JSPrincipals
obsolete since jsapi 13 methods name description void dump() this is not defined by the js engine but should be provided by the embedding.
...these functions ensure that the given jsprincipals object is indelibly associated not only with the script being compiled or evaluated, but with all functions ever created by that script or code eval()-ed by it.
JSVAL_TO_GCTHING
applications should not call it directly in most cases.
...another possible alternative is to avoid casting altogether by using an api that operates on jsvals rather than raw pointers (for example, js_call_value_tracer rather than js_call_tracer).
JSVAL_TO_INT
note that although jsval is an integer type, it must be treated as opaque.
... the jsval encoding of the integer 4, for instance, is not ((jsval) 4) but some other pattern of bits.
JSVAL_TO_OBJECT
this function is not type-safe: if v is not an object or jsval_null, the behavior is undefined.
... to convert a value to an object, use the js_valuetoobject function, which has well-defined behavior even when the argument is not an object or null.
JSVAL_TRUE
take care not to confuse the jsval constants jsval_true and jsval_false with the bool constants true and false.
... jsval values must not be used as c true/false values; there is no guarantee that the c bit-pattern of any particular jsval is zero or nonzero.
JS_AddFinalizeCallback
the collector will not yield to the mutator before calling the callback with jsfinalize_group_end status.
...weak references to unmarked things have been removed and things that are not swept incrementally have been finalized at this point.
JS_ClearPendingException
(there is a pending exception if the most recently thrown exception in cx has not yet been caught or cleared.) when any jsapi call fails with an exception, the caller must either use js_clearpendingexception to catch the exception; or return false to allow the exception to propagate to the caller.
... note that a jsapi failure does not necessarily indicate that an exception is pending.
JS_ConstructObject
a less-preferred short-term solution might be to use this reimplementation of the method, but note that this reimplementation is not guaranteed to continue working across spidermonkey releases.
...the caller does not need to ensure that the array elements are rooted.
JS_DecompileFunction
if you decompile a function that does not make a native c call, then the text created by js_decompilefunction is a complete function declaration suitable for re-parsing.
... if you decompile a function that makes a native c call, the body of the function contains the text "native code'" and cannot be re-parsed.
JS_DecompileScript
if the script is not cached, it tries to load the source from file, and returns nullptr if an error happened while loading.
... from spidermonkey 17, this does not actually decompile the script, but returns the original source code (bug 761723).
JS_DefaultValue
do not pass any other type.
...objects with classes defined by ecmascript itself all use the [[defaultvalue]] algorithm specified in §8.12.8 (but note the algorithm's special case for date objects).
JS_DumpNamedRoots
this may not be null.
...the javascript engine does not read from or write to this pointer at all.
JS_Enumerate
(the term own property refers to a property that is not inherited from the object's prototype.) this is not quite the same behavior as a javascript for...in loop, which converts all property ids to strings and also enumerates inherited properties.
...therefore a program that loops over the property ids must either root them all, ensure that the properties are not deleted (in a multithreaded program this requires even greater care), or ensure that garbage collection does not occur.
JS_ForgetLocalRoot
it must not be null.
...if the caller is not in any local root scope, js_forgetlocalroot has no effect.
JS_GET_CLASS
note: in spidermonkey versions prior to spidermonkey 1.8.8, js_getclass took both a jscontext* and a jsobject* as arguments in thread-safe builds, and in non-thread-safe builds it took only a jsobject*.
... newer versions have removed the context argument, so that the same signature is used regardless whether or not the build is thread-safe.
JS_GetFunctionArity
this is the same as the function object's arity property, if that property has not been overwritten.
... note that it is not an error per se to call a javascript function with more or fewer actual arguments than its arity.
JS_GetFunctionObject
in other cases, the object returned by js_getfunctionobject is not necessarily safe to call and should not be exposed to script.
...in these cases, this function should not be called.
JS_GetLatin1FlatStringChars
syntax const js::latin1char * js_getlatin1flatstringchars(const js::autocheckcannotgc &nogc, jsflatstring *str); const char16_t * js_gettwobyteflatstringchars(const js::autocheckcannotgc &nogc, jsflatstring *str); name type description cx jscontext * a context.
... nogc js::autocheckcannotgc &amp; a reference to js::autocheckcannotgc.
JS_GetLatin1InternedStringChars
syntax const js::latin1char * js_getlatin1internedstringchars(const js::autocheckcannotgc &nogc, jsstring *str); const char16_t * js_gettwobyteinternedstringchars(const js::autocheckcannotgc &nogc, jsstring *str); name type description cx jscontext * a context.
... nogc js::autocheckcannotgc &amp; a reference to js::autocheckcannotgc.
JS_GetLatin1StringCharsAndLength
syntax const js::latin1char * js_getlatin1stringcharsandlength(jscontext *cx, const js::autocheckcannotgc &nogc, jsstring *str, size_t *length); const char16_t * js_gettwobytestringcharsandlength(jscontext *cx, const js::autocheckcannotgc &nogc, jsstring *str, size_t *length); name type description cx jscontext * a context.
... nogc js::autocheckcannotgc &amp; a reference to js::autocheckcannotgc.
JS_GetPropertyAttributes
if no error occurs, *foundp receives js_true if the specified property is found and js_false if it is not found.
... if obj does not have the specified property, or if it inherits it from some other object (on its prototype chain, for example), then *foundp is set to js_false.
JS_GetSecurityCallbacks
use null is not needed.
...use null is not needed.
JS_GetStringLength
this is the same as the length of the array returned by js_getstringchars, in char16_ts (not bytes).
... because some unicode characters are represented using two 16-bit code units, the result is not necessarily the same as the number of unicode characters in the string.
JS_IsConstructing
many constructors do not need to call it either.
... in the common case where a constructor should have the same behavior (creating a new object) whether it is called with the new keyword or not, it does not need to call js_isconstructing.
JS_IsExceptionPending
description js_isexceptionpending returns true if an exception has been thrown in the context cx and the exception has not yet been caught or cleared.
... otherwise, it returns false this can be used from jsnative functions which call js code to determine if the called js code threw an exception or not.
JS_MaybeGC
in both cases, frequent calls js_maybegc are safe and will not cause the application to spend a lot of time doing redundant garbage collection work.
... implementation note: spidermonkey 1.8 and earlier determine whether garbage collection is appropriate by analyzing statistics about the gc heap and memory usage since the last garbage collection cycle.
JS_NewDependentString
the characters are not copied.
...(implementation note: because of this sharing, the garbage collector will not collect str as long as the new substring is reachable.) on success, js_newdependentstring returns a pointer to the new string.
JS_NewExternalString
(ultimately, the string will be garbage collected, and the javascript engine will call the string finalizer callback, allowing the application to free the array.) the array does not need to be zero-terminated.
...obsolete since jsapi 13 description js_newexternalstring and js_newexternalstringwithclosure create a new jsstring whose characters are stored in external memory, i.e., memory allocated by the application, not the javascript engine.
JS_NewObject
added in spidermonkey 1.8.1 clasp->flags must not have the jsclass_global_flags bits set (use js_newglobalobject instead).
... if the context is not currently executing any code, we use js_getglobalobject to find a global object associated with the context.
JS_NewPropertyIterator
note also that while for..in includes properties inherited from prototypes, iterator objects do not.) on success, this returns an iterator object that can be passed to js_nextproperty to fetch the property ids.
...the iterator object created by this function is not a javascript iterator.
JS_NewUCString
note: js_newstring() was removed in spidermonkey 1.8.5.
...the application must not read, write, or free the buffer.
JS_ObjectIsFunction
this must not be null.
...note that the result may be false even for some callable objects, such as regular expression objects or proxy objects see also mxr id search for js_objectisfunction js_valuetofunction js_objectisfunction ...
JS_PutEscapedString
returns the length of the written output, not including the nul.
...if quote is not 0, it must be a single or double quote character that will quote the output.
JS_ResolveStandardClass
if id does not name a standard class or a top-level property induced by initializing a standard class, store false in *resolved and just return true.
...the class's enumerate op should call js_enumeratestandardclasses(cx, obj), to define eagerly during for...in loops any classes not yet resolved lazily.
JS_SetAllNonReservedSlotsToUndefined
note: this is done for all slots, regardless of the associated property descriptor.
...properties belonging to objects on obj's prototype chain are not affected.
JS_SetArrayLength
this is true even if obj is not an array object.
...setting the number of array elements does not initialize those elements.
JS_SetContextCallback
for future compatibility the callback must do nothing and return true if any other value is passed.
...in this case the callback is not called again.
JS_SetPrototype
ordinarily you set a prototype for an object when you create the object with js_newobject, but if you do not set a prototype at that time, you can later call js_setprototype to do so.
...take care not to create a circularly-linked list of prototypes using this function, because such a set of prototypes cannot be resolved by the javascript engine and can easily lead to an infinite loop.
JS_SuspendRequest
since then, a jsruntime is tied to the thread that created it; it may not be accessed by any other thread.
...in spidermonkey 1.8 and later, these functions will be present, but will do nothing, in non-js_threadsafe builds.
jsdouble
arithmetic on jsdouble values in c should behave exactly like the floating-point arithmetic in javascript, except that c and javascript may treat not-a-number values differently.
... implementation note: spidermonkey has had several bugs involving details of floating-point arithmetic on various platforms.
Running Parsemark
the test files are not checked into the source tree because they're non-mozilla js code.
...a typical run can be done like so: cd js/src/tests python parsemark.py /path/to/baseline/js /path/to/parse-tests-dir/ -q > /tmp/baseline.json python parsemark.py /path/to/current/js /path/to/parse-tests-dir/ -q > /tmp/current.json python compare_bench.py /tmp/current.json /tmp/baseline.json note: unfortunately the comparisons done are very noisy and not reliable!
TPS Formdata Lists
for example: var formdata1 = [ { fieldname: "testing", value: "success", date: -1 }, { fieldname: "testing", value: "failure", date: -2 }, { fieldname: "username", value: "joe" } ]; formdata lists and phase actions you can use the following functions in phase actions for formdata lists: formdata.add formdata.delete formdata.verify formdata.verifynot for an example, see the tps formdata unittest: http://hg.mozilla.org/services/tps/f...st_formdata.js notes note 1, tps supports the delete action for formdata, but sync currently does not correctly sync deleted form data, see bug 564296.
... note 2, sync currently does not sync formdata dates, so the date field is ignored when performing verify and verify-not actions.
TPS Tab Lists
for example: var tabs1 = [ { uri: "http://hg.mozilla.org/automation/crossweave/raw-file/2d9aca9585b6/pages/page1.html", title: "crossweave test page 1", profile: "profile1" }, { uri: "data:text/html,<html><head><title>hello</title></head><body>hello</body></html>", title: "hello", profile: "profile1" } ]; tab lists and phase actions tabs cannot be modified or deleted, only added or verified with the following functions: tabs.add - opens the specified tabs in the browser window.
... tabs.verifynot - verifies that the specified tabs cannot be found in the specified profile.
Zest usecase: Reporting Security Vulnerabilities to Developers
also security teams often use tools which the developers do not have access to or have no experience with.
... the developer adjusts the script to match their local environment they run the script and see the vulnerability they fix the vulnerability they rerun the script to check that the vulnerability is fixed the fix is applied to the system that the security team is testing the security team rerun the script as an initial check they then perform any manual testing they think is necessary note that the developers could also include the script in the regression tests to make sure that it doesnt reoccur.
Zest
the language is written in json, but we do not expect people to write zest in this format - it is designed to be a visual language.
... the core language does not define any graphical representation - that is expected to be defined by the tools that integrate zest.
ROLE_ALERT
« gecko roles page represents an alert or a condition that a user should be notified about.
... used by aria: alert, alertdialog xul: <notification/>, <panel noautofocus = "true"/> ...
Implementation Details
for interested at api: gecko msaa ia2 at-spi text attributes refer to specific pages to get information of supported text attributes for interested at api: gecko msaa - doesn't have a way to expose text attributes, use ia2 ia2 at-spi document attributes refer to specific pages to get information of supported document attributes for interested at api: gecko/msaa/ia2 - document attributes are not exposed.
...unsupported features we do not support some at apis features.
Places Expiration
this ensures to not interfere with standby tasks and preserves battery on mobile.
... on shutdown most of the times the adaptive algorithm will ensure the database is clean before shutdown, so the only task executed on shutdown will be removal of session data (like session annotations).
Using the Places livemark service
determine whether a folder is a livemark you can use the nsilivemarkservice.islivemark() method to determine whether or not a given folder is a livemark container: if (livemarkservice.islivemark(folderid)) { // it's a livemark } else { // it's not a livemark } accessing the container's site uri the nsilivemarkservice.getsiteuri() method lets you obtain the nsiuri of the website associated with a livemark container.
...note: the caller is responsible for reloading the livemark after changing its feed uri (since the contents are likely to be different given a different feed).
Places
it also includes new features including favicon storage and the ability to annotate pages with arbitrary information.
... using the places annotation service how to work with the annotation service.
extIApplication
not available anymore on gecko 2.0 (see [1]), use getextensions() instead obsolete since gecko 2.0 prefs readonly attribute extipreferencebranch the preferences object for the application.
... xpcom although the application object is preloaded into xul scripts, it is not preloaded into javascript xpcom code.
Binary compatibility
if mozilla decides to upgrade to a compiler that does not have the same abi as the current version, any built component may fail.
...when you see a @status frozen, note that this means it should work as long as the component and xpcom are built with the same compiler abi.
Bundling multiple binary components
the real components are not in the "components" folder, but are in a side folder ("libraries" in the sample).
... 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.
Inheriting from implementation classes
that's not inherently multiple inheritance, though, because you only mix in interfaces (i.e.
... the problem would not exist with java's interfaces).
Components.interfaces
each object represents one of the xpcom interfaces -- that some component or another might or might not implement.
...xpidl) may not only contain method declarations, but also constants.
Components.results
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() { /* ...
Components.utils.evalInSandbox
note: it's not safe to use evalinsandbox() to evaluate json strings; instead, use the techniques discussed in the article on json.
...mysandbox.double = double; var result = components.utils.evalinsandbox("x = y + 2; double(x) + 3", mysandbox); console.log(result); // 17 console.log(mysandbox.x); // 7 operations on objects you insert into this sandbox global scope do not carry privileges into the sandbox: mysandbox.foo = components; // this will give a "permission denied" error components.utils.evalinsandbox("foo.classes", mysandbox); optional arguments you can optionally specify the js version, filename, and line number of the code being evaluated.
Components.utils.evalInWindow
the result is structured cloned back to the original context, unless it is native (for example, if it returns a dom node, this is not structured cloned, because the original context will see that through an xraywrapper already), so it's guaranteed to behave predictably.
...w(): // add-on-script.js var result = components.utils.evalinwindow("somelocalvariable", contentwindow); console.log(result); // {"name":"selection1","node":{}} the add-on code can modify the variable as well, of course: // add-on-script.js components.utils.evalinwindow("somelocalvariable.newprop = 42", contentwindow); // page-script.js console.log(window.somelocalvariable.newprop); // 42 but note that the add-on script must trust that the page script has not redefined the setter on somelocalvariable: unlike xraywrappers, evalinwindow() does not provide x-ray vision.
Components.utils.isXrayWrapper
any expando properties are not visible, and if any native properties have been redefined, this has no effect.
... use this function to determine whether a given object is an xray or not.
Components.utils
isxraywrapper() test whether a given object is an xray or not.
...this lets you specify a callback so you can be notified once the garbage collection cycle has been performed.
Components.utils.reportError
if it is not a javascript error object, the parameter is converted to a string and reported as a new error.
... function mydump(amessage) { var consoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice); consoleservice.logstringmessage("my component: " + amessage); } firefox 3: the error console will not display chrome errors by default.
xpcshell
(however, it might not be there if you have a non-debug version of firefox, mozilla, thunderbird, etc.) $ cd /opt/mozilla $ ./run-mozilla.sh ./xpcshell js> execute xpcshell from window the built xpcshell.exe can't be executed under the mozilla build shell(bash).
... it should be executed under the window command prompt source_directory/obj-xxxxx/dist/bin> xpcshell.exe using the latest version of javascript at present, xpcshell doesn't use the latest version of javascript, so newer language features, such as the let statement introduced in javascript 1.7, are not available.
NS_InitXPCOM2
you may pass null if you are not interested in this return value.
...some of the possible errors are documented below: ns_error_not_initialized indicates that static globals were not yet initialized, which may happen if this method is called before xpcom's static initialization code executes.
NS_InitXPCOM3
you may pass null if you are not interested in this return value.
...some of the possible errors are documented below: ns_error_not_initialized indicates that static globals were not yet initialized, which may happen if this method is called before xpcom's static initialization code executes.
NS_NewLocalFile
this path does not need to reference an existing file.
... example code // create a local file that references c:\foo.txt nsresult rv; nscomptr<nsilocalfile> file; rv = ns_newlocalfile(nsembedstring(l"c:\\foo.txt"), pr_false, getter_addrefs(file)); if (ns_failed(rv)) return rv; note: gcc requires the -fshort-wchar option to compile this example since prunichar is an unsigned short.
nsresult
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.
nsACString
length the length function returns the number of storage units in the string's internal buffer (not including the null-terminator if present).
...nsacstring by itself does not imply a particular character encoding.
nsAString
length the length function returns the number of storage units in the string's internal buffer (not including the null-terminator if present).
...nsastring by itself does not imply a particular character encoding.
nsDependentCSubstring
the caller must not modify the characters at the returned address.
... the caller may modify the characters at the returned address (up to but not exceeding the length of the string).
nsDependentSubstring
the caller must not modify the characters at the returned address.
... the caller may modify the characters at the returned address (up to but not exceeding the length of the string).
amIInstallCallback
toolkit/mozapps/extensions/amiinstalltrigger.idlscriptable a callback function that web pages can implement to be notified when triggered installs complete.
...astatus 0 if the install was successful or negative if not.
amIWebInstaller
window, in nsiuri areferer, [array, size_is(ainstallcount)] in wstring auris, [array, size_is(ainstallcount)] in wstring ahashes, [array, size_is(ainstallcount)] in wstring anames, [array, size_is(ainstallcount)] in wstring aicons, [optional] in amiinstallcallback acallback, [optional] in pruint32 ainstallcount); boolean isinstallenabled(in astring amimetype, in nsiuri areferer); note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindow.
... acallback optional an optional callback to notify about installation success and failure.
imgIEncoder
1.9 void endimageencode(); void initfromdata([array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 inputformat, in astring outputoptions); void startimageencode(in pruint32 width, in pruint32 height, in pruint32 inputformat, in astring outputoptions); constants possible values for input format (note that not all image formats support saving alpha channels): constant value description input_format_rgb 0 input is rgb each pixel is represented by three bytes: r, g, and b (in that order, regardless of host endianness) input_format_rgba 1 input is rgb each pixel is represented by four bytes: r, g, and b (in that order, regardless of host endianness).
... post-multiplied alpha us used (for example 50% transparent red is 0xff000080) input_format_hostargb 2 input is host-endian argb: on big-endian machines each pixel is therefore argb, and for little-endian machiens (intel) each pixel is bgra (this is used by canvas to match it's internal representation) pre-multiplied alpha is used (that is, 50% transparent red is 0x80800000, not 0x80ff0000) possible values for outputoptions.
mozIStorageError
nolfs 22 attempted to use os features not supported on the host system.
... notadb 26 the opened file is not a database.
mozIStoragePendingStatement
note: for read statements, such as select, once you cancel the statement, you will receive no further notifications about results.
...return value in versions of gecko prior to gecko 1.9.2, this returned a boolean value that was true if the query was canceled successfully or false if not.
mozIStorageStatementWrapper
firefox 3.5 note firefox 3.5 adds support for these features directly into the mozistoragestatement interface, so this interface is essentially deprecated.
... params mozistoragestatementparams the parameters; these can be set in lieu of using the call notation on this.
mozIStorageVacuumParticipant
note: if the database is using the wal journal node and the current page size is not the expected one, the journal node will be changed to truncate because wal doesn't allow page size changes.
...once you receive this notification, you should avoid using the database until onendvacuum() is called.
mozIStorageValueArray
note: c++ callers should be aware that a string value for a null column has isvoid set to distinguish it from an empty string.
... note: c++ callers should be aware that a string value for a null column has isvoid set to distinguish it from an empty string.
nsIApplicationUpdateService
this depends on whether or not the current user has the necessary access privileges for the install directory.
...void adddownloadlistener( in nsirequestobserver listener ); parameters listener an object implementing nsirequestobserver and optionally nsiprogresseventsink that will be notified of state and progress information as the update is downloaded.
nsIBadCertListener2
method overview boolean notifycertproblem(in nsiinterfacerequestor socketinfo, in nsisslstatus status, in autf8string targetsite); methods notifycertproblem() called in case of a broken ssl status.
... boolean notifycertproblem( in nsiinterfacerequestor socketinfo, in nsisslstatus status, in autf8string targetsite ); parameters socketinfo a network communication context that can be used to obtain more information about the active connection.
nsIClipboardDragDropHookList
inherits from: nsisupports last changed in gecko 1.7 note: this interface is not intended for direct use by embedders; it is an implementation detail.
...note: if this implementation is not present in the list then removal will be ignored.
nsIClipboardOwner
the nsiclipboardowner interface notifies the clipboard owner about the current status of ownership of the clipboard transferable at given situation and time.
... 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.
nsIContentSniffer
note: implementations should consider the request read-only.
... especially, they should not attempt to set the content type property that subclasses of nsirequest might offer.
nsIContentView
note: currently, only <frame> and <iframe> elements are handled as content views.
... note: when this view becomes inactive, the new content view will have scroll values that are reset to the default.
nsIDNSRecord
hasmore() this method checks if there is another address in the record.
...return value true if there is another address in the record.
nsIDOMGeoGeolocation
you can request a single notification of the user's current position, or you can monitor the position over time.
...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/geolocation;1"] .getservice(components.interfaces.nsisupports); method overview void clearwatch(in unsigned short watchid); void getcurrentposition(in nsidomgeopositioncallback successcallback, [op...
nsIDOMHTMLTimeRanges
exceptions thrown index_size_err the specified index is not valid.
...exceptions thrown index_size_err the specified index is not valid.
nsIDOMOrientationEvent
canbubblearg specifies whether or not the created event will bubble.
... cancelablearg specifies whether or not the created event can be canceled.
nsIDOMStorage
keys are stored in a particular order with the condition that this order not change by merely changing the value associated with a key, but the order may change when a key is added or removed.
...if the key does not already exist, a new key is added, associated with the specified value.
nsIDOMStorageEventObsolete
dom/interfaces/storage/nsidomstorageeventobsolete.idlscriptable this interface represents an event that occurs to notify interested parties about changes to the contents of a dom storage space; it is used for both session storage and local storage.
... note: this interface describes the old, non-standard form of this event.
nsIDeviceMotion
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).
... 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.
nsIDownloader
void init( in nsidownloadobserver observer, in nsifile downloadlocation ); parameters observer the nsidownloadobserver to be notified when the download completes.
...if an explicit download location is specified then the resulting file will not be deleted, and it will be the callers responsibility to keep track of the file, and so on.
nsIFeedContainer
note: the returned array will contain nsifeedcategory objects, except that interface has not been implemented yet.
...not all feeds have these, but all major feed formats have ids for each entry.
nsIFeedEntry
parent nsifeedcontainer a reference to the entry's parent, which is either a feed (nsifeed or another entry.
...note, that the related updated attribute is available from the nsifeedcontainer interface.
nsIFeedProcessor
you must not call any of the other parsing methods on the nsifeedprocessor interface during an asynchronous parse.
... void parseasync( in nsirequestobserver requestobserver, in nsiuri uri ); parameters requestobserver the observer to be notified when parsing starts and stops.
nsIFileOutputStream
note: using this flag results in the file not being opened during the call to init().
... this means that any errors that might happen when this flag is not set would happen during the first write, and if the file is to be created, it will not appear on the disk until the first write.
nsIFileURL
the url scheme need not be file:, since other local protocols may map urls to files (e.g., resource:).
...note: this constraint might not be enforced at runtime, so beware!
nsIFrameMessageListener
method overview void receivemessage(); methods receivemessage() note: this method is for javascript only.
... sync a boolean value indicating whether or not the message should be handled synchronously.
nsIFrameScriptLoader
it's possible that the frame for this chromemessagesender is not yet available at the time of the loadframescript() call, and if you pass false in this situation, your process script won't be loaded.
...if you want a frame script to do something whenever a new document is loaded, you can listen for the document-element-inserted notification.
nsIJSID
note that for these cases of jsid the specified class or interface must exist and be scriptable.
... methods equals() this method determines if this nsijsid has the same nsid as another nsijsid.
nsILocaleService
note: this has nothing to do with the locale used for localization of the application (ui text strings and so on.).
...note: this has nothing to do with any http user-agent.
nsIMemoryMultiReporter
note: this differs from the behavior of nsimemoryreporter, which lets all fields except amount be accessed without triggering computation.
... note: this is a hack that makes nsimemoryreportermanager.explicit more efficient.
nsIMenuBoxObject
note: for gecko 2.0, the openedwithkey attribute exists on the nsimenuboxobject_mozilla_2_0_branch interface.
... return value true if the event was handled, false if not.
nsIMicrosummary
since generators and pages can be remote resources, and we need them to generate the content, this may not always be available.
... note: this method returns false if either objects don't have a generator removeobserver() remove a microsummary observer from this microsummary.
nsIMsgCompFields
properties attribute type description attachments char * obsolete attachments obsolete, do not use anymore attachmentsarray nsisupportsarray readonly attachvcard prbool bcc astring body astring bodyisasciionly prbool cc astring characterset char * defaultcharacterset char * readonly drafid char * dsn prbool fcc astring fcc2 astring followupto char * forcemsgencoding prbool forceplaintex...
...ps.google.com/forum/#!topic/mozilla.dev.apps.thunderbird/s4ofmm8_b28 priority char * receiptheadertype print32 references char * replyto astring securityinfo nsisupports subject astring templatename astring temporaryfiles char * obsolete temporaryfiles obsolete, do not use anymore to astring usemultipartalternative prbool uuencodeattachments prbool methods utility methods prbool checkcharsetconversion ( out char * fallbackcharset ); nsimsgrecipientarray splitrecipients ( in prunichar * recipients, in prbool emailaddressonly ); void convertbodytoplaintext ( ); ...
nsIMsgSearchTerm
defined in mozilla/ mailnews/ base/ search/ public/ nsimsgsearchterm.idl attributes attrib attribute nsmsgsearchattribvalue attrib; op attribute nsmsgsearchopvalue op; value attribute nsimsgsearchvalue value; booleanand attribute boolean booleanand; arbitraryheader attribute acstring arbitraryheader; hdrproperty /** * not to be confused with arbitraryheader, which is a header in the * rfc822 message.
... this is a property of the nsimsgdbhdr, and may have * nothing to do the message headers, e.g., gloda-id.
nsIMsgThread
void addchild(in nsimsgdbhdr child, in nsimsgdbhdr inreplyto, in boolean threadinthread, in nsidbchangeannouncer announcer); parameters child the message to add inreplyto the message this should be in reply to threadinthread announcer an nsidbchangeannouncer to receive notification when the change is made.
... removechildat() void removechildat(in long index); parameters index the index to remove the message from removechildhdr() void removechildhdr(in nsimsgdbhdr child, in nsidbchangeannouncer announcer); parameters child the message to remove announcer an nsidbchangeannouncer to receive notification when the change is made.
nsINavHistoryResultTreeViewer
nsinavhistoryresultnode nodefortreeindex( in unsigned long aindex ); parameters aindex the row index of the note to return.
...treeindexfornode() returns the row index corresponding to the specified node within the tree, or index_invisible if the tree is unattached or the node is not visible (if, for example, its parent container is collapsed).
nsINavHistoryResultViewObserver
methods candrop() implement this method to report whether or not a drop is permitted onto the specified location.
... warning: do not change the content of the observer list.
nsIParentalControlsService
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.
... atarget optional the location to which the content was saved if it was not blocked.
nsIPrefLocalizedString
this value should not include space for the null terminator, nor should it account for the size of a character.
...note: this makes a copy of the string argument passed in.
nsIPrinterEnumerator
this is not necessarily gecko's default printer; see nsiprintsettingsservice.defaultprintername for that.
... initprintsettingsfromprinter() initializes certain settings from the native printer into the printsettings these settings include, but are not limited to: page orientation, page size, number of copies.
nsIProfile
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.
... profileexists() determine whether or not a profile with the specified name exists.
nsIProfileLock
localdirectory nsilocalfile a directory corresponding to the main profile directory, which exists for the purpose of storing data on the local filesystem, including cache files or other data files that may not represent critical user data.
... (for example, this directory may not be included as part of a backup scheme.) in some cases, this directory may just be the main profile directory.
nsIPushMessage
dom/interfaces/push/nsipushnotifier.idlscriptable a push message sent to a system subscription.
... inherits from: nsisupports last changed in gecko 46.0 (firefox 46.0 / thunderbird 46.0 / seamonkey 2.43) nsipushmessage is the subject of a push-message observer notification.
nsIRequestObserver
note: an exception thrown from onstartrequest has the side-effect of causing the request to be canceled.
...note: an exception thrown from onstoprequest is generally ignored.
nsIScreen
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.
...note: this returns a rectangle representing the region of the screen that is available for application use.
nsIScriptableUnicodeConverter
throws ns_error_uconv_noconv if the requested charset is not supported.
...finish does not need to be called.
nsIServerSocketListener
netwerk/base/public/nsiserversocket.idlscriptable this interface is notified whenever a server socket accepts a new connection.
...the server socket is effectively dead after this notification.
nsISessionStartup
note: prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5), this was a string.
... methods dorestore() determines whether or not there is a session to restore.
nsIStandardURL
ate an instance, use: var standardurl = components.classes["@mozilla.org/network/standard-url;1"] .createinstance(components.interfaces.nsistandardurl); method overview void init(in unsigned long aurltype, in long adefaultport, in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description mutable boolean control whether or not this url can be modified.
... protocol handlers can set this flag before handing out an url to ensure that it is not inadvertently modified.
nsIStreamListener
note: your implementation of this method must read exactly acount bytes of data before returning.
... note: throwing an exception will cancel the request.
nsIStringBundle
do not try to use any other types.
...do not try to use any other types.
nsISupportsPriority
xpcom/threads/nsisupportspriority.idlscriptable this interface exposes the general notion of a scheduled object with an integral priority value.
... 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) this interface does not strictly define what happens when the priority of an object is changed.
nsITaskbarProgress
widget/public/nsitaskbarprogress.idlscriptable starting in windows 7, applications can display a progress notification in the taskbar.
...ns_error_invalid_arg if state is state_no_progress or state_indeterminate, and either currentvalue or maxvalue is not 0.
nsIThreadObserver
note: it is valid to change the thread's observer during a call to this method.
... note: it is valid to change the thread's observer during a call to this method.
nsITimerCallback
inherits from: nsisupports last changed in gecko 1.7 method overview void notify(in nsitimer timer); methods notify() initialize a timer to fire after the given millisecond interval.
...void notify( in nsitimer timer ); parameters timer nsitimer the timer which has expired see also nsitimer nsitimercallbackfunc ...
nsITransaction
transient transactions cannot be undone or redone by the transaction manager.
...a true value indicates that the transactions were merged successfully, a false value if the merge was not possible or failed.
nsITransactionList
note that a null can be returned here if the item is a batch.
...note that currently there is no requirement for a transactionmanager implementation to associate a toplevel nsitransaction with a batch so it is possible for itemisbatch to return true and getitem() to return null.
nsITransportEventSink
inherits from: nsisupports last changed in gecko 1.7 method overview void ontransportstatus(in nsitransport atransport, in nsresult astatus, in unsigned long long aprogress, in unsigned long long aprogressmax); methods ontransportstatus() transport status notification.
... 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.
nsITreeContentView
returns -1 if the item was not found.
...remarks the nsitreecontentview interface only applies to trees with dom element children, and does not apply to trees with flags="dontbuildcontent".
nsIUTF8StringEnumerator
hasmore() reports whether or not the enumerator has any strings that can be returned via getnext().
... this method is generally used to determine whether or not to initiate or continue iteration over the enumerator, athough it can be called without subsequent getnext() calls.
nsIUUIDGenerator
exceptions thrown ns_error_failure if a uuid cannot be generated (for example if an underlying source of randomness is not available) native code only!generateuuidinplace obtain a new uuid like the generateuuid() method, but place it in the provided nsid pointer instead of allocating a new nsid.
... exceptions thrown ns_error_failure if a uuid cannot be generated (for example if an underlying source of randomness is not available) example generating a uuid var uuidgenerator = components.classes["@mozilla.org/uuid-generator;1"] .getservice(components.interfaces.nsiuuidgenerator); var uuid = uuidgenerator.generateuuid(); var uuidstring = uuid.tostring(); ...
nsIUpdateCheckListener
this object is notified as the check continues, finishes and if it has an error.
... onprogress() called every time there is a progress notification loading the update service file.
nsIUpdateChecker
methods checkforupdates() checks for available updates, notifying a listener of the results.
... void checkforupdates( in nsiupdatechecklistener listener, in boolean force ); parameters listener an object implementing nsiupdatechecklistener to be notified of the results of an update check.
nsIUpdatePatch
hashvalue astring the value of the hash function named in hashfunction that should be computed if the file is not corrupt.
...false if another update is selected.
nsIWeakReference
do not hold on to the produced interface permanently; that would defeat the purpose of using a non-owning nsiweakreference in the first place.
...ns_error_no_interface the requested interface is not available.
nsIWebBrowserFind
it does not by default search subframes or iframes.
... note: that you can control whether the search propagates into child or parent frames explicitly using nsiwebbrowserfindinframes, but if one, but not both, of searchsubframes and searchparentframes are set, this returns false.
nsIWebPageDescriptor
docshell/base/nsiwebpagedescriptor.idlscriptable this interface allows content being displayed in one window to be loaded into another window without refetching it from the network.
...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.
nsIWebSocketListener
this is the final notification the listener will receive; once it's been received, the websocket connection is complete.
... this event can be received in error cases even if nsiwebsocketchannel.close() has not been called.
nsIWifiMonitor
void startwatching( in nsiwifilistener alistener ); parameters alistener the nsiwifilistener object to receive notifications when the wifi access point list changes.
...void stopwatching( in nsiwifilistener alistener ); parameters alistener the nsiwifilistener object to stop receiving notifications on.
nsIWinAppHelper
returns true only if all the following conditions 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.
...note that this parameter was never actually supported.
nsIWindowsShellService
g ahkeyconstant, in string asubkeyname, in string avaluename); obsolete since gecko 1.8 void restorefilesettings(in boolean aforallusers); obsolete since gecko 1.9 void shortcutmaintenance(); attributes attribute type description desktopbackgroundcolor unsigned long the desktop background color, visible when no background image is used, or if the background image is centered and does not fill the entire screen.
...void restorefilesettings( in boolean aforallusers ); parameters aforallusers whether or not firefox should restore settings for all users on a multi-user system.
nsIWorker
method overview void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); attributes attribute type description onmessage nsidomeventlistener an object to receive notifications when messages are received on the worker's message port.
...amessageport a message port on which to post the message; if not specified, the default message port is used.
nsIWorkerMessageEvent
acanbubblearg whether or not the event can bubble.
... acancelablearg whether or not the event can be canceled.
nsIXFormsModelElement
note: script invocation is not necessarily equivalent to performing the recalculate action handler.
... though the script is assumed to have modified instance data prior to invoking recalculate, the dom mutations are not cached.
nsIXULRuntime
it may not be available on all platforms, especially unusual processor or compiler combinations.
... may throw ns_error_not_available.
nsIXULTemplateResult
if false, child content is not processed.
...the question mark is considered part of the variable name, thus avar should be ?name and not simply name.
NS_ASSERTION
summary macro throws an assertion failure if the first macro argument does not evaluate to true.
...note on terminology: "assertion" is the condition to test.
XPCOM Interface Reference by grouping
manager nsiframeloader nsiframeloaderowner nsiframemessagelistener nsiframemessagemanager interface nsijsxmlhttprequest jetpack nsijetpack nsijetpackservice offlinestorage nsiapplicationcache nsiapplicationcachechannel nsiapplicationcachecontainer nsiapplicationcachenamespace nsiapplicationcacheservice places nsiannotationobserver rss feed nsifeed nsifeedcontainer nsifeedelementbase nsifeedentry nsifeedgenerator nsifeedperson nsifeedprocessor nsifeedprogresslistener nsifeedresult nsifeedresultlistener nsifeedtextconstruct script mozijssubscriptloader storage mozistoragevacuumparticipant util nsieffectivetldservice work...
... 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 nsiasyncverifyredirectcallback ...
NS_CStringGetData
aterminated [out] this optional result parameter indicates whether or not adata is null-terminated.
... it may be null if the caller is not interested in this information.
NS_CStringGetMutableData
this function does not necessarily null-terminate astring's internal buffer after resizing it.
...the caller is not responsible for writing a null-terminator.
NS_StringAppendData
otherwise, adata need not be null terminated.
... remarks this function is defined inline as a wrapper around ns_stringsetdatarange note: gcc requires the -fshort-wchar option to compile this example since prunichar is an unsigned short.
NS_StringInsertData
otherwise, adata need not be null terminated.
... note: gcc requires the -fshort-wchar option to compile this example since prunichar is an unsigned short.
XPCOM string functions
any memory allocated by a nscstringcontainer instance.ns_cstringcontainerinitthe ns_cstringcontainerinit function initializes a nscstringcontainer instance for use as a nsacstring.ns_cstringcontainerinit2the ns_cstringcontainerinit2 function initializes a nscstringcontainer instance for use as a nsacstring.ns_cstringcopythe ns_cstringcopy function copies the value from one nsacstring instance to another.
...this is a low-level api.ns_stringcopythe ns_stringcopy function copies the value from one nsastring instance to another.
nsMsgViewCommandCheckState
it is (as far as i can tell) not currently used anywhere in thunderbird.
... last changed in gecko 1.9 (firefox 3) constants name value description notused 0 checked 1 unchecked 2 ...
nsMsgViewCommandType
deletenotrash 8 delete the selected message.
... unjunk 28 mark the selected messages as not junk.
Using nsIPasswordManager
i just had to use the password manager for a project i was working on, so i thought i'd braindump my notes to the wiki while i was at it.
... alert(pass.user); // the username alert(pass.password); // the password break; } } catch (ex) { // do something if decrypting the password failed--probably a continue } } note that the user will be prompted for their master password if they have chosen to set one to secure their passwords.
XPCOM tasks
like the standard libraries, xpcom must be a fairly self-contained library, so as not to encumber clients with any unnecessary external dependencies.
... not enough locks.
nsCOMPtr versus RefPtr
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.
xpidl
MozillaTechXPIDLxpidl
it generates: c++ header files (.h), with a commented template for full c++ implementation of the interface xpconnect typelib files (.xpt), with runtime type information to dynamically call xpcom objects through xpconnect note: starting in gecko 9.0, xpidl has been replaced with pyxpidl in the gecko sdk.
...for testing purposes, or one-off interface compilation, xpidl can be run from the command line: usage: ./xpidl -m mode [-w] [-v] [-t version number] [-d filename.pp] [-i path] [-o basename | -e filename.ext] filename.idl -a emit annotations to typelib -w turn on warnings (recommended) -v verbose mode (nyi) -t create a typelib of a specific version number -i add entry to start of include path for ``#include "nsithing.idl" -o use basename (e.g.
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.
... 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).
The Valgrind Test Job
it also works on mac, though sometimes not as well.
... when running locally, you may see errors that do not occur on the test machines.
Filelink Providers
nsimsgcloudfileprovider note: cloudfiles and bigfiles were the two temporary feature names that were used while filelink was under construction.
... note: the setup dialog window should resize itself automatically in order to fit the content of the iframe without scrollbars.
Adding items to the Folder Pane
must persist over sessions text (attribute) the text to display in the tree level (attribute) the level in the tree to display the item at open (rw, attribute) whether or not this container is open children (attribute) an array of child items also conforming to this spec getproperties (function) a call from getrowproperties or getcellproperties for this item will be passed into this function command (function) this function will be called when the item is double-clicked for our example extension, two different types of folder-tree-items will be defined.
... a note about the initial rebuild when thunderbird first starts up, the folder pane does an initial rebuild to get the first data it should display.
Use SQLite
const cc = components.classes; const ci = components.interfaces; var tbirdsqlite = { onload: function() { // initialization code this.initialized = true; this.dbinit(); }, dbconnection: null, dbschema: { tables: { attachments:"id integer primary key, \ name text \ encoded text not null" } }, dbinit: function() { var dirservice = cc["@mozilla.org/file/directory_service;1"].
...service, adbfile) { var dbconnection = adbservice.opendatabase(adbfile); this._dbcreatetables(dbconnection); return dbconnection; }, _dbcreatetables: function(adbconnection) { for(var name in this.dbschema.tables) adbconnection.createtable(name, this.dbschema.tables[name]); }, }; window.addeventlistener("load", function(e) { tbirdsqlite.onload(e); }, false); this is another practical sample on how to handle opendatabase and sql queries on the client side, using in-memory (blob) storage of 2mb: var db = opendatabase('mydb', '1.0', 'test db', 2 * 1024 * 1024); var msg; db.transaction(function (tx) { tx.executesql('create table if not exists logs (id unique, log)'); tx.executesql('insert into logs (id, log) values (1, "foobar")'); tx.executesql('insert into l...
libmime content type handlers
the primary * purpose of these handlers will be to represent the attached data in a * viewable html format that is useful for the user * * note: these will all register by their content 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; } contenttypehandlerinit...
... sample content type handler plugin to see an example of a content type handler plugin, the source for the handler of the content type "text/calendar" can be viewed at the following link: calendar plugin note: this plugin simply creates a blue table in the output stream to identify the fact that it is operational, but the basic constructs of what is needed to build a functional content type handler can be seen.
Using JS in Mozilla code
js language features proper tail calls are not implemented.
... js standard library features feature standard can be used in code new proxy(target, handler) es2015 yes, but getprototypeof and setprototypeof handlers are not yet implemented.
Using the Mozilla source server
the nightly debug builds are now also source indexed so that by following a couple of simple steps you can also have the source code served to you for debugging without a local build what you'll need windbg or visual studio (note: express editions will not work, but windbg is a free download) a nightly build that was created after april 15, 2008; go to the /pub/firefox/nightly/latest-mozilla-central/ folder and grab the installer for builds predating the switch to mercurial, you'll need cvs.exe, added to your path (the cvs.exe from mozillabuild has problems, use this one instead) note: do not use the cvs from mozillabuild, it will not work!
... using the source server in visual studio note: source server support does not work correctly out of the box in visual studio 2005.
Declaring and Using Callbacks
when void is the return type, the javascript callback must not return, or it should return undefined.
...this can all be done in a single line of code, like so: var callback = ctypes.functiontype(...).ptr(function(...) {...}); note: the use of .ptr() here isn't a method call; we're accessing a property that dynamically creates a callable object, and then invoking the result.
Memory Management
this is not an exhaustive list, but will help you to understand memory management and how it affects your use of js-ctypes: a function or static data declared using the declare() method will hold that library alive.
... what won't keep objects alive it's important to note that getting direct access to the contents of a cdata object using address(), addressofelement(), or contents, will result in a cdata object that does not hold its referent alive.
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.
... note: js-ctypes is only available from chrome code; that is, ctypes is not available to websites, only application and extension code.
Plug-in Side Plug-in API - Plugins
npp_newstream notifies a plug-in instance of a new data stream.
... npp_urlnotify notifies the instance of the completion of a url request.
Color vision simulation - Firefox Developer Tools
"color blindness" is a bit of a misnomer, since most people with these disorders can see colors, but do not see all of the distinctions that people with normal color vision can see; color vision deficiencies affect perception across the color spectrum, not only of specific colors like red or green.
... in the simulate menu, you can choose one option at a time from the following list: none — choose this to return to normal display protanomaly (low red) deuteranomaly (low green) tritanomaly (low blue) protanopia (no red) deuteranopia (no green) tritanopia (no blue) contrast loss these simulations are not completely medically accurate.
Add-ons - Firefox Developer Tools
developer tools that are not built into firefox, but ship as separate add-ons.
...it's not as detailed but may help.
Browser Console - Firefox Developer Tools
we see we can not only access the browser console but also web console.
... note: you can restart the browser with the command ctrl + alt + r (windows, linux) or cmd + alt + r (mac) this command restarts the browser with the same tabs open as before the restart.
Examine, modify, and watch variables - Firefox Developer Tools
if a variable exists in the source but has been optimized away by the javascript engine, then it is shown in the variables view, but is given the value (optimized away), and is not editable.
...the watch expression does nothing until you begin to step through your code, so nothing happens until you reach a breakpoint.
Pretty-print a minified file - Firefox Developer Tools
after you click the icon, the source code looks like this: the pretty print source icon is available only if the source file is minified (i.e., not an original file), and is not already "prettified".
... note: if you want to prettify some inline javascript code, just double click the code in the inspector pane.
Aggregate view - Firefox Developer Tools
(no stack available) in the example above you'll note that 7% of the heap is marked "(no stack available)".
... this is because not all heap usage results from your javascript.
Dominators - Firefox Developer Tools
each node in the graph represents an object, and each connection between nodes (edge) represents a reference from one object to another.
... if node b dominates node a, but does not dominate any of a's other dominators, then b is the immediate dominator of a: one slight subtlety here is that if an object a is referenced by two other objects b and c, then neither object is its dominator, because you could remove either b or c from the graph, and a would still be retained by its other referrer.
Network monitor toolbar - Firefox Developer Tools
the network monitor provides two toolbar areas, one above the main section, and another below.
...when you select persist logs, the log is not cleared on page load.
Network Monitor - Firefox Developer Tools
when it first opens, the network monitor does not show request information.
...once the tool is monitoring network requests, the display looks like this: when it is actively monitoring activity, the network monitor records network requests any time the toolbox is open, even if the network monitor itself is not selected.
Edit Shape Paths in CSS - Firefox Developer Tools
to deactivate the shape path editor click on the icon again, or select another element or a different editor.
... note that the shape path editor does not persist between page reloads — if you reload your page you will need to select the element again.
CSS Flexbox Inspector: Examine Flexbox layouts - Firefox Developer Tools
note: the layout view can be found underneath the layout tab on the right-hand pane of the page inspector.
... element: this view shows information about the calculations for the size of the selected flex item: a diagram visualizing the sizing of the flex item content size - the size of the component without any restraints imposed on it by its parent flexibility - how much a flex item grew or shrunk based on its flex-grow value when there is extra free space or its flex-shrink value when there is not enough space minimum size (only appears when an item is clamped to its minimum size) - the minimum content size of a flex item when there is no more free space in the flex container final size - the size of the flex item after all sizing constraints imposed on it have been applied (based on the values of flex-grow, flex-shrink and flex-basis) at the top of the section is a drop-down list of a...
UI Tour - Firefox Developer Tools
note that if you do this, you lose any recordings you have not saved.
... correlating events because these elements are synchronized, you can correlate events in one element with events in another.
Shader Editor - Firefox Developer Tools
note: this tool has been deprecated and will soon be removed from firefox.
... here's another screencast, showing how you can use the shader editor for complex applications (in this case, the unreal engine demo): opening the shader editor the shader editor is disabled by default.
Cookies - Firefox Developer Tools
note: some of the columns are not shown by default — to change the column display, right-click on the existing table headings and use the resulting context menu to show/hide the columns.
...cookies from "test13.example.com" will not be deleted.
IndexedDB - Firefox Developer Tools
note: the data shown in an indexeddb database is a snapshot of the data as it was when you opened the storage inspector tool.
... you can delete an indexeddb database using the context menu in the storage tree: if the database cannot be deleted (most commonly because there are still active connections to the database), a warning message will be displayed in the storage inspector: you can use the context menu in the table widget to delete all items in an object store, or a particular item: ...
Storage Inspector - Firefox Developer Tools
for cookies, the protocol does not differentiate the origin.
...for example, "http://mozilla.org" and "https://mozilla.org" are two different origins so local storage items cannot be shared between them.
Web Console Helpers - Firefox Developer Tools
the resulttype parameter specifies the type of result to return; it can be an xpathresult constant, or a corresponding string: "number", "string", "bool", "node", or "nodes"; if not provided, any_type is used.
...no error is given if the string was not previously blocked.
ANGLE_instanced_arrays.drawArraysInstancedANGLE() - Web APIs
note: when using webgl2, this method is available as gl.drawarraysinstanced() by default.
... exceptions if mode is not one of the accepted values, a gl.invalid_enum error is thrown.
ANGLE_instanced_arrays.drawElementsInstancedANGLE() - Web APIs
note: when using webgl2, this method is available as gl.drawelementsinstanced() by default.
... exceptions if mode is not one of the accepted values, a gl.invalid_enum error is thrown.
AbortSignal - Web APIs
abortsignal.aborted read only a boolean that indicates whether the request(s) the signal is communicating with is/are aborted (true) or not (false).
... }).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror.
AbsoluteOrientationSensor - Web APIs
this is not something that would ever be shown to a user.
... model.quaternion.fromarray(sensor.quaternion).inverse(); }); sensor.addeventlistener('error', error => { if (event.error.name == 'notreadableerror') { console.log("sensor is not available."); } }); sensor.start(); permissions example using orientation sensors requires requesting permissions for multiple device sensors.
AddressErrors.city - Web APIs
syntax var cityerror = addresserrors.city; value if the value specified in the paymentaddress object's city property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
... if the city value was validated successfully, this property is not included in the addresserrors object.
AddressErrors.dependentLocality - Web APIs
syntax var localityerror = addresserrors.dependentlocality; value if the value specified in the paymentaddress object's dependentlocality property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
... if the dependentlocality value was validated successfully, this property is not included in the addresserrors object.
AddressErrors.languageCode - Web APIs
syntax var languageerror = addresserrors.languagecode; value if the value specified in the paymentaddress object's languagecode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
... if the languagecode value was validated successfully, this property is not included in the addresserrors object.
AddressErrors.organization - Web APIs
syntax var organizationerror = addresserrors.organization; value if the value specified in the paymentaddress object's organization property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
... for example, if validation simply ensures that only permitted characters are included in the organization's name, this might return a string such as "the organization name may only contain the letters a-z, digits, spaces, and commas." if the organization value was validated successfully, this property is not included in the addresserrors object.
AddressErrors.phone - Web APIs
syntax var phoneerror = addresserrors.phone; value if the value specified in the paymentaddress object's phone property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
... if the phone value was validated successfully, this property is not included in the addresserrors object.
AddressErrors.postalCode - Web APIs
syntax var postcodeerror = addresserrors.postcode; value if the value specified in the paymentaddress object's postalcode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
... if the postalcode value was validated successfully, this property is not included in the addresserrors object.
AddressErrors.recipient - Web APIs
syntax var recipienterror = addresserrors.recipient; value if the value specified in the paymentaddress object's recipient property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
... if the recipient value was validated successfully, this property is not included in the addresserrors object.
AddressErrors.region - Web APIs
syntax var regionerror = addresserrors.region; value if the value specified in the paymentaddress object's region property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
... if the region value was validated successfully, this property is not included in the addresserrors object.
AddressErrors.sortingCode - Web APIs
syntax var sortingcodeerror = addresserrors.sortingcode; value if the value specified in the paymentaddress object's sortingcode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
... if the sortingcode value was validated successfully, this property is not included in the addresserrors object.
AnalyserNode.smoothingTimeConstant - Web APIs
note: if a value outside the range 0–1 is set, an index_size_err exception is thrown.
...you'll notice that the value changes are much more jarring.
AnalyserNode - Web APIs
the node works even if the output is not connected.
... examples note: see the guide visualizations with web audio api for more information on creating audio visualizations.
Animation.playState - Web APIs
paused the animation was suspended and the animation.currenttime property is not updating.
... finished the animation has reached one of its boundaries and the animation.currenttime property is not updating.
Animation.playbackRate - Web APIs
setting an animation’s playbackrate to 0 effectively pauses the animation (however, its playstate does not necessarily become paused).
...cake.addeventlistener("mousedown", growalice, false); cake.addeventlistener("touchstart", growalice, false); in another example, the red queen's race game, alice and the red queen are constantly slowing down: setinterval( function() { // make sure the playback rate never falls below .4 if (redqueen_alice.playbackrate > .4) { redqueen_alice.playbackrate *= .9; } }, 3000); but clicking or tapping on them causes them to speed up by multiplying their playbackrate: var gofaster = function() { ...
Animation.updatePlaybackRate() - Web APIs
updateplaybackrate() is an asynchronous method that sets the speed of an animation after synchronizing with its current playback position, ensuring that the resulting change in speed does not produce a sharp jump.
... after calling updateplaybackrate() the animation's playbackrate is not immediately updated.
AnimationPlaybackEvent.AnimationPlaybackEvent() - Web APIs
eventinitdict optional an optional eventinit dictionary object containing the following fields: bubbles optional defaults to false, of type boolean, indicating if the event bubbles or not.
... cancelable optional defaults to false, of type boolean, indicating if the event can be canceled or not.
Attr.localName - Web APIs
WebAPIAttrlocalName
html content <button id="example">click me</button> javascript content const element = document.queryselector("#example"); element.addeventlistener("click", function() { const attribute = element.attributes[0]; alert(attribute.localname); }); notes the local name of an attribute is the part of the attribute's qualified name that comes after the colon.
... note: in gecko 1.9.2 and earlier, the property returns the upper-cased version of the local name for html attributes in html doms (as opposed to xhtml attributes in xml doms).
Attr.prefix - Web APIs
WebAPIAttrprefix
<div x:id="example" onclick="console.log(this.attributes[0].prefix)"/> notes this will only work when a namespace-aware parser is used, i.e.
...this will not work for html documents.
AudioContext.close() - Web APIs
closed contexts cannot have new nodes created, but can decode audio data, create buffers, etc.
... this function does not automatically release all audiocontext-created objects, unless other references have been released as well; however, it will forcibly release any system audio resources that might prevent additional audiocontexts from being created and used, suspend the progression of audio time in the audio context, and stop processing audio data.
AudioContext.createMediaElementSource() - Web APIs
note: you can also view this example running live, or view the source.
...document.documentelement.scrolltop : document.body.scrolltop); gainnode.gain.value = cury/height; } // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(gainnode); gainnode.connect(audioctx.destination); note: as a consequence of calling createmediaelementsource(), audio playback from the htmlmediaelement will be re-routed into the processing graph of the audiocontext.
AudioContext.createMediaStreamDestination() - Web APIs
the createmediastreamdestination() method of the audiocontext interface is used to create a new mediastreamaudiodestinationnode object associated with a webrtc mediastream representing an audio stream, which may be stored in a local file or sent to another computer.
... var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); document.queryselector("audio").src = url.createobjecturl(blob); }; </script> </body> </html> note: you can view this example live, or study the source code, on github.
AudioContext.createMediaStreamSource() - Web APIs
note: you can see this example running live, or view the source.
...r); biquadfilter.connect(audioctx.destination); // get new mouse pointer coordinates when mouse is moved // then set new gain value range.oninput = function() { biquadfilter.gain.value = range.value; } }) .catch(function(err) { console.log('the following gum error occured: ' + err); }); } else { console.log('getusermedia not supported on your browser!'); } // dump script to pre element pre.innerhtml = myscript.innerhtml; note: as a consequence of calling createmediastreamsource(), audio playback from the media stream will be re-routed into the processing graph of the audiocontext.
AudioContextOptions - Web APIs
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.
...if not specified, the preferred sample rate for the context's output device is used by default.
AudioParam.exponentialRampToValueAtTime() - Web APIs
note: exponential ramps are considered more useful when changing frequencies or playback rates than linear ramps because of the way the human ear works.
...tion gainnode.gain.setvalueattime(0, audioctx.currenttime); source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick exprampplus.onclick = function() { gainnode.gain.exponentialramptovalueattime(1.0, audioctx.currenttime + 2); } exprampminus.onclick = function() { gainnode.gain.exponentialramptovalueattime(0.01, audioctx.currenttime + 2); } note: a value of 0.01 was used for the value to ramp down to in the last function rather than 0, as an invalid or illegal string error is thrown if 0 is used — the value needs to be positive.
AudioParam.value - Web APIs
WebAPIAudioParamvalue
usage notes value precision and variation the data type used internally to store value is a single-precision (32-bit) floating point number, while javascript uses 64-bit double-precision floating point numbers.
... as a result, the value you read from the value property may not always exactly equal what you set it to.
AudioParamDescriptor - Web APIs
note that this should be done in a separate file.
...parameters['customgain'][i] : parameters['customgain'][0]) // note: a parameter contains an array of 128 values (one value for each of 128 samples), // however it may contain a single value which is to be used for all 128 samples // if no automation is scheduled for the moment.
AudioScheduledSourceNode.stop() - Web APIs
note: if a scheduled stop time occurs before the node's scheduled start time, the node never starts to play.
... return value undefined exceptions invalidstatenode the node has not been started by calling start().
AudioTrackList.onaddtrack - Web APIs
note: you can also add a handler for the addtrack event using addeventlistener().
... usage notes the addtrack event is called whenever a new track is added to the media element whose audio tracks are represented by the audiotracklist object.
AudioWorklet - Web APIs
properties the audioworklet interface does not define any properties of its own, but does inherit properties of worklet.
...the audioworklet interface does not define any methods of its own.
AudioWorkletGlobalScope - Web APIs
note that this should be done in a separate file.
... // current sample-frame and time at the moment of instantiation // to see values change, you can put these two lines in process method console.log(currentframe) console.log(currenttime) } // the process method is required - simply output silence, // which the outputs are already filled with process (inputs, outputs, parameters) { return true } } // the sample rate is not going to change ever, // because it's a read-only property of a baseaudiocontext // and is set only during its instantiation console.log(samplerate) // you can declare any variables and use them in your processors // for example it may be an arraybuffer with a wavetable const usefulvariable = 42 console.log(usefulvariable) registerprocessor('test-processor', testprocessor) next, in our main s...
AudioWorkletNode() - Web APIs
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.
AudioWorkletNode.parameters - Web APIs
note that this should be done in a separate file.
...parameters['customgain'][i] : parameters['customgain'][0]) // note: a parameter contains an array of 128 values (one value for each of 128 samples), // however it may contain a single value which is to be used for all 128 samples // if no automation is scheduled for the moment.
AudioWorkletNode.port - Web APIs
note: the port at the other end of the channel is available under the port property of the processor.
...note that that this should be done in a separate file.
AudioWorkletNodeOptions - Web APIs
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.
AudioWorkletProcessor.port - Web APIs
note: the port at the other end of the channel is available under the port property of the node.
...note that that this should be done in a separate file.
AuthenticatorAssertionResponse - Web APIs
note: this interface is restricted to top-level contexts.
... use from within an <iframe> element will not have any effect.
AuthenticatorAttestationResponse.attestationObject - Web APIs
note that in authenticatorassertionresponse, the authenticatordata is exposed as a property in a javascript object while in authenticatorattestationresponse, the authenticatordata is a property in a cbor map.
...this field is not included when used in the authenticatorassertionresponse.
AuthenticatorResponse.clientDataJSON - Web APIs
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.
BaseAudioContext.createIIRFilter() - Web APIs
this array may have up to 20 members, the first of which must not be zero.
... notsupportederror one or both of the input arrays exceeds 20 members.
BaseAudioContext.createPeriodicWave() - Web APIs
constraints optional an dictionary object that specifies whether normalization should be disabled (if not specified, normalization is enabled by default.) it takes one property: disablenormalization: if set to true, normalization is disabled for the periodic wave.
... a simple way of manually obtaining such coefficients (though not the best) is to use a graphing calculator.
BaseAudioContext.decodeAudioData() - Web APIs
this method only works on complete file data, not fragments of audio file data.
... note: you can run the example live (or view the source.) // define variables var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var source; var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); // use xhr to load an audio track, and // decodeaudiodata ...
BaseAudioContext.sampleRate - Web APIs
this limitation means that sample-rate converters are not supported.
... example note: for a full web audio example implementation, see one of our web audio demos on the mdn github repo, like panner-node.
BaseAudioContext - Web APIs
the sample-rate of an audiocontext cannot be changed.
...this method only works on complete files, not fragments of audio files.
BatteryManager.charging - Web APIs
a boolean value indicating whether or not the device's battery is currently being charged.
... syntax var charging = battery.charging on return, charging indicates whether or not the battery, which is a batterymanager object, is currently being charged; if the battery is charging, this value is true.
Battery Status API - Web APIs
the battery status api, more often referred to as the battery api, provides information about the system's battery charge level and lets you be notified by events that are sent when the battery level or charging status change.
... example in this example, we watch for changes both to the charging status (whether or not we're plugged in and charging) and for changes to the battery level and timing.
Blob - Web APIs
WebAPIBlob
to create a blob that contains a subset of another blob's data, use the slice() method.
...the following code reads the content of a blob as a typed array: const reader = new filereader(); reader.addeventlistener('loadend', () => { // reader.result contains the contents of blob as a typed array }); reader.readasarraybuffer(blob); another way to read content from a blob is to use a response.
BlobEvent - Web APIs
WebAPIBlobEvent
these blobs are typically, but not necessarily, associated with media content.
...note that the timecode in the first produced blobevent does not need to be zero.
Bluetooth.getDevices() - Web APIs
this method does not display any permission prompts.
... note: this method returns a bluetoothdevice for each device the origin is currently allowed to access, even the ones that are out of range or powered off.
BroadcastChannel.close() - Web APIs
this is a necessary step to perform as there is no other way for a browser to know that this channel is not needed anymore.
... note: this feature is available in web workers.
BroadcastChannel.onmessageerror - Web APIs
the onmessageerror event handler of the broadcastchannel interface is an eventlistener, called whenever an messageevent of type messageerror is fired on the broadcastchannel instance — that is, when it receives a message that cannot be deserialized.
... note: this feature is available in web workers.
BroadcastChannel - Web APIs
note: this feature is available in web workers.
... broadcastchannel.onmessageerror an eventhandler called when a messageevent of type messageerror is fired—that is, when it receives a message that cannot be deserialized.
BudgetService.getBudget() - Web APIs
not for use in new websites.deprecated.
... not for use in new websites.
BudgetService.getCost() - Web APIs
not for use in new websites.deprecated.
... not for use in new websites.
BudgetService.reserve() - Web APIs
not for use in new websites.deprecated.
... not for use in new websites.
BudgetService - Web APIs
not for use in new websites.deprecated.
... not for use in new websites.
BudgetState.budgetAt - Web APIs
not for use in new websites.deprecated.
... not for use in new websites.
BudgetState.time - Web APIs
WebAPIBudgetStatetime
not for use in new websites.deprecated.
... not for use in new websites.
BudgetState - Web APIs
not for use in new websites.deprecated.
... not for use in new websites.
CSSNumericValue.to() - Web APIs
the to() method of the cssnumericvalue interface converts a numberic value from one unit to another.
... typeerror indicates that the passed values cannot be summed.
CSSRule.cssText - Web APIs
WebAPICSSRulecssText
note: do not confuse this property with element-style cssstyledeclaration.csstext.
...in other words, attempting to set it does absolutely nothing, and doesn't even omit a warning or error.
CSSStyleRule.selectorText - Web APIs
syntax string = cssrule.selectortext example // for cssrule: body { background-color: darkblue; } var stylesheet = document.stylesheets[0]; alert(stylesheet.cssrules[0].selectortext); // body notes the implementation may have stripped out insignificant whitespace while parsing the selector.
... if set to a selector string which cannot be parsed, a syntaxerror is thrown.
CSSStyleSheet.ownerRule - Web APIs
examples this snippet of code looks for rules which were not imported into the document using an @import at-rule.
... let rulelist = document.stylesheets[0].cssrules; for (let rule of rulelist) { if (!rule.ownerrule) { /* rule is not imported */ } } this snipped obtains a reference to the stylesheet associated with the @import and processes it in some manner: let rulelist = document.stylesheets[0].cssrules; for (let rule of rulelist) { if (rule.ownerrule) { checkstylesheet(rule.ownerrule.stylesheet); } } specifications specification status comment css object model (cssom)the definition of 'cssstylesheet.ownerrule' in that specification.
CSSStyleSheet.rules - Web APIs
note: as a legacy property, you not use rules and should instead use the preferred cssrules.
... while rules is unlikely to be removed soon, its availability is not as widespread and using it will result in compatibility problems for your site or app.
Determining the dimensions of elements - Web APIs
note that all these properties are read-only.
... if you need to know how much space the actual displayed content takes up, including padding but not including the border, margins, or scrollbars, you want to use the element.clientwidth and element.clientheight properties: how big is the content?
CSS Properties and Values API - Web APIs
the css properties and values api — part of the css houdini umbrella of apis — allows developers to explicitly define their css custom properties, allowing for property type checking, default values, and properties that do or do not inherit their value.
... examples the following uses css.registerproperty in javascript to type a css custom properties, --my-color, as a color, give it a default value, and not allow it to inherit its value: window.css.registerproperty({ name: '--my-color', syntax: '<color>', inherits: false, initialvalue: '#c0ffee', }); the same registration can take place in css using the following @property: @property --my-color { syntax: '<color>'; inherits: false; initial-value: #c0ffee; } specifications specification status comment css ...
CSS Typed Object Model API - Web APIs
this not only simplifies css manipulation, but also lessens the negative impact on performance as compared to htmlelement.style.
...otherwise, false cssnumericvalue.to - converts value into another one with the specified unit.
Cache.delete() - Web APIs
WebAPICachedelete
ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching.
...note that this option is ignored by cache.delete().
CacheStorage.has() - Web APIs
WebAPICacheStoragehas
return value a promise that resolves to true if the cache exists or false if not.
...if not then we run some kind of cache set-up function.
CanvasCaptureMediaStreamTrack.requestFrame() - Web APIs
syntax stream.requestframe(); return value undefined usage notes there is currently an issue flagged in the specification pointing out that at this time, no exceptions are being thrown if the canvas isn't origin-clean.
... this may change in the future, so it would be wise to plan ahead and watch for exceptions such as securityerror (although the specific error that might be thrown is not mentioned in the spec, this is a likely candidate).
CanvasRenderingContext2D.closePath() - Web APIs
if the shape has already been closed or has only one point, this function does nothing.
... note: although closepath() is called after all the arcs have been created, only the last arc (sub-path) gets closed.
CanvasRenderingContext2D.createLinearGradient() - Web APIs
note: gradient coordinates are global, i.e., relative to the current coordinate space.
... when applied to a shape, the coordinates are not relative to the shape's coordinates.
CanvasRenderingContext2D.createRadialGradient() - Web APIs
note: gradient coordinates are global, i.e., relative to the current coordinate space.
... when applied to a shape, the coordinates are not relative to the shape's coordinates.
CanvasRenderingContext2D.drawWidgetAsOnScreen() - Web APIs
this api cannot be used by web content.
... specifications not part of any current specification or draft.
CanvasRenderingContext2D.filter - Web APIs
negative values are not allowed.
... <color>: see <color> values for possible keywords and notations.
CanvasRenderingContext2D.getImageData() - Web APIs
this method is not affected by the canvas's transformation matrix.
... note: image data can be painted onto a canvas using the putimagedata() method.
CanvasRenderingContext2D.rect() - Web APIs
like other methods that modify the current path, this method does not directly render anything.
... note: to both create and render a rectangle in one step, use the fillrect() or strokerect() methods.
CanvasRenderingContext2D.scale() - Web APIs
notice that its position on the canvas also changes.
... note that the call to filltext() specifies a negative x coordinate.
CanvasRenderingContext2D.shadowBlur - Web APIs
note: shadows are only drawn if the shadowcolor property is set to a non-transparent value.
...this value doesn't correspond to a number of pixels, and is not affected by the current transformation matrix.
Optimizing canvas - Web APIs
the best case is to not scale the canvas, or have a smaller canvas and scale up rather than a bigger canvas and scale down.
... render screen differences only, not the whole new state.
Transformations - Web APIs
note how the call to fillrect() uses the same coordinates each time, relying on translate() to adjust the drawing position.
... reminder: angles are in radians, not degrees.
ChildNode.remove() - Web APIs
WebAPIChildNoderemove
syntax node.remove(); example using remove() <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <div id="div-03">here is div-03</div> var el = document.getelementbyid('div-02'); el.remove(); // removes the div with the 'div-02' id childnode.remove() is unscopable the remove() method is not scoped into the with statement.
... with(node) { remove(); } // referenceerror: remove is not defined polyfill you can polyfill the remove() method in internet explorer 9 and higher with the following code: // from:https://github.com/jserz/js_piece/blob/master/dom/childnode/remove()/remove().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('remove')) { return; } object.defineproperty(item, 'remove', { configurable: true, enumerable: true, writable: true, value: function remove() { this.parentnode.removechild(this); } }); }); })([element.prototype, characterdata.prototype, documenttype.prototype]); specifications specification status comment domthe definition...
Clients - Web APIs
WebAPIClients
examples the following example shows an existing chat window or creates a new one when the user clicks a notification.
... addeventlistener('notificationclick', event => { event.waituntil(async function() { const allclients = await clients.matchall({ includeuncontrolled: true }); let chatclient; // let's see if we already have a chat window open: for (const client of allclients) { const url = new url(client.url); if (url.pathname == '/chat/') { // excellent, let's use it!
Clipboard.write() - Web APIs
WebAPIClipboardwrite
note: browser support for the asynchronous clipboard apis is still in the process of being implemented.
... example of copying canvas contents to the clipboard function copycanvascontentstoclipboard(canvas, ondone, onerror) { canvas.toblob(function (blob) { let data = [new clipboarditem({ [blob.type]: blob })]; navigator.clipboard.write(data).then(function () { ondone(); }, function (err) { onerror(err); }) }); } note: you can only pass in one clipboard item at a time.
Clipboard.writeText() - Web APIs
note: browser support for the asynchronous clipboard apis is still in the process of being implemented.
...the promise is rejected if the caller does not have permission to write to the clipboard.
Comment - Web APIs
WebAPIComment
the comment interface represents textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view.
...in xml, the character sequence '--' cannot be used within a comment.
CompositionEvent.initCompositionEvent() - Web APIs
canbubblearg a boolean specifying whether or not the event can bubble.
... cancelablearg a boolean shether or not the event can be canceled.
Console.countReset() - Web APIs
note: this feature is available in web workers.
... 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.countreset(); console output will look something like this: "default: 1" "default: 2" "default: 3" "default: 4" "default: 0" note that the call to console.counterreset() resets the value of the default counter to zero.
Console.error() - Web APIs
WebAPIConsoleerror
note: this feature is available in web workers.
... syntax console.error(obj1 [, obj2, ..., objn]); console.error(msg [, subst1, ..., substn]); console.exception(obj1 [, obj2, ..., objn]); console.exception(msg [, subst1, ..., substn]); note: console.exception() is an alias for console.error(); they are functionally identical.
Console.timeEnd() - Web APIs
WebAPIConsoletimeEnd
note: this feature is available in web workers.
... examples console.time("answer time"); alert("click to continue"); console.timelog("answer time"); alert("do a bunch of other stuff..."); console.timeend("answer time"); the output from the example above shows the time taken by the user to dismiss the first alert box, followed by the time it took for the user to dismiss the second alert: notice that the timer's name is displayed when the timer value is logged using timelog() and again when it's stopped.
Console.timeLog() - Web APIs
WebAPIConsoletimeLog
note: this feature is available in web workers.
... examples console.time("answer time"); alert("click to continue"); console.timelog("answer time"); alert("do a bunch of other stuff..."); console.timeend("answer time"); the output from the example above shows the time taken by the user to dismiss the first alert box, followed by the time it took for the user to dismiss the second alert: notice that the timer's name is displayed when the timer value is logged using timelog() and again when it's stopped.
ConvolverNode() - Web APIs
disablenormalization: a boolean controlling whether the impulse response from the buffer will be scaled by an equal-power normalization, or not.
... 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.
ConvolverNode.normalize - Web APIs
the normalize property of the convolvernode interface is a boolean that controls whether the impulse response from the buffer will be scaled by an equal-power normalization when the buffer attribute is set, or not.
...changes to this value do not take effect until the next time the buffer attribute is set.
CrashReportBody - Web APIs
some sample json might look like this: { "type": "crash", "age": 42, "url": "https://example.com/", "user_agent": "mozilla/5.0 (x11; linux x86_64; rv:60.0) gecko/20100101 firefox/60.0", "body": { "reason": "oom" } } note: crash reports are always delivered to the endpoint group named default; there is currently no way to override this.
... if you want to receive other kinds of reports, but not crash reports, make sure to use a different name for the endpoint group that you choose for those reports.
Credential Management API - Web APIs
it does not require it.
... credentialscontainer exposes methods to request credentials and notify the user agent when interesting events occur such as successful sign in or sign out.
CredentialsContainer.get() - Web APIs
unmediated: a boolean indicating the returned credential instance should not require user mediation.
...if a single credential cannot be unambigiously obtained, the promise will resolve to null.
CryptoKey - Web APIs
WebAPICryptoKey
cryptokey.extractable boolean indicating whether or not the key may be extracted using subtlecrypto.exportkey() or subtlecrypto.wrapkey().
... false the key may not be extracted.
DOMImplementation - Web APIs
the domimplementation interface represents an object providing methods which are not dependent on any particular document.
... domimplementation.hasfeature() returns a boolean indicating if a given feature is supported or not.
DOMMatrixReadOnly.flipX() - Web APIs
the original matrix is not modified.
... note that the x co-ordinate of the viewbox attribute is negative, showing us content from both sides of the x-axis.
DOMMatrixReadOnly.translate() - Web APIs
if not supplied, this defaults to 0.
...the original matrix is not modified.
DOMPointReadOnly() - Web APIs
the dompointreadonly() constructor returns a new dompointreadonly object representing a point in 2d or 3d space, optionally with perspective, whose values cannot be altered by script code.
... note: each of these values is what's called an unrestricted number.
DOMTokenList.toggle() - Web APIs
if set to false, then token will only be removed, but not added.
... if set to true, then token will only be added, but not removed.
DOMUserData - Web APIs
note that although it can be an object, in mozilla, it may be returned as a string or other type, if it was set as such a type (e.g., node.setuserdata() and node.getuserdata()).
... domuserdata is not persisted nor serialized and will not be present after the application has restarted or after a crash.
DataTransfer.effectAllowed - Web APIs
the possible values are: none the item may not be dropped.
... uninitialized the default value when the effect has not been set, equivalent to all.
DataTransfer.getData() - Web APIs
if the drag operation does not include data, this method returns an empty string.
...this may result in unexpected behavior, being datatransfer.getdata() not returning an expected value.
DataTransfer.mozItemCount - Web APIs
note: this property is gecko-specific.
... function drop_handler(event) { var files = []; var dt = event.datatransfer; for (var i = 0; i < dt.mozitemcount; i++) files.push(dt.mozgetdataat("application/x-moz-file", i)); } specifications this property is not defined in any web standard.
DataTransfer.mozSetDataAt() - Web APIs
note: this method is gecko-specific.
... function dragstart_handler(event) { var dt = event.datatransfer; var idx = dt.mozitemcount; // add two new items to the drag transfer if (idx >= 0) { dt.mozsetdataat("text/uri-list","http://www.example.com/", idx); dt.mozsetdataat("text/html", "hello world", idx+1); } } specifications this method is not defined in any web standard.
DataTransfer.setData() - Web APIs
if data for the given type does not exist, it is added at the end of the drag data store, such that the last item in the types list will be the new type.
...that is, the order of the types list is not changed when replacing data of the same type.
DataTransferItemList.add() - Web APIs
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.
... recommendation not included in w3c html5 recommendation ...
DataTransferItemList.clear() - Web APIs
while handling drop, the drag data store is in read-only mode, and this method silently does nothing.
... recommendation not included in w3c html5 recommendation ...
DataTransferItemList.length - Web APIs
the drag item list is considered to be disabled if the item list's datatransfer object is not associated with a drag data store.
... recommendation not included in w3c html5 recommendation ...
DedicatedWorkerGlobalScope.onmessageerror - Web APIs
the onmessageerror event handler of the dedicatedworkerglobalscope interface is an eventlistener, called whenever an messageevent of type messageerror is fired on the worker—that is, when it receives a message that cannot be deserialized.
... note: this feature is available in web workers.
Detecting device orientation - Web APIs
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.
... warning: chrome and firefox do not handle the angles the same way, so on some axes the direction are reversed.
DeviceOrientationEvent - Web APIs
warning: currently, firefox and chrome do not handle the coordinates the same way.
... properties deviceorientationevent.absolute read only a boolean that indicates whether or not the device is providing orientation data absolutely.
DisplayMediaStreamConstraints.audio - Web APIs
the displaymediastreamconstraints dictionary's audio property is used to specify whether or not to request that the mediastream containing screen display contents also include an audio track.
... note: the specification for the screen capture api does not define what the contents of the audio track should be.
Document.alinkColor - Web APIs
syntax var color = document.alinkcolor; document.alinkcolor = color; color is a string containing the name of the color (e.g., blue, darkblue, etc.) or the hexadecimal value of the color (e.g., #0000ff) notes the default value for this property in mozilla firefox is red (#ee0000 in hexadecimal).
... another alternative is document.body.alink, although this is deprecated in html 4.01 in favor of the css alternative.
Document: animationiteration event - Web APIs
the animationiteration event is fired when an iteration of a css animation ends, and another one begins.
... this event does not occur at the same time as the animationend event, and therefore does not occur for animations with an animation-iteration-count of one.
Document.bgColor - Web APIs
WebAPIDocumentbgColor
example document.bgcolor = "darkblue"; notes the default value for this property in firefox is white (#ffffff in hexadecimal).
...another alternative is document.body.bgcolor, although this is also deprecated in html 4.01 in favor of the css alternative.
Document.createCDATASection() - Web APIs
example var docu = new domparser().parsefromstring('<xml></xml>', 'application/xml') var cdata = docu.createcdatasection('some <cdata> data & then some'); docu.getelementsbytagname('xml')[0].appendchild(cdata); alert(new xmlserializer().serializetostring(docu)); // displays: <xml><![cdata[some <cdata> data & then some]]></xml> notes this will only work with xml, not html documents (as html documents do not support cdata sections); attempting it on an html document will throw not_supported_err.
... will throw a ns_error_dom_invalid_character_err exception if one tries to submit the closing cdata sequence ("]]>") as part of the data, so unescaped user-provided data cannot be safely used without with this method getting this exception (createtextnode() can often be used in its place).
Document.createDocumentFragment() - Web APIs
usage notes documentfragments are dom node objects which are never part of the main dom tree.
... since the document fragment is in memory and not part of the main dom tree, appending children to it does not cause page reflow (computation of element's position and geometry).
Document.createElementNS() - Web APIs
although this is not an extremely useful xul document, it does demonstrate the use of elements from two different namespaces within a single document: <?xml version="1.0"?> <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml" title="||working with elements||" onload="init()"> <script type="application/javascript"><![cdata[ let conta...
...was constructed dynamically with createelementns and createtextnode then inserted into the document using appendchild."); newdiv.appendchild(txtnode); container.appendchild(newdiv); } ]]></script> <vbox id="containerbox" flex="1"> <html:div> the script on this page will add dynamic content below: </html:div> </vbox> </page> the example given above uses inline script which is not recommended in xhtml documents.
Document.createEvent() - Web APIs
see notes section for details.
...elem.dispatchevent(event); notes event type strings suitable for passing to createevent() are listed in the dom standard — see the table in step 2.
Document.createTouchList() - Web APIs
note: before gecko 25.0, this method was defined on the documenttouch mixin.
...note: firefox also accepts an array of touch objects.
Document.documentURIObject - Web APIs
privileged code must be careful not to try getting or setting this property on a non-wrapped content object (e.g., on a wrappedjsobject of an xpcnativewrapper).
...} specifications not part of any specification.
Document.enableStyleSheetsForSet() - Web APIs
specify an empty string for the name parameter to disable all alternate and preferred style sheets (but not the persistent style sheets; that is, those with no title attribute).
... notes title matches are case-sensitive.
Document.fgColor - Web APIs
WebAPIDocumentfgColor
example document.fgcolor = "white"; document.bgcolor = "darkblue"; notes the default value for this property in mozilla firefox is black (#000000 in hexadecimal).
... another alternative is document.body.text, although this is deprecated in html 4.01 in favor of the css alternative above.
Document.getBoxObjectFor() - Web APIs
note: this method is obsolete.
... example var mydiv = document.getelementbyid("mydiv"), boxobj = document.getboxobjectfor (mydiv); alert ( "x:" + boxobj.x + ", y:" + boxobj.y + ", width:" + boxobj.width + ", height:" + boxobj.height ); notes specified in nsixuldocument.idl ...
Document.getElementsByClassName() - Web APIs
names is a string representing the class name(s) to match; multiple class names are separated by whitespace getelementsbyclassname can be called on any element, not only on the document.
... <html> <body> <div id="parent-id"> <p>hello world 1</p> <p class="test">hello world 2</p> <p>hello world 3</p> <p>hello world 4</p> </div> <script> var parentdom = document.getelementbyid("parent-id"); var test = parentdom.getelementsbyclassname("test"); // a list of matching elements, *not* the element itself console.log(test); //htmlcollection[1] var testtarget = parentdom.getelementsbyclassname("test")[0]; // the first element, as we wanted console.log(testtarget); //<p class="test">hello world 2</p> </script> </body> </html> multiple classes example document.getelementsbyclassname works very similarly to document.queryselector and document.querysel...
Document.getElementsByTagName() - Web APIs
syntax var elements = document.getelementsbytagname(name); elements is a live htmlcollection (but see the note below) of found elements in the order they appear in the tree.
...ext</p> <p>some div2 text</p> </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> notes when called on an html document, getelementsbytagname() lower-cases its argument before proceeding.
Document: keyup event - Web APIs
note: if you're looking for a way to react to changes in an input's value, you should use the input event.
... some changes are not detectable by keyup, for example pasting text from the context menu in a text input.
Document.lastModified - Web APIs
let nlastmodif = date.parse(document.lastmodified); notes note that as a string, lastmodified cannot easily be used for comparing the modification dates of documents.
...= parsefloat(document.cookie.replace(/(?:(?:^|.*;)\s*last_modif\s*\=\s*([^;]*).*$)|^.*$/, "$1")), nlastmodif = date.parse(document.lastmodified); if (isnan(nlastvisit) || nlastmodif > nlastvisit) { document.cookie = "last_modif=" + date.now() + "; expires=fri, 31 dec 9999 23:59:59 gmt; path=" + location.pathname; if (isfinite(nlastvisit)) { alert("this page has been changed!"); } } note: webkit returns the time string in utc; gecko and internet explorer return a time in the local timezone.
Document.location - Web APIs
WebAPIDocumentlocation
the document.location read-only property returns a location object, which contains information about the url of the document and provides methods for changing that url and loading another url.
... if the current document is not in a browsing context, the returned value is null.
Document.mozSyntheticDocument - Web APIs
the document.mozsyntheticdocument property indicates whether or not the document is a synthetic one; that is, a document representing a standalone image, video, audio, or the like.
... var issynthetic = document.mozsyntheticdocument; if (issynthetic) { /* insert your menu item here */ } specifications not part of any specification.
Document.ononline - Web APIs
WebAPIDocumentononline
it is important to note that this event and attribute are inherently unreliable.
...(note: using window.ononline or window.onoffline will not work for compatibility reasons.) by specifying ononline="..." or onoffline="..." attributes on the <body> tag in the html markup.
Document.open() - Web APIs
WebAPIDocumentopen
document.open(); document.write("<p>hello world!</p>"); document.write("<p>i am a fish</p>"); document.write("<p>the number is 42</p>"); document.close(); notes an automatic document.open() call happens when document.write() is called after the page has loaded.
...this is no longer the case.document non-spec'ed parameters to document.open gecko-specific notes starting with gecko 1.9, this method is subject to the same same-origin policy as other properties, and does not work if doing so would change the document's origin.
Document.popupNode - Web APIs
note: starting with gecko 2.0, authors are encouraged to use the menupopup property triggernode instead.
...for other types of popups, the value is not changed.
Document.queryCommandSupported() - Web APIs
the document.querycommandsupported() method reports whether or not the specified editor command is supported by the browser.
... notes the 'paste' command return false not only if the feature is unavailable, but also if the script calling it has insufficient privileges to perform the action [1] example var flg = document.querycommandsupported("selectall"); if(flg) { // ...do something } specifications specification status comment execcommand ...
Document.registerElement() - Web APIs
note: this is an experimental technology.
...it will not be visible if you use the browser's view source capability.
Document.title - Web APIs
WebAPIDocumenttitle
otherwise, it contains the title specified in the markup (see the notes below).
... example <!doctype html> <html> <head> <title>hello world!</title> </head> <body> <script> alert(document.title); // displays "hello world!" document.title = "goodbye world!"; alert(document.title); // displays "goodbye world!" </script> </body> </html> notes this property applies to html, svg, xul, and other documents in gecko.
Document: transitionend event - Web APIs
in the case where a transition is removed before completion, such as if the transition-property is removed or display is set to none, then the event will not be generated.
...if the transitioncancel event is fired, the transitionend event will not fire.
Document.vlinkColor - Web APIs
notes the default value for this property in mozilla firefox is purple (#551a8b in hexadecimal).
... another alternative is document.body.vlink, although this is deprecated in html 4.01 in favor of the css alternative.
Document: wheel event - Web APIs
note: don't confuse the wheel event with the scroll event.
...therefore, do not rely on the wheel event's delta* properties to get the scrolling direction.
Document.width - Web APIs
WebAPIDocumentwidth
note: starting in gecko 6.0, document.width is no longer supported.
... not supported by internet explorer.
Document.writeln() - Web APIs
WebAPIDocumentwriteln
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).
Document.xmlVersion - Web APIs
its primary use in the past was to detect whether or not the document was being rendered as xml rather than html.
... to detect this, you can create an element with its name in lower case, then check to see if it gets converted into all upper case (in which case the document is in the non-xml html mode): if (document.createelement("foo").tagname == "foo") { /* document is not xml */ } specifications http://www.w3.org/tr/dom-level-3-cor...ument3-version this has been removed from dom core level 4wd ...
DocumentFragment.querySelectorAll() - Web APIs
note: the definition of this api was moved to the parentnode interface.
... examples this example returns a list of all div elements within the documentfragment with a class of either "note" or "alert": var matches = documentfrag.queryselectorall("div.note, div.alert"); specifications specification status comment selectors api level 1the definition of 'documentfragment.queryselectorall' in that specification.
DocumentOrShadowRoot.activeElement - Web APIs
for example, on macos systems, elements that aren't text input elements are not typically focusable by default.
... note: focus (which element is receiving user input events) is not the same thing as selection (the currently highlighted part of the document).
DocumentOrShadowRoot.fullscreenElement - Web APIs
the documentorshadowroot.fullscreenelement read-only property returns the element that is currently being presented in full-screen mode in this document, or null if full-screen mode is not currently in use.
... although this property is read-only, it will not throw if it is modified (even in strict mode); the setter is a no-operation and it will be ignored.
Locating DOM elements using selectors - Web APIs
note: the nodelist returned by queryselectorall() is not live, which means that changes in the dom are not reflected in the collection.
...for example, to select all paragraph (p) elements in a document whose css class is either warning or note, you can do the following: var special = document.queryselectorall( "p.warning, p.note" ); you can also query by id.
Document Object Model (DOM) - Web APIs
usually, that means javascript, although modeling html, svg, or xml documents as objects are not part of the core javascript language, as such.
...it is uncertain whether some may be reintroduced in the future or not, but for the time being they should be considered obsolete and should be avoided: documenttouch domconfiguration domerrorhandler domimplementationlist domimplementationregistry domimplementationsource domlocator domobject domsettabletokenlist domuserdata elementtraversal entity entityreference namelist notation typeinfo userdatahandler html...
EXT_disjoint_timer_query - Web APIs
ext.query_result_available_ext a glboolean indicating whether or not a query result is available.
... ext.gpu_disjoint_ext a glboolean indicating whether or not the gpu performed any disjoint operation.
Element: MSInertiaStart event - Web APIs
this event may not be fired if the scroll is sufficiently slow.
... bubbles unknown cancelable unknown interface msgestureevent event handler property unknown specifications not part of any specification.
Element: MozMousePixelScroll event - Web APIs
important: do not use this non-standard and obsolete event.
... note: on macos, the scroll distance (and therefore the value of detail) is computed based on the accelerated scroll distance.
Element: afterscriptexecute event - Web APIs
do not rely on it.
... bubbles yes cancelable no interface event event handler property none specifications not part of any specification.
Element.attachShadow() - Web APIs
elements you can attach a shadow to note that you can't attach a shadow root to every type of element.
... 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).
Element: beforescriptexecute event - Web APIs
do not rely on it.
... bubbles yes cancelable yes interface event event handler property none specifications not part of any specification.
Element: click event - Web APIs
usage notes the mouseevent object passed into the event handler for click has its detail property set to the number of times the target was clicked.
... add a dummy onclick="void(0)" attribute to the element or any of its ancestors up to but not including <body>.
Element.clientHeight - Web APIs
note: this property will round the value to an integer.
... working draft notes clientheight is a property introduced in the internet explorer object model.
Element.clientWidth - Web APIs
note: this property will round the value to an integer.
... working draft notes clientwidth was first introduced in the ms ie dhtml object model.
Element.closest() - Web APIs
WebAPIElementclosest
exceptions syntaxerror is thrown if the selectors is not a valid selector list string.
...cript var el = document.getelementbyid('div-03'); var r1 = el.closest("#div-02"); // returns the element with the id=div-02 var 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.webkitmatchess...
Element: copy event - Web APIs
however, the handler cannot read the clipboard data.
... it's possible to construct and dispatch a synthetic copy event, but this will not affect the system clipboard.
Element: fullscreenchange event - Web APIs
if not, the div will be placed into full-screen mode.
...if not, the value // of the property is null.
Element.getAttributeNodeNS() - Web APIs
== example == tbd the example needs to be fixed pre> // html: <div id="top" /> t = document.getelementbyid("top"); specialnode = t.getattributenodens( "http://www.mozilla.org/ns/specialspace", "id"); // inode.value = "full-top" </pre notes getattributenodens is more specific than getattributenode in that it allows you to specify attributes that are part of a particular namespace.
... dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'getattributenodens()' in that specification.
Element.getElementsByTagName() - Web APIs
all descendants of the specified element are searched, but not the element itself.
...only the element's descendants are included, not the element itself.
Element.hasAttribute() - Web APIs
the element.hasattribute() method returns a boolean value indicating whether the specified element has the specified attribute or not.
... example var foo = document.getelementbyid("foo"); if (foo.hasattribute("bar")) { // do something } polyfill ;(function(prototype) { prototype.hasattribute = prototype.hasattribute || function(name) { return !!(this.attributes[name] && this.attributes[name].specified); } })(element.prototype); notes dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) ge...
Element.localName - Web APIs
WebAPIElementlocalName
"localname = '" + circle.localname + "'\n" + "namespaceuri = '" + circle.namespaceuri + "'"; } ]]></script> </head> <body onload="test()"> <svg:svg version="1.1" width="100px" height="100px" viewbox="0 0 100 100"> <svg:circle cx="50" cy="50" r="30" style="fill:#aaa" id="circle"/> </svg:svg> <textarea id="text" rows="4" cols="55"/> </body> </html> notes the local name of a node is that part of the node's qualified name that comes after the colon.
...for example, in the qualified name ecomm:partners, partners is the local name and ecomm is the prefix: <ecomm:business id="soda_shop" type="brick_n_mortar" xmlns:ecomm="http://example.com/ecomm"> <ecomm:partners> <ecomm:partner id="1001">tony's syrup warehouse </ecomm:partner> </ecomm:partner> </ecomm:business> note: in gecko 1.9.2 and earlier, the property returns the upper-cased version of the local name for html elements in html doms (as opposed to xhtml elements in xml doms).
Element.matches() - Web APIs
WebAPIElementmatches
polyfill for browsers that do not support element.matches() or element.matchesselector(), but include support for document.queryselectorall(), a polyfill exists: if (!element.prototype.matches) { element.prototype.matches = element.prototype.matchesselector || element.prototype.mozmatchesselector || element.prototype.msmatchesselector || element.prototype.omatchesselector || element.prototype.webk...
...itmatchesselector || 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.
Element.name - Web APIs
WebAPIElementname
note: the name property doesn't exist for other elements; unlike tagname and nodename, it is not a property of the node, element or htmlelement interfaces.
...ents.elementname example <form action="" name="forma"> <input type="text" value="foo"> </form> <script type="text/javascript"> // get a reference to the first element in the form let formelement = document.forms['forma'].elements[0] // give it a name formelement.name = 'inputa' // show the value of the input alert(document.forms['forma'].elements['inputa'].value) </script> notes in internet explorer (ie), the name property of dom objects created using document.createelement() can't be set or modified.
Element.openOrClosedShadowRoot - Web APIs
note: this api is available only to webextensions.
... specifications this property is not part of any specification.
Element.outerHTML - Web APIs
WebAPIElementouterHTML
exceptions syntaxerror an attempt was made to set outerhtml using an html string which is not valid.
... notes if the element has no parent element, setting its outerhtml property will not change it or its descendants.
Element.prefix - Web APIs
WebAPIElementprefix
<x:div onclick="console.log(this.prefix)"/> notes this will only work when a namespace-aware parser is used, i.e.
...this will not work for html documents.
Element.removeAttributeNode() - Web APIs
example // given: <div id="top" align="center" /> var d = document.getelementbyid("top"); var d_align = d.getattributenode("align"); d.removeattributenode(d_align); // align is now removed: <div id="top" /> notes if the removed attribute has a default value, it is immediately replaced.
... dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattri...
Element.runtimeStyle - Web APIs
it does not modify the style content attribute.
... specification not a part of any specification.
Element.scrollIntoViewIfNeeded() - Web APIs
the element.scrollintoviewifneeded() method scrolls the current element into the visible area of the browser window if it's not already within the visible area of the browser window.
... example var element = document.getelementbyid("my-el"); element.scrollintoviewifneeded(); element.scrollintoviewifneeded(true); // centers the element in the visible area specifications not part of any specification.
Element.setAttribute() - Web APIs
exceptions invalidcharactererror the specified attribute name contains one or more characters which are not valid in attribute names.
... dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasatt...
Element.setPointerCapture() - Web APIs
note: when pointer capture is set, pointerover, pointerout, pointerenter, and pointerleave events are only generated when crossing the boundary of the capture target.
... exceptions exception explanation invalidpointerid pointerid does not match any of the active pointers.
Element: underflow event - Web APIs
this only works for elements for which overflow is not set to visible.
...eventlistener("underflow", function( event ) { console.log( event ); }, false); toggle.addeventlistener("change", function( event ) { if ( event.target.checked ) { child.style.width = "40px"; child.style.height = "40px"; } else { child.style.width = "10px"; child.style.height = "10px"; } }, false); </script> specifications not part of any specification.
Element: wheel event - Web APIs
bubbles yes cancelable yes interface wheelevent event handler property onwheel note: don't confuse the wheel event with the scroll event.
...therefore, do not rely on the wheel event's delta* properties to get the scrolling direction.
Event.isTrusted - Web APIs
WebAPIEventisTrusted
syntax var eventistrusted = event.istrusted; value boolean example if (e.istrusted) { /* the event is trusted */ } else { /* the event is not trusted */ } specification specification status comment domthe definition of 'event.istrusted' in that specification.
... obsolete adds requirements regarding trusted and untrusted events, though it does not itself define the istrusted property.
Event.originalTarget - Web APIs
note: originaltarget may also be native anonymous content (see bug 208427), in which case it's useless for non-privileged code.
...defined in /dom/public/idl/events/nsidomnsevent.idl this event property is not defined in the w3.org dom level 2 events ...
EventSource.close() - Web APIs
WebAPIEventSourceclose
note: if the connection is already closed, the method does nothing.
... examples var button = document.queryselector('button'); var evtsource = new eventsource('sse.php'); button.onclick = function() { console.log('connection closed'); evtsource.close(); } note: you can find a full example on github — see simple sse demo using php.
EventSource.withCredentials - Web APIs
syntax var mywithcredentials = eventsource.withcredentials; value a boolean indicating whether the eventsource object was instantiated with cors credentials set (true), or not (false, the default).
... examples var evtsource = new eventsource('sse.php'); console.log(evtsource.withcredentials); note: you can find a full example on github — see simple sse demo using php.
EventTarget.attachEvent() - 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.
ExtendableEvent.waitUntil() - Web APIs
this is primarily used to ensure that a service worker is not considered installed until all of the core caches it depends on are successfully populated.
... note: the behaviour described in the above paragraph was fixed in firefox 43 (see bug 1180274).
FeaturePolicy.getAllowlistForFeature() - Web APIs
errors the function will raise a warning if the specified feature policy directive name is not known.
...please note that camera api might be restricted by the permissions api, if the user did not grant the corrsponding permission yet.
FetchEvent.request - Web APIs
this property is non-nullable (since version 46, in the case of firefox.) if a request is not provided by some other means, the constructor init object must contain a request (see fetchevent.fetchevent().) syntax var recentrequest = fetchevent.request; value a request object.
...note that an http error response (e.g., 404) will not trigger an exception.
File.getAsDataURL() - Web APIs
WebAPIFilegetAsDataURL
note: this method is obsolete; you should use the filereader method readasdataurl() instead.
...s = fileinput.files; // array with acceptable file types var accept = ["image/png"]; // img is a htmlimgelement: <img id="myimg"> var img = document.getelementbyid("myimg"); // if we accept the first selected file type if (accept.indexof(files[0].mediatype) > -1) { // display the image // same as <img src="data:image/png,<imagedata>"> img.src = files[0].getasdataurl(); } specification not part of any specification.
File.getAsText() - Web APIs
WebAPIFilegetAsText
note: this method is obsolete; you should use the filereader method readastext() instead.
... files[i]; // if file type could be detected if (file !== null) { if (accept.text.indexof(file.mediatype) > -1) { // file is of type text, which we accept // make sure it's encoded as utf-8 var data = file.getastext("utf-8"); // modify data with string methods } else if (accept.binary.indexof(file.mediatype) > -1) { // binary } } } specification not part of any specification.
FileEntrySync - Web APIs
returns filewritersync exceptions this method can raise a fileexception with the following codes: exception description not_found_err the file does not exist.
... returns file exceptions this method can raise a fileexception with the following codes: exception description not_found_err the file does not exist.
FileReader.readAsDataURL() - Web APIs
note: the blob's result cannot be directly decoded as base64 without first removing the data-url declaration preceding the base64-encoded data.
...le.name) ) { var reader = new filereader(); reader.addeventlistener("load", function () { var image = new image(); image.height = 100; image.title = file.name; image.src = this.result; preview.appendchild( image ); }, false); reader.readasdataurl(file); } } if (files) { [].foreach.call(files, readandpreview); } } note: the filereader() constructor was not supported by internet explorer for versions before 10.
FileReaderSync.readAsArrayBuffer() - Web APIs
exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g.
... notreadableerror is raised when the resource cannot be read due to a permission problem, like a concurrent lock.
FileReaderSync.readAsDataURL() - Web APIs
exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g.
... notreadableerror is raised when the resource cannot be read due to a permission problem, like a concurrent lock.
FileRequest.lockedFile - 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.
FileRequest - 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.
FileSystemEntry.copyTo() - Web APIs
not for use in new websites.deprecated.
... not for use in new websites.
FileSystemEntry.moveTo() - Web APIs
not for use in new websites.deprecated.
... not for use in new websites.
FileSystemEntry.toURL() - Web APIs
not for use in new websites.deprecated.
... not for use in new websites.
FontFace.display - Web APIs
WebAPIFontFacedisplay
swap period if the font face is still not loaded, the fallback font will be shown.
... failure period if the font face still is not loaded, the fallback font will be shown and no swap will occur.
Frame Timing API - Web APIs
the observer (callback) will be notified when new "frame" events are added to the browser's performance timeline and the frame's duration (length of time) will be available.
...when one of those event types is recorded in the browser's performance timeline, the application is notified of the event via the observer's callback function that was specified when the observer was created.
GainNode.gain - Web APIs
WebAPIGainNodegain
note: though the audioparam returned is read-only, the value it represents is not.
...evices.getusermedia) { navigator.mediadevices.getusermedia ( // constraints - only audio needed for this app { audio: true }, // success callback function(stream) { source = audioctx.createmediastreamsource(stream); }, // error callback function(err) { console.log('the following gum error occured: ' + err); } ); } else { console.log('getusermedia not supported on your browser!'); } source.connect(gainnode); gainnode.connect(audioctx.destination); ...
GainNode - Web APIs
WebAPIGainNode
number of inputs 1 number of outputs 1 channel count mode "max" channel count 2 (not used in the default count mode) channel interpretation "speakers" constructor gainnode() creates a new instance of a gainnode object.
...evices.getusermedia) { navigator.mediadevices.getusermedia ( // constraints - only audio needed for this app { audio: true }, // success callback function(stream) { source = audioctx.createmediastreamsource(stream); }, // error callback function(err) { console.log('the following gum error occured: ' + err); } ); } else { console.log('getusermedia not supported on your browser!'); } source.connect(gainnode); gainnode.connect(audioctx.destination); ...
Gamepad.timestamp - Web APIs
WebAPIGamepadtimestamp
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.
GestureEvent - Web APIs
if the event has already being dispatched, this method does nothing.
... gesture event types gesturestart gesturechange gestureend specifications not part of any specification.
GlobalEventHandlers.onanimationend - Web APIs
note that there's nothing there about animation.
...note the use of animationevent.animationname and animationevent.elapsedtime to get information about the event which occurred.
GlobalEventHandlers.onanimationiteration - Web APIs
example let's create an animation which automatically pauses at the end of each iteration, allowing the user to choose whether or not to start the next iteration.
...note that there's nothing there about animation.
GlobalEventHandlers.onanimationstart - Web APIs
note that there's nothing there about animation.
...note the use of animationevent.animationname and animationevent.elapsedtime to get information about the event which occurred.
GlobalEventHandlers.onauxclick - Web APIs
note: browser vendors are implementing this property as part of a plan to improve compatibility with regards to button behaviors.
...lector('html'); function random(number) { return math.floor(math.random() * number); } button.onclick = function() { var rndcol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; button.style.backgroundcolor = rndcol; }; button.onauxclick = function() { var rndcol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; button.style.color = rndcol; } note: if you are using a three-button mouse, you'll notice that the onauxclick handler is run when either of the non-left mouse buttons are clicked.
GlobalEventHandlers.oncontextmenu - Web APIs
html <div class="shape">spinning</div> <p class="note" hidden>click to unpause.</p> css @keyframes spin { from { transform: rotate(0); } to { transform: rotate(1turn); } } .shape { width: 8em; height: 8em; display: flex; align-items: center; justify-content: center; animation: spin 18s linear infinite; background: lightsalmon; border-radius: 42%; margin: 1em; } .paused { background-color: #ddd; } .paused .sh...
...ape { animation-play-state: paused; } javascript function pause(e) { body.classlist.add('paused'); note.removeattribute('hidden'); } function play(e) { body.classlist.remove('paused'); note.setattribute('hidden', ''); } const body = document.queryselector('body'); const note = document.queryselector('.note'); window.oncontextmenu = pause; window.onpointerdown = play; result specifications specification status comment html living standardthe definition of 'oncontextmenu' in that specification.
GlobalEventHandlers.onkeypress - Web APIs
however, in practice browsers do not fire keypress events for certain keys.
...*/ alert("yesss!!!"); location.assign("https://developer.mozilla.org/"); } return true; }; })(); note: a more complete framework for capturing the typing of hidden words is available on github.
GlobalEventHandlers.onload - Web APIs
// es5 <script> function load() { console.log("load event detected!"); } window.onload = load; </script> // es2015 <script> const load = () => { console.log("load event detected!"); } window.onload = load; </script> </head> <body> <p>the load event fires when the document has finished loading!</p> </body> </html> notes the load event fires at the end of the document loading process.
... there are also dom events like domcontentloaded and domframecontentloaded (which can be handled using eventtarget.addeventlistener()) which are fired after the dom for the page has been constructed, but do not wait for other resources to finish loading.
GlobalEventHandlers.onmousewheel - Web APIs
do not use this wheel event.
... notes see the dom event handlers page for information on working with on...
GlobalEventHandlers - Web APIs
note: globaleventhandlers is a mixin and not an interface; you can't actually create an object of type globaleventhandlers.
... globaleventhandlers.ontransitionrun an eventhandler called when a transitionrun event is sent, indicating that a css transition is running, though not nessarilty started.
HTMLAreaElement - Web APIs
if the name is not a valid filename of the underlying os, browser will adapt it.
... htmlhyperlinkelementutils.host is a usvstring containing the hostname and port (if it's not the default port) in the referenced url.
msAudioDeviceType - 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.
HTMLBodyElement - Web APIs
note that this is not an uri, though some older version of some browsers do expect it.
... windoweventhandlers.onunhandledrejection an eventhandler representing the code executed when the unhandledrejection event is raised, indicating that a promise was rejected but the rejection was not handled.
HTMLCanvasElement.mozFetchAsStream() - Web APIs
examples save to disk with mozfetchasstream (chrome context only) this technique also converts it to ico, however it will not work in windows xp as winxp cannot convert from png to ico.
...on(iconname) { return function(instream) { var file = fileutils.getfile('desk', [iconname + '.ico']); var outstream = fileutils.openfileoutputstream(file); cu.import('resource://gre/modules/netutil.jsm'); netutil.asynccopy(instream, outstream, netutilcallback()); } } canvas.mozfetchasstream(mfascallback('myicon'), 'image/vnd.microsoft.icon'); specifications not part of any specification.
HTMLCanvasElement.toDataURL() - Web APIs
if the requested type is not image/png, but the returned value starts with data:image/png, then the requested type is not supported.
... exceptions securityerror the canvas's bitmap is not origin clean; at least some of its contents have or may have been loaded from a site other than the one from which the document itself was loaded.
HTMLDialogElement.open - Web APIs
false means it not set, and therefore the dialog is not shown.
...log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also).
HTMLElement: animationiteration event - Web APIs
the animationiteration event is fired when an iteration of a css animation ends, and another one begins.
... this event does not occur at the same time as the animationend event, and therefore does not occur for animations with an animation-iteration-count of one.
HTMLElement: change event - Web APIs
unlike the input event, the change event is not necessarily fired for each alteration to an element's value.
...king or using the keyboard) for <input type="radio"> and <input type="checkbox">; when the user commits the change explicitly (e.g., by selecting a value from a <select>'s dropdown with a mouse click, by selecting a date from a date picker for <input type="date">, by selecting a file in the file picker for <input type="file">, etc.); when the element loses focus after its value was changed, but not commited (e.g., after editing the value of <textarea> or <input type="text">).
HTMLElement.contentEditable - Web APIs
the contenteditable property of the htmlelement interface specifies whether or not the element is editable.
... 'false' indicates that the element cannot be edited.
HTMLElement.hidden - Web APIs
the hidden property applies to all presentation modes and should not be used to hide content that is meant to be directly accessible to the user.
... appropriate use cases for hidden include: content that isn't yet relevant but may be needed later content that was previously needed but is not any longer content that is reused by other parts of the page in a template-like fashion creating an offscreen canvas as a drawing buffer inappropriate use cases include: hiding panels in a tabbed dialog box hiding content in one presentation while intending it to be visible in others elements that are not hidden must not link to elements which are.
HTMLElement: input event - Web APIs
however, historically this has not always been the case.
... note: the input event is fired every time the value of the element changes.
HTMLElement.offsetHeight - Web APIs
it does not include the height of pseudo-elements such as ::before or ::after.
... working draft notes offsetheight is a property of the dhtml object model which was first introduced by msie.
HTMLElement.offsetWidth - Web APIs
it does not include the width of pseudo-elements such as ::before or ::after.
... working draft notes offsetwidth is a property of the dhtml object model which was first introduced by msie.
HTMLElement: pointermove event - Web APIs
the pointermove event is fired when a pointer changes coordinates, and the pointer has not been canceled by a browser touch-action.
... bubbles yes cancelable yes interface pointerevent event handler property onpointermove usage notes the event, which is of type pointerevent, provides all the information you need to know about the user's interaction with the pointing device, including the position, movement distance, button states, and much more.
HTMLHyperlinkElementUtils.hash - Web APIs
the fragment is not percent-decoded.
... if the url does not have a fragment identifier, this property contains an empty string, "".
Image() - Web APIs
disambiguation: image(), the css function notation.
... usage note the entire bitmap is loaded regardless of the sizes specified in the constructor.
HTMLImageElement.hspace - Web APIs
usage notes the value specified for hspace is mapped to the margin-left and margin-right properties to specify the width of those margins in pixels.
... recommendation provides additional details not present in the newer specification.
HTMLImageElement.isMap - Web APIs
note: for accessibility reasons, you should generally avoid using server-side image maps, as they require the use of a mouse.
... usage notes when an image marked as being part of a server-side image map is clicked, the browser constructs the string "?x,y", where x and y indicate the coordinates at which the mouse was clicked as offsets from the top-left corner of the image, specified in css pixels.
HTMLImageElement.lowSrc - Web APIs
important: the lowsrc property is obsolete and should not be used.
... usage notes lowsrc is a strange case.
HTMLImageElement.referrerPolicy - Web APIs
possible values are: "no-referrer" meaning that the referer: http header will not be sent.
... "unsafe-url" meaning that the referrer will include the origin and the path (but not the fragment, password, or username).
HTMLImageElement.sizes - Web APIs
because a source size descriptor is used to specify the width to use for the image during layout of the page, the media condition is typically (but not necessarily) based entirely on width information.
... note: the source size value must not be specified as a percentage of the container size; that is, lengths such as 50% or 100% are not allowed, as there would be uncertainty as to what the specified value is a percentage of.
HTMLInputElement.select() - Web APIs
html <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().
... in browsers where it is not supported, it is possible to replace it with a call to htmlinputelement.setselectionrange() with parameters 0 and the input's value length: <input onclick="this.select();" value="sample text" /> <!-- equivalent to --> <input onclick="this.setselectionrange(0, this.value.length);" value="sample text" /> specifications specification status comment html living standardthe definition of 'select' in that specification.
HTMLInputElement.setSelectionRange() - Web APIs
note that accordingly to the whatwg forms spec selectionstart, selectionend properties and setselectionrange method apply only to inputs of types text, search, url, tel and password.
...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".
HTMLInputElement.webkitdirectory - Web APIs
h birthday pic2343.jpg pic2344.jpg pic2355.jpg pic2356.jpg vacations mars pic5533.jpg pic5534.jpg pic5556.jpg pic5684.jpg pic5712.jpg if the user chooses photoalbums, then the list reported by files will contain file objects for every file listed above—but not the directories.
... note: the behavior of webkitrelativepath is different in chromium < 72.
HTMLMarqueeElement - Web APIs
note that any value smaller than 60 is ignored and the value 60 is used instead, unless truespeed is true.
...if truespeed is true, then those values are not ignored.
HTMLMediaElement.canPlayType() - Web APIs
note: this feature is not available in web workers.
... maybe not enough information is available to determine for sure whether or not the media will play until playback is actually attempted.
HTMLMediaElement: canplay event - Web APIs
the canplay event is fired when the user agent can play the media, but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content.
... using addeventlistener(): const video = document.queryselector('video'); video.addeventlistener('canplay', (event) => { console.log('video can start, but not sure it will play through.'); }); using the oncanplay event handler property: const video = document.queryselector('video'); video.oncanplay = (event) => { console.log('video can start, but not sure it will play through.'); }; specifications specification status html living standardthe definition of 'canplay media event' in that specification.
HTMLMediaElement.load() - Web APIs
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).
... if resetting the playback position to the beginning of the media actually changes the playback position (that is, it was not already at the beginning), a timeupdate event is sent.
HTMLMediaElement.networkState - Web APIs
also, readystate is have_nothing.
... network_idle 1 htmlmediaelement is active and has selected a resource, but is not using the network.
HTMLMediaElement.readyState - Web APIs
possible values are: constant value description have_nothing 0 no information is available about the media resource.
... have_current_data 2 data is available for the current playback position, but not enough to actually play more than one frame.
HTMLObjectElement.setCustomValidity - Web APIs
additionally you must call the reportvalidity method on the same element or nothing will happen.
...as long as the error message is not null, the form will not pass validation and will not be submitted.
HTMLObjectElement.validationMessage - Web APIs
the validationmessage read-only property of the htmlobjectelement interface returns a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any).
... this is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints.
HTMLOptionElement - Web APIs
htmloptionelement.defaultselected is a boolean that contains the initial value of the selected html attribute, indicating whether the option is selected by default or not.
...if the option is not part of a list of options, like when it is part of the <datalist> element, the value is 0.
HTMLElement.focus() - Web APIs
this object may contain the following property: preventscroll optional a boolean value indicating whether or not the browser should scroll the document to bring the newly-focused element into view.
... obsolete notes if you call htmlelement.focus() from a mousedown event handler, you must call event.preventdefault() to keep the focus from leaving the htmlelement behaviour of the focus in relation to different html features like tabindex or shadow dom, which previously remained under-specified, were recently updated (as october of 2019).
HTMLOrForeignElement.nonce - Web APIs
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).
HTMLOrForeignElement.tabIndex - Web APIs
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.
HTMLSelectElement.selectedOptions - Web APIs
in other words, any option contained within the <select> element may be part of the results, but option groups are not included in the list.
...note also the <button>, whose role it is to trigger fetching the htmlcollection of selected elements using the selected property.
HTMLTableElement.createCaption() - Web APIs
note: if no caption exists, createcaption() inserts a new caption directly into the table.
... the caption does not need to be added separately as would be the case if document.createelement() had been used to create the new <caption> element.
HTMLTableElement.createTFoot() - Web APIs
note: if no footer exists, createtfoot() inserts a new footer directly into the table.
... the footer does not need to be added separately as would be the case if document.createelement() had been used to create the new <tfoot> element.
HTMLTableElement.createTHead() - Web APIs
note: if no header exists, createthead() inserts a new header directly into the table.
... the header does not need to be added separately as would be the case if document.createelement() had been used to create the new <thead> element.
HTMLTableElement.insertRow() - Web APIs
to insert the row into a specific <tbody>: let specific_tbody = document.getelementbyid(tbody_id); let row = specific_tbody.insertrow(index) note: insertrow() inserts the row directly into the table.
... the row does not need to be appended separately as would be the case if document.createelement() had been used to create the new <tr> element.
HTMLVideoElement.msHorizontalMirror - 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.
msStereo3DPackingMode - 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.
msStereo3DRenderMode - 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.
onMSVideoFormatChanged - 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.
onMSVideoFrameStepCompleted - 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.
onMSVideoOptimalLayoutChanged - 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.
Headers.getAll() - Web APIs
WebAPIHeadersgetAll
if the given name is not the name of an http header, this method throws a typeerror.
...nt-type', 'image/jpeg'); myheaders.getall('content-type'); // returns [ "image/jpeg" ] if the header has multiple values associated with it, the array will contain all the values, in the order they were added to the headers object: myheaders.append('accept-encoding', 'deflate'); myheaders.append('accept-encoding', 'gzip'); myheaders.getall('accept-encoding'); // returns [ "deflate", "gzip" ] note: use headers.get to return only the first value added to the headers object.
History.scrollRestoration - Web APIs
manual the location on the page is not restored.
... const scrollrestoration = history.scrollrestoration if (scrollrestoration === 'manual') { console.log('the location on the page is not restored, user will need to scroll manually.'); } prevent automatic page location restoration if (history.scrollrestoration) { history.scrollrestoration = 'manual'; } specifications specification status comment html living standardthe definition of 'scroll restoration mode' in that specification.
History - Web APIs
WebAPIHistory
note that all browsers but safari currently ignore the title parameter.
... note that all browsers but safari currently ignore the title parameter.
History API - Web APIs
the dom window object provides access to the browser's session history (not to be confused for webextensions history) through the history object.
... another use for the go() method is to refresh the current page by either passing 0, or by invoking it without an argument: // the following statements // both have the effect of // refreshing the page window.history.go(0) window.history.go() you can determine the number of pages in the history stack by looking at the value of the length property: let numberofentries = window.history.length inter...
IDBDatabase.objectStoreNames - Web APIs
note: this feature is available in web workers.
... example // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBDatabase.version - Web APIs
note: this feature is available in web workers.
... example // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database // being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBFactory.deleteDatabase() - Web APIs
note: this feature is available in web workers.
...note that attempting to delete a database that doesn't exist does not throw an exception, in contrast to idbdatabase.deleteobjectstore(), which does throw an exception if the named object store does not exist.
IDBIndex.count() - Web APIs
WebAPIIDBIndexcount
note: this feature is available in web workers.
...we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key.
IDBIndex.get() - Web APIs
WebAPIIDBIndexget
note: this feature is available in web workers.
...we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key.
IDBIndex.isAutoLocale - Web APIs
we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key.
... + '<td>' + cursor.value.company + '</td>' + '<td>' + cursor.value.email + '</td>' + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications not currently part of any specification.
IDBIndex.multiEntry - Web APIs
note: this feature is available in web workers.
...we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key.
IDBIndex.objectStore - Web APIs
note: this feature is available in web workers.
...this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key.
IDBLocaleAwareKeyRange - Web APIs
this is because when you use bound(), it checks if lower bound < upper bound, and throws an exception if that’s not the case.
.../td&gt;' + '&lt;td&gt;' + cursor.value.email + '&lt;/td&gt;' + '&lt;td&gt;' + cursor.value.phone + '&lt;/td&gt;' + '&lt;td&gt;' + cursor.value.age + '&lt;/td&gt;'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications not currently part of any specification.
FileHandle.getFile() - 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.
FileHandle.name - 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.
FileHandle.onabort - 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.
FileHandle.onerror - 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.
FileHandle.open() - 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.
FileHandle.type - 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.
IDBObjectStore.openCursor() - Web APIs
note: this feature is available in web workers.
...if nothing is passed, this will default to a key range that selects all the records in this object store.
IDBObjectStore.openKeyCursor() - Web APIs
if nothing is passed, this will default to a key range that selects all the records in this object store.
... then use a cursor to iterate through all the records in the object store: var transaction = db.transaction("name", "readonly"); var objectstore = transaction.objectstore("name"); var request = objectstore.openkeycursor(); request.onsuccess = function(event) { var cursor = event.target.result; if(cursor) { // cursor.key contains the key of the current record being iterated through // note that there is no cursor.value, unlike for opencursor // this is where you'd do something with the result cursor.continue(); } else { // no more results } }; specifications specification status comment indexed database api 2.0the definition of 'openkeycursor()' in that specification.
IDBTransactionSync - Web APIs
recoverable_err if this transaction's scope is dynamic, and the browser cannot commit all of the changes due to another transaction.
... exceptions the method can raise an idbdatabaseexception with the following code: not_found_err if the requested object store is not in this transaction's scope.
IDBVersionChangeEvent.version - Web APIs
not for use in new websites.deprecated.
... not for use in new websites.requires a vendor prefix or different name for use.requires a vendor prefix or different name for use.
InputEvent.inputType - Web APIs
try inserting line breaks, or deleting text in different ways, or pasting different content in.</p> <hr> <ul> <li>a sample</li> <li>bulleted</li> <li>list.</li> </ul> <p>another paragraph.</p> </div> javascript const log = document.getelementbyid('log'); const editable = document.queryselector('div[contenteditable]'); editable.addeventlistener('input', loginputtype); function loginputtype(event) { log.textcontent = `input type: ${event.inputtype}`; } result try editing the text inside the <div> and see what happens.
... note: see also masayuki nakano's inputevent test suite for a more detailed example.
InputEvent - Web APIs
the inputevent interface represents an event notifying of editable content change.
... inputevent.gettargetranges() returns an array of static ranges that will be affected by a change to the dom if the input event is not canceled.
InstallEvent - Web APIs
as a child of extendableevent, it ensures that functional events such as fetchevent are not dispatched during installation.
... note: logging statements are visible in google chrome via the "inspect" interface for the relevant service worker accessed via chrome://serviceworker-internals.
install - Web APIs
firefox 3 note in firefox 3 the callback is no longer invoked unless the website performing the installation is whitelisted.
... returns install returns true if the function succeeded and false if it did not, but these values are not always reliable as a determinant of the success of the operation.
IntersectionObserver.takeRecords() - Web APIs
note: if you use the callback to monitor these changes, you don't need to call this method.
... calling this method clears the pending intersection list, so the callback will not be run.
KeyboardEvent.initKeyboardEvent() - Web APIs
canbubblearg whether or not the event can bubble.
... cancelablearg whether or not the event can be canceled.
KeyboardEvent.keyCode - Web APIs
as described above, the keycode attribute is not useful for printable characters, especially those input with the shift or alt key pressed.
... example window.addeventlistener("keydown", function (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.
KeyframeEffect.KeyframeEffect() - Web APIs
although this is technically optional, keep in mind that your animation will not run if this value is 0.
...this is primarily of use when sequencing animations based on the end time of another animation.
KeyframeEffect - Web APIs
this may be null for animations that do not target a specific element or pseudo-element.
...this may be null for animations that do not target a pseudo-element.
LayoutShift - Web APIs
note that in this example data is only sent to the server when the user leaves the tab.
... observer.takerecords(); observer.disconnect(); console.log('cls:', cumulativelayoutshiftscore); } }); } catch (e) { // do nothing if the browser doesn't support this api.
LocalMediaStream - Web APIs
do not use localmediastream; you need to update any code that does use it as soon as possible or your content or application will stop working.
... specifications not part of any specification.
Location: hash - Web APIs
WebAPILocationhash
the fragment is not percent-decoded.
... if the url does not have a fragment identifier, this property contains an empty string, "".
Location: replace() - Web APIs
WebAPILocationreplace
the difference from the assign() method is that after using replace() the current page will not be saved in session history, meaning the user won't be able to use the back button to navigate to it.
... if the provided url is not valid, a domexception of the syntax_error type is thrown.
LockedFile.append() - Web APIs
WebAPILockedFileappend
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.
LockedFile.fileHandle - 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.
LockedFile.flush() - Web APIs
WebAPILockedFileflush
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.
LockedFile.location - 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.
LockedFile.mode - Web APIs
WebAPILockedFilemode
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.
LockedFile.onabort - 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.
LockedFile.oncomplete - 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.
LockedFile.onerror - 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.
LockedFile.readAsArrayBuffer() - 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.
LockedFile.truncate() - 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.
LockedFile.write() - Web APIs
WebAPILockedFilewrite
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.
Long Tasks API - Web APIs
usage var observer = new performanceobserver(function(list) { var perfentries = list.getentries(); for (var i = 0; i < perfentries.length; i++) { // process long task notifications: // report back for analytics and monitoring // ...
... } }); // register observer for long task notifications observer.observe({entrytypes: ["longtask"]}); // long script execution after this will result in queueing // and receiving "longtask" entries in the observer.
MSManipulationEvent - 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.
MSRangeCollection - Web APIs
do not use!
... remarks the msrangecollection object does not inherit from any class or interface and does not define any members.
MediaDeviceInfo - Web APIs
it is reset when the user clears cookies (for private browsing, a different identifier is used that is not persisted across sessions).
... if (!navigator.mediadevices || !navigator.mediadevices.enumeratedevices) { console.log("enumeratedevices() not supported."); return; } // list cameras and microphones.
MediaElementAudioSourceNode - Web APIs
note: you can also view this example running live, or view the source.
...document.documentelement.scrolltop : document.body.scrolltop); gainnode.gain.value = cury/height; } // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(gainnode); gainnode.connect(audioctx.destination); note: as a consequence of calling createmediaelementsource(), audio playback from the htmlmediaelement will be re-routed into the processing graph of the audiocontext.
msExtendedCode - 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.
MediaError - Web APIs
media_err_src_not_supported 4 the associated resource or media provider object (such as a mediastream) has been found to be unsuitable.
...this text and its format is not defined by the specification and will vary from one user agent to another.
MediaImage - Web APIs
sizes specifies the resource in multiple sizes so that user agent does not have to scale a single image.
...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.
MediaList.mediaText - Web APIs
note that the medialist is a live list; updating the list via mediatext will immediately update the behavior of the document.
... also note that is you try to set mediatext to null, it will be treated as an empty string, i.e.
MediaPositionState.playbackRate - Web APIs
note: a value of 0.0 is not permitted.
... let positionstate = { duration: mymediaduration; playbackrate: 2.0; position: mymediaposition; }; navigator.mediasession.setpositionstate(positionstate); note the value 2.0 as the playbackrate.
MediaQueryList.matches - Web APIs
the matches read-only property of the mediaquerylist interface is a boolean that returns true if the document currently matches the media query list, or false if not.
... you can be notified when the value of matches changes by watching for the change event to be fired at the mediaquerylist.
MediaQueryListEvent.matches - Web APIs
the matches read-only property of the mediaquerylistevent interface is a boolean that returns true if the document currently matches the media query list, or false if not.
... syntax var matches = mediaquerylistevent.matches; value a boolean; returns true if the document currently matches the media query list, false if not.
MediaRecorder() - Web APIs
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.
MediaRecorder.ignoreMutedMedia - Web APIs
not for use in new websites.deprecated.
... not for use in new websites.
MediaRecorder.mimeType - Web APIs
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.
... note: the term "mime type" is officially considered to be historical; these strings are now officially known as media types.
MediaRecorder.requestData() - Web APIs
when the requestdata() method is invoked, the browser queues a task that runs the following steps: if mediarecorder.state is not "recording", raise a dom invalidstate error and terminate these steps.
... syntax mediarecorder.requestdata() errors an invalidstate error is raised if the requestdata() method is called while the mediarecorder object’s mediarecorder.state is not "recording" — the media cannot be captured if recording is not occurring.
MediaRecorder.resume() - Web APIs
if mediarecorder.state is not "inactive", continue to the next step.
... syntax mediarecorder.resume() errors an invalidstate error is raised if the resume() method is called while the mediarecorder object’s mediarecorder.state is "inactive" — the recording cannot be resumed if it is not already paused; if mediarecorder.state is already "recording", resume() has no effect.
MediaRecorder.state - Web APIs
syntax var state = mediarecorder.state values a animationplaystate object containing one of the following values: enumeration description inactive recording is not occuring — it has either not been started yet, or it has been started and then stopped.
... paused recording has been started, then paused, but not yet stopped or resumed.
MediaRecorderErrorEvent() - Web APIs
the other fields may or may not be present.
... some user agents add to the error object other properties that provide information such as stack dumps, the name of the javascript file and the line number where the error occurred, and other debugging aids, but you should not rely on this information in a production environment.
MediaSession.setPositionState() - Web APIs
this can be particularly useful if your code implements a player for type of media not directly supported by the browser.
... if the media is not playing, clearinterval() is used to remove the interval handler.
MediaSource.addSourceBuffer() - Web APIs
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.
active - Web APIs
a stream is considered active if at least one of its mediastreamtracks is not in the mediastreamtrack.ended state.
...when that stream becomes available (that is, when the returned promise is fulfilled, a button on the page is updated based on whether or not the stream is currently active.
MediaStreamAudioSourceNode() - Web APIs
note: another way to create a mediastreamaudiosourcenode is to call theaudiocontext.createmediastreamsource() method, specifying the stream from which you want to obtain audio.
... audio: true, video: false }).then(function(stream) { var options = { mediastream : stream } var source = new mediastreamaudiosourcenode(audioctx, options); source.connect(audioctx.destination); }).catch(function(err) { console.log('the following gum error occured: ' + err); }); } else { console.log('new getusermedia not supported on your browser!'); } specifications specification status comment web audio apithe definition of 'mediastreamaudiosourcenode()' in that specification.
MediaStreamEvent() - Web APIs
"bubbles", optional and defaulting to false, inherited from eventinit, and indicating if the event must bubble or not.
... "cancelable", optional and defaulting to false, inherited from eventinit, and indicating if the event can be canceled or not.
MediaStreamTrack: ended event - Web APIs
bubbles no cancelable no interface event event handler property mediastreamtrack.onended usage notes ended events fire when the media stream track's source permanently stops sending data on the stream.
... a remote peer has permanently stopped sending data; pausing media does not generate an ended event.
MediaStreamTrack.getConstraints() - Web APIs
for example, you may prefer high definition video but require that the frame rate be a little low to help keep the data rate low enough not overtax the network.
... note: the returned set of constraints doesn't necessarily describe the actual state of the media.
MediaStreamTrack: mute event - Web APIs
note: the condition that most people think of as "muted" (that is, a user-toggled state of silencing a track) is actually managed using the mediastreamtrack.enabled property, for which there are no events.
... bubbles no cancelable no interface event event handler property onmute examples in this example, event handlers are established for the mute and unmute events in order to detect when the media is not flowing from the source for the mediastreamtrack referenced by musictrack.
MediaStreamTrackAudioSourceNode - Web APIs
note: you can see this example running live, or view the source.
...r); biquadfilter.connect(audioctx.destination); // get new mouse pointer coordinates when mouse is moved // then set new gain value range.oninput = function() { biquadfilter.gain.value = range.value; } }) .catch(function(err) { console.log('the following gum error occured: ' + err); }); } else { console.log('getusermedia not supported on your browser!'); } // dump script to pre element pre.innerhtml = myscript.innerhtml; note: as a consequence of calling createmediastreamsource(), audio playback from the media stream will be re-routed into the processing graph of the audiocontext.
MediaTrackConstraints.autoGainControl - Web APIs
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().
... syntax var constraintsobject = { autogaincontrol: constraint }; constraintsobject.autogaincontrol = constraint; value if this value is a simple true or false, the user agent will attempt to obtain media with automatic gain control enabled or disabled as specified, if possible, but will not fail if this can't be done.
MediaTrackConstraints.echoCancellation - Web APIs
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().
... syntax var constraintsobject = { echocancellation: constraint }; constraintsobject.echocancellation = constraint; value if this value is a simple true or false, the user agent will attempt to obtain media with echo cancellation enabled or disabled as specified, if possible, but will not fail if this can't be done.
MediaTrackConstraints.noiseSuppression - Web APIs
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().
... 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.
MediaTrackControls.volume - Web APIs
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().
... any constraint set which only permits values outside the range 0.0 to 1.0 cannot be satisfied and will result in failure.
MediaTrackSettings.autoGainControl - Web APIs
the mediatracksettings dictionary's autogaincontrol property is a boolean value whose value indicates whether or not automatic gain control (agc) is enabled on an audio track.
... 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().
MediaTrackSettings.deviceId - Web APIs
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().
...that makes the device id not useful for any changes to constraints when calling mediastreamtrack.applyconstraints().
MediaTrackSettings.displaySurface - Web APIs
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.
MediaTrackSettings.echoCancellation - Web APIs
the mediatracksettings dictionary's echocancellation property is a boolean value whose value indicates whether or not echo cancellation is enabled on an audio track.
... 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().
MediaTrackSettings.groupId - Web APIs
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().
... the group id is not usable across multiple browsing sessions.
MediaTrackSettings.logicalSurface - Web APIs
the mediatracksettings dictionary's logicalsurface property indicates whether or not the display area being captured is a logical surface.
... logical surfaces are those which are not necessarily entirely onscreen, or may even be off-screen, such as windows' backing buffers (where only part of the buffer is visible without scrolling the containing window) and offscreen rendering contexts.
MediaTrackSettings.noiseSuppression - Web APIs
the mediatracksettings dictionary's noisesuppression property is a boolean value whose value indicates whether or not noise suppression technology is enabled on an audio track.
... 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().
MediaTrackSupportedConstraints.aspectRatio - Web APIs
if the constraint isn't supported, it's not included in the list, so this value will never be false.
... 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.
MediaTrackSupportedConstraints.channelCount - Web APIs
if the constraint isn't supported, it's not included in the list, so this value will never be false.
... 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.
MediaTrackSupportedConstraints.deviceId - Web APIs
if the constraint isn't supported, it's not included in the list, so this value will never be false.
... 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.
MediaTrackSupportedConstraints.echoCancellation - Web APIs
if the constraint isn't supported, it's not included in the list, so this value will never be false.
... 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.
MediaTrackSupportedConstraints.facingMode - Web APIs
if the constraint isn't supported, it's not included in the list, so this value will never be false.
... 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.
MediaTrackSupportedConstraints.groupId - Web APIs
if the constraint isn't supported, it's not included in the list, so this value will never be false.
... 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.
MediaTrackSupportedConstraints.height - Web APIs
if the constraint isn't supported, it's not included in the list, so this value will never be false.
... 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.
MediaTrackSupportedConstraints.latency - Web APIs
if the constraint isn't supported, it's not included in the list, so this value will never be false.
... 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.
MediaTrackSupportedConstraints.logicalSurface - Web APIs
the mediatracksupportedconstraints dictionary's logicalsurface property indicates whether or not the logicalsurface constraint is supported by the user agent and the device on which the content is being used.
...it adds the logicalsurface constraint (requesting that only logical display surfaces—those which may not be entirely visible onscreen—be included among the options available to the user) only if it is known to be supported by the browser.
MediaTrackSupportedConstraints.sampleRate - Web APIs
if the constraint isn't supported, it's not included in the list, so this value will never be false.
... 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.
MediaTrackSupportedConstraints.sampleSize - Web APIs
if the constraint isn't supported, it's not included in the list, so this value will never be false.
... 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.
MediaTrackSupportedConstraints.volume - Web APIs
if the constraint isn't supported, it's not included in the list, so this value will never be false.
... 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().volume) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result ...
MediaTrackSupportedConstraints.width - Web APIs
if the constraint isn't supported, it's not included in the list, so this value will never be false.
... 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.
MediaTrackSupportedConstraints - Web APIs
because of the way interface definitions in webidl work, if a constraint is requested but not supported, no error will occur.
... properties some combination—but not necessarily all—of the following properties will exist on the object.
Media Session API - Web APIs
the media session api provides a way to customize media notifications.
...the platform can show this metadata in media centers, notifications, device lockscreens, etc.
MerchantValidationEvent.complete() - Web APIs
exceptions this exception may be passed into the 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.
MessageEvent - Web APIs
note: this feature is available in web workers.
...do not use this anymore — use the messageevent() constructor instead.
MessagePort: message event - Web APIs
bubbles no cancelable no interface messageevent event handler property onmessage examples suppose a script creates a messagechannel and sends one of the ports to a different browsing context, such as another <iframe>, using code like this: const channel = new messagechannel(); const myport = channel.port1; const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const messagecontrol = document.queryselector('#message'); const channelmessagebutton = document.queryselector('#channel-message'); channelmessagebutton.addeventlistener('click', () => { myport.postmessage(messagecontrol.value); }) targetframe.postmess...
...age('init', targetorigin, [channel.port2]); the target can receive the port and start listening for messages on it using code like this: window.addeventlistener('message', (event) => { const myport = event.ports[0]; myport.addeventlistener('message', (event) => { received.textcontent = event.data; }); myport.start(); }); note that the listener must call messageport.start() before any messages will be delivered to this port.
MessagePort: messageerror event - Web APIs
bubbles no cancelable no interface messageevent event handler property onmessageerror examples suppose a script creates a messagechannel and sends one of the ports to a different browsing context, such as another <iframe>, using code like this: const channel = new messagechannel(); const myport = channel.port1; const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const messagecontrol = document.queryselector('#message'); const channelmessagebutton = document.queryselector('#channel-message'); channelmessagebutton.addeventlistener('click', () => { myport.postmessage(messagecontrol.value);...
...port and start listening for messages and message errors on it using code like this: window.addeventlistener('message', (event) => { const myport = event.ports[0]; myport.addeventlistener('message', (event) => { received.textcontent = event.data; }); myport.addeventlistener('messageerror', (event) => { console.error(event.data); }); myport.start(); }); note that the listener must call messageport.start() before any messages will be delivered to this port.
MessagePort.onmessageerror - Web APIs
the onmessageerror event handler of the messageport interface is an eventlistener, called whenever an messageevent of type messageerror is fired on the port—that is, when it receives a message that cannot be deserialized.
... note: this feature is available in web workers.
MessagePort.start() - Web APIs
WebAPIMessagePortstart
note: this feature is available in web workers.
... example in the following code block, you can see a handlemessage handler function, run when a message is sent back to this document using onmessage: channel.port1.onmessage = handlemessage; function handlemessage(e) { para.innerhtml = e.data; } another option would be to do this using eventtarget.addeventlistener, however, when this method is used, you need to explicitly call start() to begin the flow of messages to this document: channel.port1.addeventlistener('message', handlemessage, false); function handlemessage(e) { para.innerhtml = e.data; textinput.value = ''; } channel.port1.start(); specifications specification status comment html living standardthe definition of 'start()' in that spec...
MessagePort - Web APIs
note: this feature is available in web workers.
... onmessageerror an eventlistener called when a messageevent of type messageerror is fired—that is, when it receives a message that cannot be deserialized.
Microdata DOM API - Web APIs
getitems( [ types ] ) returns a nodelist of the elements in the document that create items, that are not part of other items, and that are of the types given in the argument, if any are listed.
... fluffy <span itemprop="http://example.com/color">black</span> fur with <span itemprop="http://example.com/color">white</span> paws and belly.</p> <img itemprop="img" src="hedral.jpeg" alt="" title="hedral, age 18 months"> </section> ...it would result in the following output: name http://example.com/fn desc http://example.com/color img (the duplicate occurrence of "http://example.com/color" is not included in the list.) htmlpropertiescollection the htmlpropertiescollection interface is used for collections of elements that add name-value pairs to a particular item in the microdata model.
MouseEvent.pageX - Web APIs
WebAPIMouseEventpageX
this includes any portion of the document not currently visible.
...since this example is presented in an <iframe>, that top-left corner is the top-left corner of the frame, not the browser window.
MouseEvent.shiftKey - Web APIs
the mouseevent.shiftkey read-only property is a boolean that indicates whether the shift key was pressed or not when a given mouse event occurs.
... syntax var shiftkeypressed = instanceofmouseevent.shiftkey return value a boolean, where true indicates that the key is pressed, and false indicates that the key is not pressed.
MouseEvent - Web APIs
if the event has already being dispatched, this method does nothing.
...ascript function simulateclick() { var evt = new mouseevent("click", { bubbles: true, cancelable: true, view: window }); var cb = document.getelementbyid("checkbox"); //element to click on var canceled = !cb.dispatchevent(evt); if(canceled) { // a handler called preventdefault alert("canceled"); } else { // none of the handlers called preventdefault alert("not canceled"); } } document.getelementbyid("button").addeventlistener('click', simulateclick); result specifications specification status comment css object model (cssom) view modulethe definition of 'mouseevent' in that specification.
msGraphicsTrustStatus - 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.
msIsBoxed - Web APIs
WebAPIMsIsBoxed
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.
msPlayToDisabled - 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.
msPlayToPreferredSourceUri - 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.
msPlayToPrimary - 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.
MutationObserver.disconnect() - Web APIs
note: all notifications of mutations that have already been detected, but not yet reported to the observer, are discarded.
... usage notes if the element being observed is removed from the dom, and then subsequently released by the browser's garbage collection mechanism, the mutationobserver is likewise deleted.
MutationObserver.takeRecords() - Web APIs
the mutationobserver method takerecords() returns a list of all matching dom changes that have been detected but not yet processed by the observer's callback function, leaving the mutation queue empty.
... note: the queue of mutations which have occurred, but not been delivered to the observer's callback is left empty after calling takerecords().
MutationObserverInit.attributeFilter - Web APIs
if this property exists on the options object when the mutationobserver() constructor is used to create a new mutationobserver, attribute monitoring is enabled regardless of whether or not the attributes property is true.
... note the use of mutationrecord.oldvalue to get the previous value of the "username" property so we have that information when doing lookups in our local array of users.
NDEFReader.scan() - Web APIs
WebAPINDEFReaderscan
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.
NameList - Web APIs
WebAPINameList
note: although this interface was previously implemented in gecko, there was no way to actually create one.
...the dom spec does not specify how the collection is to be implemented.
Navigation Timing API - Web APIs
there is a specification for level 2, but it is not yet covered here.
... calculate page render time as another example of an interesting piece of data you can obtain using the navigation timing api that you can't otherwise easily get, you can get the amount of time it took to render the page: const rendertime = perfdata.domcomplete - perfdata.domloading; this is obtained by starting with the time at which loading of the dom and its dependencies is complete (domcomplete) and subtracting from it the ti...
msSaveBlob - Web APIs
return value true is returned as long as the download notification bar is displayed, or false if a failure occured.
... notes when a site calls this method, the behavior is the same as when windows internet explorer downloads a file with the following in the header, where x-download-options removes the file open button from the browser file download dialog: content-length: <blob.size> content-type: <blob.type> content-disposition: attachment;filename=<defaultname> x-download-options: noopen specifications not part of any specifications.
msSaveOrOpenBlob - Web APIs
return value true is returned as long as the download notification bar is displayed, or false if a failure occurred.
... notes when a site calls this method, the behavior is the same as when windows internet explorer downloads a file with the following in the header: content-length: <blob.size> content-type: <blob.type> content-disposition: attachment;filename=<defaultname> specifications not part of any specifications.
Navigator.share() - Web APIs
WebAPINavigatorshare
it will reject immediately if the data parameter is not correctly specified, and will also reject if the user cancels sharing.
...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().
navigator.hardwareConcurrency - Web APIs
note: this feature is available in web workers.
... examples in this example, one worker is created for each logical processor reported by the browser and a record is created which includes a reference to the new worker as well as a boolean value indicating whether or not we're using that worker yet; these objects are, in turn, stored into an array for later use.
NavigatorID.userAgent - Web APIs
try not to use it at all, or only for current and past versions of a browser.
... browser identification based on detecting the user agent string is unreliable and is not recommended, as the user agent string is user configurable.
Navigator.onLine - Web APIs
in chrome and safari, if the browser is not able to connect to a local area network (lan) or a router, it is offline; all other conditions return true.
... so while you can assume that the browser is offline when it returns a false value, you cannot assume that a true value necessarily means that the browser can access the internet.
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.
NetworkInformation.downlinkMax - Web APIs
note: this feature is available in web workers.
... function logconnectiontype() { var connectiontype = 'not supported'; var downlinkmax = 'not supported'; if ('connection' in navigator) { connectiontype = navigator.connection.effectivetype; if ('downlinkmax' in navigator.connection) { downlinkmax = navigator.connection.downlinkmax; } } console.log('current connection type: ' + connectiontype + ' (downlink max: ' + downlinkmax + ')'); } logconnectiontype(); navigator.connection.addeventlistener(...
Node.appendChild() - Web APIs
WebAPINodeappendChild
note that the copies made with clonenode will not be automatically kept in sync.
... notes chaining may not work as expected, due to appendchild() returning the child element: let ablock = document.createelement('block').appendchild( document.createelement('b') ); sets ablock to <b></b> only, which is probably not what you want.
Node.childNodes - Web APIs
WebAPINodechildNodes
syntax let nodelist = elementnodereference.childnodes; examples simple usage // parg is an object reference to a <p> element // first check that the element has child nodes if (parg.haschildnodes()) { let children = parg.childnodes; for (let i = 0; i < children.length; i++) { // do something with each child as children[i] // note: list is live!
... adding or removing children will change the list's `length` } } remove all children from a node // this is one way to remove all children from a node // box is an object reference to an element while (box.firstchild) { //the list is live so it will re-index each call box.removechild(box.firstchild); } notes the items in the collection of nodes are objects, not strings.
Node.compareDocumentPosition() - Web APIs
the node.comparedocumentposition() method reports the position of the given node relative to another node in any document — not just the given node’s document.
... example const head = document.head; const body = document.body; if (head.comparedocumentposition(body) & node.document_position_following) { console.log('well-formed document'); } else { console.error('<head> is not before <body>'); } note: because the result returned by comparedocumentposition() is a bitmask, the bitwise and operator must be used for meaningful results.
Node.firstChild - Web APIs
WebAPINodefirstChild
another #text node is inserted between the closing </span> and </p>tags.
... if this whitespace is removed from the source, the #text nodes are not inserted and the span element becomes the paragraph's first child.
Node.lookupNamespaceURI() - Web APIs
the node.lookupnamespaceuri() method accepts a prefix and returns the namespace uri associated with it on the given node if found (and null if not).
...if the prefix is not found, it returns null.
Node.lookupPrefix() - Web APIs
WebAPINodelookupPrefix
the node.lookupprefix() method returns a domstring containing the prefix for a given namespace uri, if present, and null if not.
... due to bug 312019, this method does not work with dynamically assigned namespaces, that is, those set with the node.prefix property.
Node.nextSibling - Web APIs
WebAPINodenextSibling
syntax nextnode = node.nextsibling notes gecko-based browsers insert text nodes into a document to represent whitespace in the source markup.
...see the resources in the notes section.
Node.nodeName - Web APIs
WebAPINodenodeName
attr the value of attr.name cdatasection "#cdata-section" comment "#comment" document "#document" documentfragment "#document-fragment" documenttype the value of documenttype.name element the value of element.tagname entity the entity name entityreference the name of entity reference notation the notation name processinginstruction the value of processinginstruction.target text "#text" example given the following markup: <div id="d1">hello world</div> <input type="text" id="t"> and the following script: var div1 = document.getelementbyid("d1"); var text_field = document.getelementbyid("t"); text_field.value = div1.nodename; in xhtml (or a...
... note that the element.tagname property could have been used instead, since nodename has the same value as tagname for an element.
Node.parentNode - Web APIs
WebAPINodeparentNode
example if (node.parentnode) { // remove a node from the tree, unless // it's not in the tree already node.parentnode.removechild(node); } notes document and documentfragment nodes can never have a parent, so parentnode will always return null.
... it also returns null if the node has just been created and is not yet attached to the tree.
Node.prefix - Web APIs
WebAPINodeprefix
<x:div onclick="console.log(this.prefix)"/> notes this will only work when a namespace-aware parser is used, i.e.
...this will not work for html documents.
Node.setUserData() - Web APIs
WebAPINodesetUserData
note that such data will not be preserved when imported via node.importnode, as with node.clonenode() and node.renamenode() operations (though node.adoptnode does preserve the information), and equality tests in node.isequalnode() do not consider user data in making the assessment.
...nt('', 'test', null); d.documentelement.setuserdata('key', 15, {handle:function (o, k, d, s, ds) {console.log(o+'::'+k+'::'+d+'::'+s+'::'+ds)}}); // 2::key::15::[object element]::[object element] console.log(d.documentelement.getuserdata('key')); // 15 var e = document.importnode(d.documentelement, true); // causes handler to be called console.log(e.getuserdata('key')); // null since user data is not copied specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'node.setuserdata()' in that specification.
NodeIterator.nextNode() - Web APIs
syntax node = nodeiterator.nextnode(); example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false // this optional argument is not used any more ); currentnode = nodeiterator.nextnode(); // returns the next node specifications specification status comment domthe definition of 'nodeiterator.nextnode' in that specification.
... living standard as detach() is now a no-op method, this method cannot throw anymore.
NodeIterator.previousNode() - Web APIs
syntax node = nodeiterator.previousnode(); example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false // this optional argument is not used any more ); currentnode = nodeiterator.nextnode(); // returns the next node previousnode = nodeiterator.previousnode(); // same result, since we backtracked to the previous node specifications specification status comment domthe definition of 'nodeiterator.previousnode' in that specification.
... living standard as detach() is now a no-op method, this method cannot throw anymore.
NonDocumentTypeChildNode.nextElementSibling - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnextelementsiblingchrome full support 4edge full support 12notes full support 12notes notes before edge 79, this property was only implemented for element, not for characterdata.firefox full support 3.5ie partial support 9notes partial support 9notes notes only implemented for element, not for characterdata.
... 10.1safari ios full support yessamsung internet android full support yeslegend full support full support partial support partial supportsee implementation notes.see implementation notes.
OVR_multiview2 - Web APIs
availability: support depends on the system's graphics driver (windows+angle and android are supported; windows+gl, mac, linux are not supported).
... 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.
OverconstrainedError.OverconstrainedError() - Web APIs
the overconstrainederror constructor creates a new overconstrainederror object which indicates that the set of desired capabilities for the current mediastreamtrack cannot currently be met.
... syntax var overconstrainederror = new overconstrainederror() parameters constraint the constraint that was not satified.
OverconstrainedError - Web APIs
the overconstrainederror interface of the media capture and streams api indicates that the set of desired capabilities for the current mediastreamtrack cannot currently be met.
... properties overconstrainederror.constraint read only returns the constraint that was supplied in the constructor, meaning the constraint that was not satisfied.
PannerNode.refDistance - Web APIs
const context = new audiocontext(); // all our test tones will last this many seconds const note_length = 6; // this is how far we'll move the sound const z_distance = 20; // this function creates a graph for the test tone with a given refdistance // and schedules it to move away from the listener along the z (depth-wise) axis // at the given start time, resulting in a decrease in volume (decay) const scheduletesttone = (refdistance, starttime) => { const osc = new oscillatornode(context...
...); const panner = new pannernode(context); panner.refdistance = refdistance; // set the initial z position, then schedule the ramp panner.positionz.setvalueattime(0, starttime); panner.positionz.linearramptovalueattime(z_distance, starttime + note_length); osc.connect(panner) .connect(context.destination); osc.start(starttime); osc.stop(starttime + note_length); }; // this tone should decay immediately and fairly quickly scheduletesttone(1, context.currenttime); // this tone should decay slower and later than the previous one scheduletesttone(4, context.currenttime + note_length); // this tone should decay only slightly, and only start decaying fairly late scheduletesttone(7, context.currenttime + note_length * 2); after running this code, the resulting waveforms sh...
ParentNode.replaceChildren() - Web APIs
on> </select> </div> <div class="buttons"> <button id="to-yes">transfer to "yes" --&gt;</button> <button id="to-no">&lt;-- transfer to "no"</button> </div> <div> <label for="yes">yes please!</label> <select id="yes" multiple size="10"> </select> </div> </main> it would make sense to use some simple css to lay out the two select lists in a line alongside one another, with the control buttons in between them: main { display: flex; } div { margin-right: 20px; } label, button { display: block; } .buttons { display: flex; flex-flow: column; justify-content: center; } select { width: 200px; } what we want to do is transfer any selected options in the "no" list over to the "yes" list when the "yes" button is pressed, and transfer any selecte...
... to do this, we give each of the buttons a click event handler, which collects together the selected options you want to transfer in one constant, and the existing options in the list you are transferring to in another constant.
Path2D() - Web APIs
WebAPIPath2DPath2D
the path2d() constructor returns a newly instantiated path2d object, optionally with another path as an argument (creates a copy), or optionally with a string consisting of svg path data.
... syntax new path2d(); new path2d(path); new path2d(d); parameters path optional when invoked with another path2d object, a copy of the path argument is created.
Path2D.addPath() - Web APIs
WebAPIPath2DaddPath
the path2d.addpath() method of the canvas 2d api adds one path2d object to another path2d object.
... examples adding a path to an existing path this example adds one path to another.
PaymentAddress - Web APIs
properties paymentaddress.addressline read only an array of domstring objects providing each line of the address not included among the other properties.
... note: properties for which values were not specified contain empty strings.
PaymentDetailsUpdate - Web APIs
shippingaddresserrors optional an addresserrors object which includes an error message for each property of the shipping address that could not be validated.
...this is not calculated automatically.
PaymentItem - Web APIs
pending secure context a boolean value which is true if the specified amount has not yet been finalized.
...the user agent may show this information but is not required to do so.
PaymentRequestUpdateEvent.updateWith() - Web APIs
shippingaddresserrors optional an addresserrors object which includes an error message for each property of the shipping address that could not be validated.
...this is not calculated automatically.
performance.getEntries() - Web APIs
note: this feature is available in web workers.
...performance.mark not supported"); return; } // create some performance entries via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); performance.mark("begin"); do_work(100000); performance.mark("end"); do_work(200000); performance.mark("end"); // use getentries() to iterate through the each entry let p = performance.getentries(); for (var i=0; i < p.length; i++) {...
performance.getEntriesByType() - Web APIs
note: this feature is available in web workers.
...performance.mark not supported"); return; } // create some performance entries via the mark() method performance.mark("begin"); dowork(50000); performance.mark("end"); performance.mark("begin"); dowork(100000); performance.mark("end"); dowork(200000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.len...
PerformanceEntry.entryType - Web APIs
note: this feature is available in web workers.
... function run_performanceentry() { // check for feature support before continuing if (performance.mark === undefined) { console.log("performance.mark not supported"); return; } // create a performance entry named "begin" via the mark() method performance.mark("begin"); // check the entrytype of all the "begin" entries var entriesnamedbegin = performance.getentriesbyname("begin"); for (var i=0; i < entriesnamedbegin.length; i++) { var typeofentry = entriesnamedbegin[i].entrytype; console.log("entry is type: " + typeofen...
PerformanceEntry - Web APIs
performanceentry instances will always be one of the following subtypes: performancemark performancemeasure performanceframetiming performancenavigationtiming performanceresourcetiming performancepainttiming note: this feature is available in web workers.
..." + properties[i] + " is not supported"); } } } specifications specification status comment resource timing level 3 editor's draft resource timing level 2 working draft resource timing level 1 candidate recommendation adds the performanceresourcetiming interface and the resource value for entrytype.
PerformanceObserver.observe() - Web APIs
may not be used together with the "type" or "buffered" options.
... may not be used together with the entrytypes option.
PerformanceObserver - Web APIs
the performanceobserver interface is used to observe performance measurement events and be notified of new performance entries as they are recorded in the browser's performance timeline.
... note: this feature is available in web workers.
PerformanceResourceTiming.connectEnd - Web APIs
note: this feature is available in web workers.
..." + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'connectend' in that specification.
PerformanceResourceTiming.connectStart - Web APIs
note: this feature is available in web workers.
..." + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'connectstart' in that specification.
PerformanceResourceTiming.decodedBodySize - Web APIs
note: this feature is available in web workers.
... if ("decodedbodysize" in perfentry) console.log("decodedbodysize = " + perfentry.decodedbodysize); else console.log("decodedbodysize = not supported"); if ("encodedbodysize" in perfentry) console.log("encodedbodysize = " + perfentry.encodedbodysize); else console.log("encodedbodysize = not supported"); if ("transfersize" in perfentry) console.log("transfersize = " + perfentry.transfersize); else console.log("transfersize = not supported"); } function check_performanceentries() { // use getentriesbytype() ...
PerformanceResourceTiming.domainLookupEnd - Web APIs
note: this feature is available in web workers.
..." + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'domainlookupend' in that specification.
PerformanceResourceTiming.domainLookupStart - Web APIs
note: this feature is available in web workers.
..." + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'domainlookupstart' in that specification.
PerformanceResourceTiming.encodedBodySize - Web APIs
note: this feature is available in web workers.
... if ("decodedbodysize" in perfentry) console.log("decodedbodysize = " + perfentry.decodedbodysize); else console.log("decodedbodysize = not supported"); if ("encodedbodysize" in perfentry) console.log("encodedbodysize = " + perfentry.encodedbodysize); else console.log("encodedbodysize = not supported"); if ("transfersize" in perfentry) console.log("transfersize = " + perfentry.transfersize); else console.log("transfersize = not supported"); } function check_performanceentries() { // use getentriesbytype() ...
PerformanceResourceTiming.fetchStart - Web APIs
note: this feature is available in web workers.
..." + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'fetchstart' in that specification.
PerformanceResourceTiming.initiatorType - Web APIs
note: this feature is available in web workers.
...initiatortype = not supported"); } specifications specification status comment resource timing level 1the definition of 'initiatortype' in that specification.
PerformanceResourceTiming.nextHopProtocol - Web APIs
note: this feature is available in web workers.
...// use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_nexthopprotocol(p[i]); } } function print_nexthopprotocol(perfentry) { var value = "nexthopprotocol" in perfentry; if (value) console.log("nexthopprotocol = " + perfentry.nexthopprotocol); else console.log("nexthopprotocol = not supported"); } specifications specification status comment resource timing level 2the definition of 'nexthopprotocol' in that specification.
PerformanceResourceTiming.redirectEnd - Web APIs
note: this feature is available in web workers.
..." + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'redirectend' in that specification.
PerformanceResourceTiming.requestStart - Web APIs
note: this feature is available in web workers.
..." + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'requeststart' in that specification.
PerformanceResourceTiming.responseEnd - Web APIs
note: this feature is available in web workers.
..." + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'responseend' in that specification.
PerformanceResourceTiming.responseStart - Web APIs
note: this feature is available in web workers.
..." + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'responsestart' in that specification.
PerformanceResourceTiming.transferSize - Web APIs
note: this feature is available in web workers.
... if ("decodedbodysize" in perfentry) console.log("decodedbodysize = " + perfentry.decodedbodysize); else console.log("decodedbodysize = not supported"); if ("encodedbodysize" in perfentry) console.log("encodedbodysize = " + perfentry.encodedbodysize); else console.log("encodedbodysize = not supported"); if ("transfersize" in perfentry) console.log("transfersize = " + perfentry.transfersize); else console.log("transfersize = not supported"); } function check_performanceentries() { // use getentriesbytype() ...
PerformanceServerTiming - Web APIs
note: this feature is available in web workers.
...note that this interface is only available in secure contexts (https) in some browsers.
Performance API - Web APIs
since a platform's system clock is subject to various skews (such as ntp adjustments), the interfaces support a monotonic clock i.e.
... performanceobserver provides methods and properties used to observe performance measurement events and be notified of new performance entries as they are recorded in the browser's performance timeline.
PluginArray - Web APIs
the pluginarray is not a javascript array, but has the length property and supports accessing individual items using bracket notation (plugins[2]), as well as via item(index) and nameditem("name") methods.
... note: own properties of pluginarray objects are no longer enumerable in the latest browser versions.
PointerEvent.pointerType - Web APIs
if the device type cannot be detected by the browser, the value can be an empty string ("").
...lement.addeventlistener('pointerdown', function(event) { // call the appropriate pointer type handler switch (event.pointertype) { case 'mouse': process_pointer_mouse(event); break; case 'pen': process_pointer_pen(event); break; case 'touch': process_pointer_touch(event); break; default: console.log(`pointertype ${event.pointertype} is not suported`); } }, false); specifications specification status comment pointer eventsthe definition of 'pointertype' in that specification.
PointerEvent.tangentialPressure - Web APIs
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.
PositionOptions - Web APIs
note that this can result in slower response times or increased power consumption (with a gps chip on a mobile device for example).
...if set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position.
PromiseRejectionEvent() - Web APIs
with promise rejection events, it becomes possible to detect and report promises which fail and whose failures go unnoticed.
...the reason could just as easily be a number, or even an object with detailed information including the home address, how serious the fire is, and the phone number of an emergency contact who should be notified.
PromiseRejectionEvent.promise - Web APIs
examples this example listens for unhandled promises and, if the reason is an object with a code field containing the text "module not ready", it sets up an idle callback that will retry the task that failed to execute correctly.
... window.onunhandledrejection = function(event) { if (event.reason.code && event.reason.code == "module not ready") { window.requestidlecallback(function(deadline) { loadmodule(event.reason.modulename) .then(performstartup); }); event.preventdefault(); } } specifications specification status comment html living standardthe definition of 'promiserejectionevent.promise' in that specification.
PublicKeyCredential.response - Web APIs
note: when validating the fetching of existing credentials, the whole publickeycredential object and the client extensions are necessary for the relying party's server.
... note: this property may only be used in top-level contexts and will not be available in an <iframe> for example.
PublicKeyCredential - Web APIs
note: this api is restricted to top-level contexts.
... use from within an <iframe> element will not have any effect.
PublicKeyCredentialCreationOptions.challenge - Web APIs
note: when the credential is retrieved with a navigator.credentials.get() call, the signature of the challenge is contained in authenticatorassertionresponse.signature.
... note: a challenge will be at least 16 bytes long.
PublicKeyCredentialCreationOptions.excludeCredentials - Web APIs
the value of the strings may be: "usb": the authenticator can be contacted via a removable usb link "nfc": the authenticator may be used over nfc (near field communication) "ble": the authenticator may be used over ble (bluetooth low energy) "internal": the authenticator is specifically bound to the client device (cannot be removed).
... examples var publickey = { excludecredentials: [ { type: "public-key", // the id for john.doe@example.com id : new uint8array(26) /* this actually is given by the server */ }, { type: "public-key", // the id for john-doe@example.com id : new uint8array(26) /* another id */ } ], challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create...
PublicKeyCredentialCreationOptions - Web APIs
smith", }, // requested format of new keypair pubkeycredparams: [{ type: "public-key", alg: cose_alg_ecdsa_w_sha256, }], // timeout after 1 minute timeout: 60000, // do not send the authenticator's origin attestation attestation: "none", extensions: { uvm: true, exts: true }, // filter out authenticators which are bound to the device authenticatorselection:{ authenticatorattachment: "cross-platform", requireresidentkey: true, userverification: "preferred" }, // ...
...exclude already existing credentials for the user excludecredentials: [ { type: "public-key", // the id for john.doe@example.com id : new uint8array(26) /* this actually is given by the server */ }, { type: "public-key", // the id for john-doe@example.com id : new uint8array(26) /* another id */ } ] } }; // create the new credential with the options above navigator.credentials.create(createcredentialoptions) .then(function (newcredentialinfo) { var attestationresponse = newcredentialinfo.response; var clientextensionsoutputs = newcredentialinfo.getclientextensionsresults(); // send the response to the relying party server // it will verify th...
PublicKeyCredentialRequestOptions.challenge - Web APIs
note: when the credential is created with a navigator.credentials.create() call, the signature of the challenge is contained within authenticatorattestationresponse.attestationobject.
... note: a challenge will be at least 16 bytes long.
PublicKeyCredentialRequestOptions.userVerification - Web APIs
note: an analogous option exists for the creation operation (navigators.credentials.create()), see the userverification property of publickeycredentialcreationoptions.authenticatorselection.
...the values may be: "required": user verification is required, the operation will fail if the response does not have the uv flag (as part of authenticatorassertionresponse.authenticatordata) "preferred": user verification is prefered, the operation will not fail if the response does not have the uv flag (as part of authenticatorassertionresponse.authenticatordata) "discouraged": user verification should not be employed as to minimize the user interaction during the process.
PushManager.permissionState() - Web APIs
note: as of firefox 44, the permissions for notifications and push have been merged.
... if permission is granted for notifications, push will also be enabled.
PushManager.register() - Web APIs
the register method is used to ask the system to request a new endpoint for notifications.
... note: if you do not need the url any more, please use pushmanager.unregister() to clean up after yourself.
PushMessageData.arrayBuffer() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetarraybuffer experimentalchrome full support 50edge full support ≤79firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support service workers and the push api.ie no support noopera full support 37safari no support nowebview android ...
...expect behavior to change in the future.see implementation notes.see implementation notes.
PushMessageData.blob() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetblob experimentalchrome full support 50edge full support ≤79firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support service workers and the push api.ie no support noopera full support 37safari no support nowebview android ...
...expect behavior to change in the future.see implementation notes.see implementation notes.
PushMessageData.json() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetjson experimentalchrome full support 50edge full support ≤79firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support service workers and the push api.ie no support noopera full support 37safari no support nowebview android ...
...expect behavior to change in the future.see implementation notes.see implementation notes.
PushMessageData.text() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettext experimentalchrome full support 50edge full support ≤79firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support service workers and the push api.ie no support noopera full support 37safari no support nowebview android ...
...expect behavior to change in the future.see implementation notes.see implementation notes.
PushRegistrationManager - Web APIs
not for use in new websites.deprecated.
... not for use in new websites.
PushSubscription.options - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetoptionschrome full support 42edge full support 16firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support service workers and the push api.ie no support noopera full support 29safari no support nowebview android ...
...rt 29safari ios no support nosamsung internet android full support 4.0legend full support full support no support no supportsee implementation notes.see implementation notes.
RTCConfiguration.bundlePolicy - Web APIs
this introduces bundling but will fall back to not bundling if the remote peer can't handle it.
... in technical terms, an sdp bundle lets all of the media tracks (identified in the sdp from the m= lines) stream between two peers across a single 5-tuple, that is, from a single ip and port on one peer to a single ip and port on another peer, all using the same rtcdtlstransport.
RTCConfiguration.certificates - Web APIs
see using certificates below for more information on why you might want to—or not to—explicitly provide certificates.
... the certificates property's value cannot be changed once it's first specified.
RTCDTMFSender.toneBuffer - Web APIs
the letters a-d these characters represent the "a" through "d" keys which are part of the dtmf standard but not included on most telephones.
... these are not interpreted as digits.
RTCDTMFToneChangeEvent.RTCDTMFToneChangeEvent() - Web APIs
the letters a-d these characters represent the "a" through "d" keys which are part of the dtmf standard but not included on most telephones.
... these are not interpreted as digits.
RTCDataChannel.label - Web APIs
these labels are not required to be unique.
...it cannot be changed after that.
RTCDataChannelEvent() - Web APIs
indicates if the event must bubble or not.
...indicates if the event can be canceled or not.
RTCIceCandidate.foundation - Web APIs
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.
RTCIceCandidatePairStats.nominated - Web APIs
the rtcicecandidatepairstats property nominated specifies whether or not the candidate pair described by the underlying rtcicecandidatepair has been nominated to be used as the configuration for the webrtc connection.
... note: if more than one candidate pair are nominated at the same time, the one whose priority is higher will be selected for use.
RTCIceCandidatePairStats.priority - Web APIs
note: this property was removed from the specification as its value cannot be guaranteed to be accurately represented in a javascript number.
... you can calculcate its value using the algorithm described in rfc 5245, section 5.7.2 if you need this information and can accept the risk that the result may not be entirely accurate.
RTCIceCandidatePairStats.readable - Web APIs
the obsolete rtcicecandidatepairstats property readable reports whether or not the connection described by the candidate pair has received at least one valid incoming ice request.
... note: this property was removed from the specification in early 2017 because you can determine whether or not the connection is readable by checking to see if requestsreceived is greater than 0: if (icpstats.requestsreceived > 0) { /* at least one ice request has been received */ } ...
RTCIceCandidatePairStats.requestsReceived - Web APIs
note: the reported number of requests includes retransmissions.
...this differs from requestssent, which does not include retransmisions.
RTCIceCandidatePairStats.writable - Web APIs
the obsolete rtcicecandidatepairstats property writable reports whether or not the connection described by the candidate pair is writable.
... note: this property was removed from the specification in early 2017 because you can determine whether or not an incoming ice request is available to read by checking to see if responsesreceived is greater than 0 and that the time specified by consentexpiredtimestamp has not passed: if (icpstats.responsesreceived > 0 && icpstats.consentexpiredtimestamp < performance.now()) { /* at least one ice response has been received */ } ...
RTCIceServer - Web APIs
obsolete properties the following properties have been removed from the specification and should not be used.
...do not use this property; use urls instead.
RTCIceTransport.getSelectedCandidatePair() - Web APIs
usage notes as the ice agent performs negotiation of a rtcpeerconnection, it gathers and analyzes candidate configurations from each the two peers.
... note: it's possible for one of the configurations in the selected candidate pair to remain unchanged when a new pairing is chosen.
RTCIceTransport.ongatheringstatechange - Web APIs
the gathering state indicates whether or not the ice agent has begun gathering candidates, and if so, whether or not gathering has finished.
... its possible values are: "new" the rtcicetransport is newly created and has not yet started to gather ice candidates.
RTCIceTransport - Web APIs
role read only returns a domstring whose value is one of the members of the rtcicerole enumerated type: "controlling" or "controlled"; this indicates whether the ice agent is the one that makes the final decision as to the candidate pair to use or not.
...returns null if parameters have not yet been received.
RTCInboundRtpStreamStats.fecPacketsReceived - Web APIs
note: this counter may also be incremented when fec packets arrive in-band along with media content; this can happen with opus, for example.
... usage notes it's possible that a subset of the fec packets which have been received were discarded instead of being used.
RTCInboundRtpStreamStats.perDscpPacketsReceived - Web APIs
note: not all operating systems make data available on a per-dscp basis, so this property shouldn't be relied upon on those systems.
... note: due to network bleaching and remapping, the numbers seen on this record are not necessarily going to match the values as they were when the data was sent.
RTCNetworkType - Web APIs
the vpn obscures the underlying network type, which is not discernible.
... note: keep in mind that the specified value only reflects the initial connection between the local peer and the next hop along the network toward reaching the remote peer.
RTCOutboundRtpStreamStats.perDscpPacketsSent - Web APIs
note: not all operating systems make data available on a per-dscp basis, so this property shouldn't be relied upon on those systems.
... note: due to network bleaching and remapping, the numbers seen on this record are not necessarily going to match the values as they were when the data was sent.
RTCPeerConnection.close() - Web APIs
syntax peerconnection.close(); this method has no parameters, and returns nothing.
... make sure that you delete all references to the previous rtcpeerconnection before attempting to create a new one that connects to the same remote peer, as not doing so might result in some errors depending on the browser.
RTCPeerConnection.createAnswer() - Web APIs
exceptions notreadableerror the identity provider wasn't able to provide an identity assertion.
...this code comes from the handler for the message sent to carry an offer to another peer across the signaling channel.
RTCPeerConnection.getStats() - Web APIs
exceptions this method does not throw exceptions; instead, it rejects the returned promise with one of the following errors: invalidaccesserror there is no rtcrtpsender or rtcrtpreceiver whose track matches the specified selector, or selector matches more than one sender or receiver.
...this form of getstats() has been or will soon be removed from most browsers; you should not use it, and should update existing code to use the new promise-based version.
RTCPeerConnection.onicecandidate - Web APIs
this message should not be sent to the remote peer.
... pc.onicecandidate = function(event) { if (event.candidate) { // send the candidate to the remote peer } else { // all ice candidates have been sent } } notice that the end of negotiation is detected here when the event's candidate property is null.
RTCPeerConnection.peerIdentity - Web APIs
once this promise resolves successfully, the resulting identity is the target peer identity and cannot change for the duration of the connection.
... note: the promise returned by setremotedescription() cannot resolve until any target peer identity that's been set is validated.
RTCPeerConnection.pendingLocalDescription - Web APIs
this does not describe the connection as it currently stands, but as it may exist in the near future.
... example this example looks at the pendinglocaldescription to determine whether or not there's a description change being processed.
RTCPeerConnection.pendingRemoteDescription - Web APIs
this does not describe the connection as it currently stands, but as it may exist in the near future.
... example this example looks at the pendingremotedescription to determine whether or not there's a description change being processed.
RTCPeerConnection.removeTrack() - Web APIs
if the track is already stopped, or is not in the connection's senders list, this method has no effect.
... exceptions invalidstateerror the connection is not open.
RTCPeerConnectionIceErrorEvent - Web APIs
you will not normally create an object of this type yourself.
... properties the rtcpeerconnectioniceerrorevent interface includes the properties found on the event interface, as well as the following properties: address read only a domstring providing the local ip address used to communicate with the stun or turn server being used to negotiate the connection, or null if the local ip address has not yet been exposed as part of a local ice candidate.
RTCRemoteOutboundRtpStreamStats - Web APIs
usage notes the rtcremoteoutboundrtpstreamstats object's remotetimestamp proeprty provides statistics based on the received data's ntp timestamp taken from an rtcp sender report (sr) block.
... be aware that the remote clock may not be synchronized with the local clock (either in current time or speed at which time elapses).
RTCRtpEncodingParameters.scaleResolutionDownBy - Web APIs
a value less than 1.0 would cause the video to get larger rather than smaller, which is not the intent of this property.
... therefore, specifying a value less than 1.0 is not permitted and will cause a rangeerror exception to be thrown by rtcpeerconnection.addtransceiver() or rtcrtpsender.setparameters().
RTCRtpReceiver.getCapabilities() static function - Web APIs
nothing is loaded, fetched, or otherwise prepared.
... example the function below returns a boolean indicating whether or not the device supports receiving h.264 video on a webrtc connection.
RTCRtpSender.getCapabilities() static function - Web APIs
nothing is loaded, fetched, or otherwise prepared.
... example the function below returns a boolean indicating whether or not the device supports sending h.264 video on an rtcrtpsender.
RTCRtpStreamStats.pliCount - Web APIs
a pli message is used by video decoders (running on the receiving end of the stream) to notify the encoder (the sender) that an undefined amount of coded video data, which may span frame boundaries, has been lost.
... note: this value is only available on the receiver, and only for video media.
RTCRtpSynchronizationSource - Web APIs
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.
RTCSessionDescription() - Web APIs
pranswer the session description object describes a provisional answer; that is, a response to a previous offer that is not the final answer.
...this value is an empty string ("") by default and may not be null.
RTCStatsIceCandidatePairState - Web APIs
frozen no check has been performed yet for this candidate pair, and performing the check is blocked until another check is successful.
... waiting this pair has not yet been checked, but the check can be performed as soon as this pair is the highest priority pair remaining in the waiting state.
RTCStatsReport - Web APIs
the active candidate pair is deleted after the transport switches to another candidate pair; this change cannot be detected otherwise.
...since this only provides statistics related to inbound data, without considering the local peer's state, any values that require knowledge of both, such as round-trip time, is not included.
RTCStatsType - Web APIs
the active candidate pair is deleted after the transport switches to another candidate pair; this change cannot be detected otherwise.
...since this only provides statistics related to inbound data, without considering the local peer's state, any values that require knowledge of both, such as round-trip time, is not included.
Range.compareBoundaryPoints() - Web APIs
the range.compareboundarypoints() method compares the boundary points of the range with those of another range.
... if the value of the parameter is invalid, a domexception with a notsupportederror code is thrown.
Range.setEnd() - Web APIs
WebAPIRangesetEnd
exceptions exceptions are thrown as domexception objects of the following types: invalidnodetypeerror the node specified by endnode is a doctype node; range endpoints cannot be located inside a doctype node.
... usage notes if the endnode is a node of type text, comment, or cdatasection, then endoffset is the number of characters from the start of endnode.
ReadableByteStreamController.close() - Web APIs
note: readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed.
... exceptions typeerror the source object is not a readablebytestreamcontroller, or the stream is not readable for some other reason.
ReadableStream.locked - Web APIs
the locked read-only property of the readablestream interface returns whether or not the readable stream is locked to a reader.
... syntax var locked = readablestream.locked; value a boolean indicating whether or not the readable stream is locked.
ReadableStream.tee() - Web APIs
since a response body cannot be consumed more than once, you’d need two copies to do this.
... exceptions typeerror the source stream is not a readablestream.
ReadableStreamBYOBReader.ReadableStreamBYOBReader() - Web APIs
note: you generally wouldn't use this constructor manually; instead, you'd use the readablestream.getreader() method.
... 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.
ReadableStreamBYOBReader.releaseLock() - Web APIs
a reader’s lock cannot be released while it still has a pending read request, i.e., if a promise returned by the reader’s readablestreambyobreader.read() method has not finished.
... exceptions typeerror the source object is not a readablestreambyobreader, or a read request is pending.
ReadableStreamDefaultController.close() - Web APIs
exceptions typeerror the source object is not a readablestreamdefaultcontroller.
... when a button is pressed, the generation is stopped, the stream is closed using readablestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream.
ReadableStreamDefaultController.desiredSize - Web APIs
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.
ReadableStreamDefaultController.enqueue() - Web APIs
exceptions typeerror the source object is not a readablestreamdefaultcontroller.
... when a button is pressed, the generation is stopped, the stream is closed using readablestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream.
ReadableStreamDefaultReader.releaseLock() - Web APIs
a reader’s lock cannot be released while it still has a pending read request, i.e., if a promise returned by the reader’s readablestreamdefaultreader.read() method has not finished.
... exceptions typeerror the source object is not a readablestreamdefaultreader, or a read request is pending.
ReadableStreamDefaultReader - Web APIs
the supplied reason argument will be given to the underlying source, which may or may not use it.
... examples in the following example, an artifical response is created to stream html fragments fetched from another resource to the browser.
ResizeObserverEntry.contentRect - Web APIs
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.
...if not, it uses contentrect.
Response.ok - Web APIs
WebAPIResponseok
the ok read-only property of the response interface contains a boolean stating whether the response was successful (status in the range 200-299) or not.
... note: at the top of the fetch() block we log the response ok value to the console.
Response.redirect() - Web APIs
WebAPIResponseredirect
note: this is mainly relevant to the serviceworker api.
... exceptions exception explanation rangeerror the specified status is not a redirect status.
Response.redirected - Web APIs
the read-only redirected property of the response interface indicates whether or not the response is the result of a request you made which was redirected.
...note, however, that this isn't as safe as outright rejecting redirects if they're unexpected, as described under disallowing redirects below.
Response.type - Web APIs
WebAPIResponsetype
note: an "error" response never really gets exposed to script: such a response to a fetch() would reject the promise.
... note that at the top of the fetch() block we log the response type to the console.
Response.useFinalURL - Web APIs
syntax var isfinalurl = response.usefinalurl; value a boolean indicating whether or not the url is final rather than a redirect.
... example consider a script residing in page index.html: fetch('/test').then((r) => console.log(r.url)) test.html is being controlled by the service worker sw.js: onfetch = (e) => { e.respondwith(fetch('/page2').then((r) => { r.usefinalurl = true; return r; }) } the output will be /page2 and not /test in index.html, since setting the usefinalurl means that the response's url is not set to request's url.
RsaOaepParams - Web APIs
label optional a buffersource — an array of bytes that does not itself need to be encrypted but which should be bound to the ciphertext.
... unless your application calls for a label, you can just omit this argument and it will not affect the security of the encryption operation.
SVGAElement - Web APIs
example in the example below, the target attribute of the <a> element is set to _blank and when the link is clicked, it logs to notify whether the condition is met or not.
...not _blank"); } } specifications specification status comment scalable vector graphics (svg) 2 candidate recommendation replaced inheritance from svgelement by svggraphicselement and removed the interface implementations of svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable by htmlhyperlinkelementutils scalable vector graphics (svg) 1.1 (second edition) recommendation initial definition ...
SVGAnimatedBoolean - Web APIs
if the given attribute or property is not currently being animated, contains the same value as baseval.
... methods the svganimatedboolean interface do not provide any specific methods.
SVGAnimatedEnumeration - Web APIs
if the given attribute or property is not currently being animated, contains the same value as baseval.
... methods the svganimatedenumeration interface do not provide any specific methods.
SVGAnimatedInteger - Web APIs
if the given attribute or property is not currently being animated, contains the same value as baseval.
... methods the svganimatedinteger interface do not provide any specific methods.
SVGAnimatedLength - Web APIs
if the given attribute or property is not currently being animated, contains the same value as baseval.
... methods the svganimatedlength interface do not provide any specific methods.
SVGAnimatedNumber - Web APIs
if the given attribute or property is not currently being animated, contains the same value as baseval.
... methods the svganimatednumber interface do not provide any specific methods.
SVGAnimatedPoints - Web APIs
if the given attribute or property is not currently being animated, contains the same value as points.
... methods the svganimatedpoints interface do not provide any specific methods.
SVGAnimatedString.animVal - Web APIs
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.
SVGAnimatedString - Web APIs
if the given attribute or property is not currently being animated, it contains the same value as baseval.
... methods the svganimatedstring interface do not provide any specific methods.
SVGAnimatedTransformList - Web APIs
if the given attribute is not currently being animated, then the svgtransformlist will have the same contents as baseval.
... the object referenced by animval will always be distinct from the one referenced by baseval, even when the attribute is not animated.
SVGAnimationElement: beginEvent event - Web APIs
it will be raised each time the element begins the active duration (i.e., when it restarts, but not when it repeats).
....createelement('li'); listitem.textcontent = 'beginevent fired'; list.appendchild(listitem); }) animateelem.addeventlistener('repeatevent', (e) => { let listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.detail; } listitem.textcontent = msg; list.appendchild(listitem); }) event handler property equivalent note that you can also create an event listener for the begin event using the onbegin event handler property: animateelem.onbegin = () => { console.log('beginevent fired'); } specifications specification status comment scalable vector graphics (svg) 2the definition of 'beginevent' in that specification.
SVGAnimationElement: endEvent event - Web APIs
note: this event is not raised at the simple end of each animation repeat.
....addeventlistener('repeatevent', (e) => { let listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.detail; } listitem.textcontent = msg; list.appendchild(listitem); }) btn.addeventlistener('click', () => { btn.disabled = true; animateelem.setattribute('repeatcount', '1'); }) event handler property equivalent note that you can also create an event listener for the end event using the onend event handler property: animateelem.onend = () => { console.log('endevent fired'); } specifications specification status comment scalable vector graphics (svg) 2the definition of 'endevent' in that specification.
SVGComponentTransferFunctionElement - Web APIs
="2px" /><text x="306" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgcomponenttransferfunctionelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_fecomponenttransfer_type_unknown 0 the type is not one of predefined types.
... methods this interface does not provide any specific methods, but implements those of its parent, svgelement.
SVGElement: error event - Web APIs
the error event is fired when an svg element does not load properly or when an error occurs during script execution.
... bubbles yes cancelable no interface svgevent event handler property onerror examples svgelem.addeventlistener('error', () => { console.log('svg not loaded properly.'); }) specifications specification status comment scalable vector graphics (svg) 2the definition of 'error' in that specification.
SVGElement - Web APIs
svgelement.classname read only an svganimatedstring that reflects the value of the class attribute on the given element, or the empty string if class is not present.
... error fired when an svg element does not load properly or when an error occurs during script execution.
SVGEvent - Web APIs
WebAPISVGEvent
bubbles read only boolean whether the event normally bubbles or not.
... cancelable read only boolean whether the event is cancellable or not.
SVGExternalResourcesRequired - Web APIs
note: the svg dom defines the attribute externalresourcesrequired as being of type svganimatedboolean, whereas the svg language definition says that the attribute is not animated.
... because the svg language definition states that externalresourcesrequired cannot be animated, the animval will always be the same as the baseval.
SVGFEBlendElement - Web APIs
stroke="#d4dde4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfeblendelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_feblend_mode_unknown 0 the type is not one of predefined types.
... methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and implements methods of svgfilterprimitivestandardattributes.
SVGFEColorMatrixElement - Web APIs
dde4" stroke-width="2px" /><text x="366" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfecolormatrixelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_fecolormatrix_type_unknown 0 the type is not one of predefined types.
... methods this interface does not provide any specific methods, but implements those of its parent, svgelement , and also implements methods of svgfilterprimitivestandardattributes.
SVGFECompositeElement - Web APIs
dde4" stroke-width="2px" /><text x="376" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfecompositeelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_fecomposite_operator_unknown 0 the type is not one of predefined types.
... methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEConvolveMatrixElement - Web APIs
ke="#d4dde4" stroke-width="2px" /><text x="351" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfeconvolvematrixelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_edgemode_unknown 0 the type is not one of predefined types.
... methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEDisplacementMapElement - Web APIs
ke="#d4dde4" stroke-width="2px" /><text x="346" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfedisplacementmapelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_channel_unknown 0 the type is not one of predefined types.
... methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEFuncAElement - Web APIs
ent" target="_top"><rect x="-79" y="65" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="6" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfefuncaelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface not provide any specific properties, but inherits properties from its parent interface, svgcomponenttransferfunctionelement.
... methods this interface does not provide any specific methods, but implements those of its parent, svgcomponenttransferfunctionelement.
SVGFEFuncBElement - Web APIs
ent" target="_top"><rect x="-79" y="65" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="6" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfefuncbelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface not provide any specific properties, but inherits properties from its parent interface, svgcomponenttransferfunctionelement.
... methods this interface does not provide any specific methods, but implements those of its parent, svgcomponenttransferfunctionelement.
SVGFEFuncGElement - Web APIs
ent" target="_top"><rect x="-79" y="65" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="6" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfefuncgelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface not provide any specific properties, but inherits properties from its parent interface, svgcomponenttransferfunctionelement.
... methods this interface does not provide any specific methods, but implements those of its parent, svgcomponenttransferfunctionelement.
SVGFEFuncRElement - Web APIs
ent" target="_top"><rect x="-79" y="65" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="6" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfefuncrelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface not provide any specific properties, but inherits properties from its parent interface, svgcomponenttransferfunctionelement.
... methods this interface does not provide any specific methods, but implements those of its parent, svgcomponenttransferfunctionelement.
SVGFEMergeElement - Web APIs
t" target="_top"><rect x="311" y="65" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfemergeelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface not provide any specific properties, but inherits properties from its parent interface, svgelement, and also implements properties of svgfilterprimitivestandardattributes.
... methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEMorphologyElement - Web APIs
dde4" stroke-width="2px" /><text x="371" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfemorphologyelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_morphology_operator_unknown 0 the type is not one of predefined types.
... methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGGeometryElement.isPointInFill() - Web APIs
return value a boolean indicating whether the given point is within the fill or not.
... example svg <svg viewbox="0 0 100 100" width="150" height="150" xmlns="http://www.w3.org/2000/svg"> <circle id="circle" cx="50" cy="50" r="45" fill="white" stroke="black" stroke-width="10"/> <circle cx="10" cy="10" r="5" fill="seagreen"/> <circle cx="40" cy="30" r="5" fill="seagreen"/> </svg> javascript var circle = document.getelementbyid('circle'); // point not in circle console.log('point at 10,10:', circle.ispointinfill(new dompoint(10, 10))); // point in circle console.log('point at 40,30:', circle.ispointinfill(new dompoint(40, 30))); result specifications specification status comment scalable vector graphics (svg) 2the definition of 'svggeometryelement.ispointinfill()' in that specification.
SVGGeometryElement.isPointInStroke() - Web APIs
return value a boolean indicating whether the given point is within the stroke or not.
...0 100" width="150" height="150" xmlns="http://www.w3.org/2000/svg"> <circle id="circle" cx="50" cy="50" r="45" fill="white" stroke="black" stroke-width="10"/> <circle cx="10" cy="10" r="5" fill="seagreen"/> <circle cx="40" cy="30" r="5" fill="seagreen"/> <circle cx="83" cy="17" r="5" fill="seagreen"/> </svg> javascript var circle = document.getelementbyid('circle'); // point not in circle console.log('point at 10,10:', circle.ispointinstroke(new dompoint(10, 10))); // point in circle but not stroke console.log('point at 40,30:', circle.ispointinstroke(new dompoint(40, 30))); // point in circle stroke console.log('point at 83,17:', circle.ispointinstroke(new dompoint(83, 17))); result specifications specification status comment scalable vect...
SVGGradientElement - Web APIs
stroke="#d4dde4" stroke-width="2px" /><text x="391" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svggradientelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_spreadmethod_unknown 0 the type is not one of predefined types.
... methods this interface does not provide any specific methods, but implements those of its parent, svgelement.
SVGGraphicsElement: copy event - Web APIs
however, the handler cannot read the clipboard data.
... it's possible to construct and dispatch a synthetic copy event, but this will not affect the system clipboard.
getBBox() - Web APIs
note: getbbox() must return the actual bounding box at the time the method was called—even in case the element has not yet been rendered.
... it also does not account for any transformation applied to the element or its parents.
SVGMarkerElement - Web APIs
_markerunits_strokewidth = 2 normative document svg 1.1 (2nd edition) constants orientation name value description svg_marker_orient_unknown 0 the marker orientation is not one of predefined types.
... units name value description svg_markerunits_unknown 0 the marker unit type is not one of predefined types.
SVGPathSeg - Web APIs
oth_abs = 18 pathseg_curveto_quadratic_smooth_rel = 19 normative document svg 1.1 (2nd edition) constants name value description pathseg_unknown 0 the unit type is not one of predefined types.
... methods the svgpathseg interface does not provide any specific methods.
SVGRect - Web APIs
WebAPISVGRect
if the attribute is not specified, the effect is as if a value of 0 were specified.
... svgrect.y the exact effect of this coordinate depends on each element.if the attribute is not specified, the effect is as if a value of 0 were specified.
SVGTransform - Web APIs
tants svg_transform_unknown = 0 svg_transform_matrix = 1 svg_transform_translate = 2 svg_transform_scale = 3 svg_transform_rotate = 4 svg_transform_skewx = 5 svg_transform_skewy = 6 normative document svg 1.1 (2nd edition) constants name value description svg_transform_unknown 0 the unit type is not one of predefined unit types.
...note that the values from the parameter matrix are copied.
SVGUseElement - Web APIs
if the element does not have a shadow tree (for example, because its uri is invalid or because it has been disabled by conditional processing), then getting this attribute returns null.
...if the element does not have a shadow tree (for example, because its uri is invalid or because it has been disabled by conditional processing), then getting this attribute returns null.
Screen.availLeft - Web APIs
WebAPIScreenavailLeft
syntax let availleft = window.screen.availleft; example let setx = window.screen.width - window.screen.availleft; let sety = window.screen.height - window.screen.availtop; window.moveto(setx, sety); notes in most cases, this property returns 0.
...that is, the primary screen's left edge always has the x coordinate 0, even if it's not the leftmost screen.
Screen.availTop - Web APIs
WebAPIScreenavailTop
specifies the y-coordinate of the first pixel that is not allocated to permanent or semipermanent user interface features.
... syntax let availtop = window.screen.availtop; example let setx = window.screen.width - window.screen.availleft; let sety = window.screen.height - window.screen.availtop; window.moveto(setx, sety); notes in most cases, this property returns 0.
Screen.mozBrightness - Web APIs
if you write a value of x into this attribute, the attribute may not have the same value x when you later read it.
... syntax let screenbrightness = window.screen.mozbrightness; specifications not part of specification.
Screen.unlockOrientation() - Web APIs
note: this method only works for installed web apps or for web pages in full-screen mode.
... working draft initial definition (not present in the draft anymore) ...
Screen.width - Web APIs
WebAPIScreenwidth
syntax lwidth = window.screen.width example // crude way to check that the screen is at least 1024x768 if (window.screen.width >= 1024 && window.screen.height >= 768) { // resolution is 1024x768 or above } notes note that not all of the width given by this property may be available to the window itself.
... when other widgets occupy space that cannot be used by the window object, there is a difference in window.screen.width and window.screen.availwidth.
Screen - Web APIs
WebAPIScreen
note that browsers determine which screen to report as current by detecting which screen has the center of the browser window.
... properties screen.availtop specifies the y-coordinate of the first pixel that is not allocated to permanent or semipermanent user interface features.
ScriptProcessorNode.bufferSize - Web APIs
note: as of the august 29 2014 web audio api spec publication, this feature has been marked as deprecated, and is soon to be replaced by audio workers.
... note: for a full working example, see our script-processor-node github repo (also view the source code.) var myscript = document.queryselector('script'); var mypre = document.queryselector('pre'); var playbutton = document.queryselector('button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode wit...
ScriptProcessorNode.onaudioprocess - Web APIs
note: as of the august 29 2014 web audio api spec publication, this feature has been marked as deprecated, and is soon to be replaced by audio workers.
... note: for a full working example, see our script-processor-node github repo (also view the source code.) var myscript = document.queryselector('script'); var mypre = document.queryselector('pre'); var playbutton = document.queryselector('button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessorno...
Selection.collapse() - Web APIs
the document is not modified.
...if not specified, the default value 0 is used.
Selection.extend() - Web APIs
WebAPISelectionextend
the anchor of the selection does not move.
...if not specified, the default value 0 is used.
Selection.isCollapsed - Web APIs
the selection.iscollapsed read-only property returns a boolean which indicates whether or not there is currently any text selected.
... keep in mind that a collapsed selection may still have one (or more, in gecko) ranges, so selection.rangecount may not be zero.
Selection.setBaseAndExtent() - Web APIs
note: if the focus position appears before the anchor position in the document, the direction of the selection is reversed — the caret is placed at the beginning of the text rather the end, which matters for any keyboard command that might follow.
... note: you can find this example on github (see it live also.) specifications specification status comment selection apithe definition of 'selection.setbaseandextent()' in that specification.
Sensor - Web APIs
WebAPISensor
this interface cannot be used directly.
...this is not something that would ever be shown to a user.
ServiceWorkerContainer - Web APIs
most importantly, it exposes the serviceworkercontainer.register() method used to register service workers, and the serviceworkercontainer.controller property used to determine whether or not the current page is actively controlled.
... 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.
ServiceWorkerGlobalScope.onmessage - Web APIs
note: service workers define the extendable event to allow extending the lifetime of the event.
... note: messages received from service worker contexts (e.g.
ServiceWorkerGlobalScope.onpush - Web APIs
the data payload of the push message is available in the event object's data property (pushevent.data, which contains a pushmessagedata object.) self.addeventlistener('push', function(event) { if (!(self.notification && self.notification.permission === 'granted')) { return; } var data = {}; if (event.data) { data = event.data.json(); } var title = data.title || "something has happened"; var message = data.message || "here's something you might want to check out."; var icon = "images/new-notification.png"; var notification = new notification(title, { body: message, ta...
...g: 'simple-push-demo-notification', icon: icon }); notification.addeventlistener('click', function() { if (clients.openwindow) { clients.openwindow('https://example.blog.com/2015/03/04/something-new.html'); } }); }); specifications specification status comment push apithe definition of 'onpush' in that specification.
ServiceWorkerRegistration.navigationPreload - Web APIs
full support 59edge full support 17 full support 17 full support 16disabled disabled from version 16: this feature is behind the enable service workers preference.firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support service workers and the push api.ie no support noopera full support 46safari full support 11.1webview android ...
...expect behavior to change in the future.see implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
ServiceWorkerRegistration.periodicSync - Web APIs
note: this feature was mentioned as an idea in the sw explainer at some point, but as yet has not been implemented anywhere.
... examples // tbd specifications currently not part of any specification.
ServiceWorkerRegistration.update() - Web APIs
it fetches the worker's script url, and if the new worker is not byte-by-byte identical to the current worker, it installs the new worker.
... note: this feature is available in web workers.
ShadowRoot.mode - Web APIs
WebAPIShadowRootmode
this defines whether or not the shadow root's internal features are accessible from javascript.
... examples let customelem = document.queryselector('my-shadow-dom-element'); let shadow = customelem.shadowroot; // another way to check whether the shadow root is open; it will return null if not if(shadow) { // if it is open, close it to stop people stealing our secrets!
SourceBuffer.removeAsync() - Web APIs
if that's not the case, call abort() instead.
... async function emptysourcebuffer(msbuffer) { await msbuffer.removeasync(0, infinity).catch(function(e) { handleexception(e); } } specifications not currently part of the mse specification.
SpeechGrammarList.addFromURI() - Web APIs
note that some speech recognition services may support built-in grammars that can be specified by uri.
...the value can be between 0.0 and 1.0; if not specified, the default used is 1.0.
SpeechRecognition.onnomatch - Web APIs
note: the onnomatch handler does not yet work properly in firefox — the speech recognition system always returns a positive match, and then guesses at what item in the grammar it found.
...}; examples var recognition = new speechrecognition(); recognition.onnomatch = function() { console.log('speech not recognised'); } specifications specification status comment web speech apithe definition of 'onnomatch' in that specification.
SpeechSynthesisVoice.default - Web APIs
the default read-only property of the speechsynthesisvoice interface returns a boolean indicating whether the voice is the default voice for the current app (true), or not (false.) note: for some devices, it might be the default voice for the voice's language.
... the spec is not very clear on which it should be, so some implementations may differ.
Storage.removeItem() - Web APIs
if there is no item associated with the given key, this method will do nothing.
... function populatestorage() { sessionstorage.setitem('bgcolor', 'red'); sessionstorage.setitem('font', 'helvetica'); sessionstorage.setitem('image', 'mycat.png'); sessionstorage.removeitem('image'); } note: to see this used within a real world example, see our web storage demo.
Storage - Web APIs
WebAPIStorage
if it doesn't, we run another function, populatestorage(), which uses storage.setitem() to set the item values, then runs setstyles().
... localstorage.getitem('font'); var currentimage = localstorage.getitem('image'); document.getelementbyid('bgcolor').value = currentcolor; document.getelementbyid('font').value = currentfont; document.getelementbyid('image').value = currentimage; htmlelem.style.backgroundcolor = '#' + currentcolor; pelem.style.fontfamily = currentfont; imgelem.setattribute('src', currentimage); } note: to see this running as a complete working example, see our web storage demo.
StorageEvent - Web APIs
a storageevent is sent to a window when a storage area it has access to is changed within the context of another document.
... canbubble optional a boolean indicating whether the event bubbles up through the dom or not.
StorageManager.estimate() - Web APIs
the returned values are not exact; between compression, deduplication, and obfuscation for security reasons, they will be imprecise.
...this variance is based on factors such as: how often the user visits public site popularity data user engagement signals like bookmarking, adding to homescreen, or accepting push notifications example in this example, we obtain the usage estimates and present the percentage of storage capacity currently used to the user.
StylePropertyMapReadOnly - Web APIs
we can add some css, or not.
...</p> <dl id="output"></dl> we add a touch of css with a custom property to better demonstrate the output: p { --somevariable: 1.6em; --someothervariable: translatex(33vw); --anothervariable: 42; line-height: var(--somevariable); } we add javascript to grab our paragraph and return back a definition list of all the default css property values using computedstylemap().
SubtleCrypto.verify() - Web APIs
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.
... examples note: you can try the working examples out on github.
SubtleCrypto - Web APIs
if you're not sure you know what you are doing, you probably shouldn't be using this api.
... 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".
SyncEvent.lastChance - Web APIs
the syncevent.lastchance read-only property of the syncevent interface returns true if the user agent will not make further synchronization attempts after the current attempt.
... syntax var lastchance = syncevent.lastchance value a boolean that indicates whether the user agent will not make further synchronization attempts after the current attempt.
Text.isElementContentWhitespace - Web APIs
note: you may simply replace it with /\s+/.test(text.data), /\s+/.test(text.nodevalue), or /\s+/.test(text.textcontent).
... the text.iselementcontentwhitespace read-only property returns a boolean flag indicating whether or not the text node's content consists solely of whitespace.
Text.wholeText - Web APIs
WebAPITextwholeText
syntax str = textnode.wholetext; notes and example suppose you have the following simple paragraph within your webpage (with some whitespace added to aid formatting throughout the code samples here), whose dom node is stored in the variable para: <p>thru-hiking is great!
...not separated by an element boundary) text nodes combined.
TextEncoder() - Web APIs
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.
... 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.
TextTrack.mode - Web APIs
WebAPITextTrackmode
usage notes the default mode is disabled, unless the default boolean attribute is specified, in which case the default mode is showing.
... when a text track is loaded in the disabled state, the corresponding webvtt file is not loaded until the state changes to either showing or hidden.
TextTrackList.onaddtrack - Web APIs
note: you can also add a handler for the addtrack event using addeventlistener().
... usage notes the addtrack event is called whenever a new track is added to the media element whose video tracks are represented by the texttracklist object.
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.
Touch() - Web APIs
WebAPITouchTouch
the value must not be negative.
...the value must not be negative.
Touch.clientX - Web APIs
WebAPITouchclientX
the touch.clientx read-only property returns the x coordinate of the touch point relative to the viewport, not including any scroll offset.
... syntax touchitem.clientx; return value a long representing the x coordinate of the touch point relative to the viewport, not including any scroll offset.
Touch.clientY - Web APIs
WebAPITouchclientY
the touch.clienty read-only property returns the y coordinate of the touch point relative to the browser's viewport, not including any scroll offset.
... syntax touchitem.clienty; return value a long value representing the y coordinate of the touch point relative to the viewport, not including any scroll offset.
Touch.screenX - Web APIs
WebAPITouchscreenX
summary returns the x coordinate of the touch point relative to the screen, not including any scroll offset.
... syntax var x = touchitem.screenx; return value x the x coordinate of the touch point relative to the screen, not including any scroll offset.
Touch.screenY - Web APIs
WebAPITouchscreenY
summary returns the y coordinate of the touch point relative to the screen, not including any scroll offset.
... syntax var y = touchitem.screeny; return value y the y coordinate of the touch point relative to the screen, not including any scroll offset.
TouchEvent.altKey - Web APIs
WebAPITouchEventaltKey
summary a boolean value indicating whether or not the alt (alternate) key is enabled when the touch event is created.
... syntax var altenabled = touchevent.altkey; return value altenabled true if the alt key is enabled for this event; and false if the alt is not enabled.
TouchEvent.shiftKey - Web APIs
summary a boolean value indicating whether or not the shift key is enabled when the touch event is created.
... syntax var shiftenabled = touchevent.shiftkey; return value shiftenabled true if the shift key is enabled for this event; and false if the shift key is not enabled.
TrackEvent - Web APIs
it's important not to confuse trackevent with the rtctrackevent interface, which is used for tracks which are part of an rtcpeerconnection.
...if not null, this is always an object of one of the media track types: audiotrack, videotrack, or texttrack).
TransitionEvent - Web APIs
this value is not affected by the transition-delay property.
... transitionrun an event fired when a css transition is created, when it is added to a set of running transitions, though not nessarilty started transitionstart an event fired when a css transition has started transitioning.
UIEvent.layerX - Web APIs
WebAPIUIEventlayerX
note the pagex\pagey properties still return the absolute position in the document, including page scrolling.</span> <span>make the page scroll more!
...note the pagex\pagey properties still return the absolute position in the document, including page scrolling.</span> </div> <div id="d3"> <form name="form_coords" id="form1"> parent element id: <input type="text" name="parentid" size="7" /><br /> pagex:<input type="text" name="pagexcoords" size="7" /> pagey:<input type="text" name="pageycoords" size="7" /><br /> layerx:<input type="text" name="layerxcoords" size="7" /> layery:<input type="text" name="layerycoords" size="7" /> </form> </div> </body> </html> specifications this property is not part of any specification.
UIEvent.layerY - Web APIs
WebAPIUIEventlayerY
note the pagex\pagey properties still return the absolute position in the document, including page scrolling.</span> <span>make the page scroll more!
...note the pagex\pagey properties still return the absolute position in the document, including page scrolling.</span> </div> <div id="d3"> <form name="form_coords" id="form1"> parent element id: <input type="text" name="parentid" size="7" /><br /> pagex:<input type="text" name="pagexcoords" size="7" /> pagey:<input type="text" name="pageycoords" size="7" /><br /> layerx:<input type="text" name="layerxcoords" size="7" /> layery:<input type="text" name="layerycoords" size="7" /> </form> </div> </body> </html> specifications this property is not part of any specification.
UIEvent.pageY - Web APIs
WebAPIUIEventpageY
note the pagex\pagey properties still return the absolute position in the document, including page scrolling.</span> <span>make the page scroll more!
...note the pagex\pagey properties still return the absolute position in the document, including page scrolling.</span> </div> <div id="d3"> <form name="form_coords"> parent element id: <input type="text" name="parentid" size="7" /><br /> pagex:<input type="text" name="pagexcoords" size="7" /> pagey:<input type="text" name="pageycoords" size="7" /><br /> layerx:<input type="text" name="layerxcoords" size="7" /> layery:<input type="text" name="layerycoords" size="7" /> </form> </div> </body> </html> specifications this property is not part of any specification.
URL.host - Web APIs
WebAPIURLhost
note: this feature is available in web workers.
... examples let url = new url('/docs/web/api/url/host'); console.log(url.host); // "developer.mozilla.org" url = new url('https://developer.mozilla.org:443/docs/web/api/url/host'); console.log(url.host); // "developer.mozilla.org" // the port number is not included because 443 is the scheme's default port url = new url('https://developer.mozilla.org:4097/docs/web/api/url/host'); console.log(url.host); // "developer.mozilla.org:4097" specifications specification status comment urlthe definition of 'url.host' in that specification.
URL.port - Web APIs
WebAPIURLport
if the url does not contain an explicit port number, it will be set to ''.
... note: this feature is available in web workers.
URL - Web APIs
WebAPIURL
note: this feature is available in web workers.
... usage notes the constructor takes a url parameter, and an optional base parameter to use as a base if the url parameter is a relative url: const url = new url('../cats', 'http://www.example.com/dogs'); console.log(url.hostname); // "www.example.com" console.log(url.pathname); // "/cats" url properties can be set to construct the url: url.hash = 'tabby'; console.log(url.href); // "http://www.example.co...
URLSearchParams - Web APIs
an object implementing urlsearchparams can directly be used in a for...of structure, for example the following two lines are equivalent: for (const [key, value] of mysearchparams) {} for (const [key, value] of mysearchparams.entries()) {} note: this feature is available in web workers.
...hparams.get("foo") === null; // true searchparams.append("topic", "webdev"); searchparams.tostring(); // "q=urlutils.searchparams&topic=api&topic=webdev" searchparams.set("topic", "more webdev"); searchparams.tostring(); // "q=urlutils.searchparams&topic=more+webdev" searchparams.delete("topic"); searchparams.tostring(); // "q=urlutils.searchparams" gotchas the urlsearchparams constructor does not parse full urls.
URL API - Web APIs
WebAPIURL API
for example, to create a url and set its username: let myusername = "someguy"; let addr = new url("https://mysite.com/login"); addr.username = myusername; setting the value of username not only sets that property's value, but it updates the overall url.
... note the call to urlsearchparams.sort() to sort the parameter list before generating the table.
USB.requestDevice() - Web APIs
WebAPIUSBrequestDevice
notice that two product ids are specified.
... the number of filters does not specifiy the number of devices shown by the user agent.
VideoPlaybackQuality.droppedVideoFrames - Web APIs
this information can be used to determine whether or not to downgrade the video stream to avoid dropping frames.
... frames are typically dropped either before or after decoding them, when it's determined that it will not be possible to draw them to the screen at the correct time.
VideoTrack.selected - Web APIs
the videotrack property selected controls whether or not a particular video track is active.
...only a single video track can be active at any given time, so setting this property to true for one track while another track is active will make that other track inactive.
VideoTrackList.onaddtrack - Web APIs
note: you can also add a handler for the addtrack event using addeventlistener().
... usage notes the addtrack event is called whenever a new track is added to the media element whose video tracks are represented by the videotracklist object.
VisualViewport - Web APIs
note: only the top-level window has a visual viewport that's distinct from the layout viewport.
... bottombar.style.transform = 'translate(' + offsetleft + 'px,' + offsettop + 'px) ' + 'scale(' + 1/viewport.scale + ')' } window.visualviewport.addeventlistener('scroll', viewporthandler); window.visualviewport.addeventlistener('resize', viewporthandler); note: this technique should be used with care; emulating position: device-fixed in this way can result in the fixed element flickering during scrolling.
WEBGL_draw_buffers.drawBuffersWEBGL() - Web APIs
note: when using webgl2, this method is available as gl.drawbuffers() by default and the constants are named gl.color_attachment1 etc.
...possible values: gl.none: the fragment shader is not written to any color buffer.
WaveShaperNode.curve - Web APIs
note: the array can be a null value: in that case, no distortion is applied to the input signal.
... note: sigmoid functions are commonly used for distortion curves because of their natural properties.
WaveShaperNode.oversample - Web APIs
the possible oversample values are: value effect 'none' do not perform any oversampling.
... note: sigmoid functions are commonly used for distortion curves because of their natural properties.
WaveShaperNode - Web APIs
number of inputs 1 number of outputs 1 channel count mode "max" channel count 2 (not used in the default count mode) channel interpretation "speakers" constructor waveshapernode() creates a new instance of an waveshapernode object.
... note: sigmoid functions are commonly used for distortion curves because of their natural properties.
WebGL2RenderingContext.clientWaitSync() - Web APIs
must not be larger than gl.max_client_wait_timeout_webgl.
... gl.timeout_expired: indicates that the timeout time passed and that the sync object did not become signaled.
WebGL2RenderingContext.drawBuffers() - Web APIs
possible values are: gl.none: fragment shader output is not written into any color buffer.
... exceptions if buffers contains not one of the accepted values, a gl.invalid_enum error is thrown.
WebGL2RenderingContext.drawElementsInstanced() - Web APIs
note: when using webgl 1, the angle_instanced_arrays extension can provide this method, too.
... exceptions if mode is not one of the accepted values, a gl.invalid_enum error is thrown.
WebGL2RenderingContext.getBufferSubData() - Web APIs
gl.copy_read_buffer: buffer for copying from one buffer object to another.
... gl.copy_write_buffer: buffer for copying from one buffer object to another.
WebGL2RenderingContext.isQuery() - Web APIs
return value a glboolean indicating whether the given object is a valid webglquery object (true) or not (false).
...webglquery objects are not available in webgl 1.
WebGL2RenderingContext.isSampler() - Web APIs
return value a glboolean indicating whether the given object is a valid webglsampler object (true) or not (false).
...webglsampler objects are not available in webgl 1.
WebGL2RenderingContext.isSync() - Web APIs
return value a glboolean indicating whether the given object is a valid webglsync object (true) or not (false).
...webglsync objects are not available in webgl 1.
WebGL2RenderingContext.isTransformFeedback() - Web APIs
return value a glboolean indicating whether the given object is a valid webgltransformfeedback object (true) or not (false).
...webgltransformfeedback objects are not available in webgl 1.
WebGL2RenderingContext - Web APIs
you will find this info noted on the webgl 1 reference pages.
... webgl2renderingcontext.copybuffersubdata() copies part of the data of a buffer to another buffer.
WebGLQuery - Web APIs
another kind of queries are disjoint timer queries, which allow you to measure performance and profiling of your gpu.
...webglquery objects are not available in webgl 1.
WebGLRenderingContext.blendFunc() - Web APIs
exceptions if sfactor or dfactor is not one of the listed possible values, a gl.invalid_enum error is thrown.
... in webgl, constant color and constant alpha cannot be used together as source and destination factors in the blend function.
WebGLRenderingContext.blendFuncSeparate() - Web APIs
exceptions if srcrgb, dstrgb, srcalpha, or dstalpha is not one of the listed possible values, a gl.invalid_enum error is thrown.
... in webgl, constant color and constant alpha cannot be used together as source and destination factors in the blend function.
WebGLRenderingContext.drawElements() - Web APIs
exceptions if mode is not one of the accepted values, a gl.invalid_enum error is thrown.
... if offset is not a valid multiple of the size of the given type, a gl.invalid_operation error is thrown.
WebGLRenderingContext.getActiveUniform() - Web APIs
exceptions gl.invalid_value is generated if the program webglprogram is invalid (not linked, deleted, etc.).
... gl.invalid_value is generated if index is not in the range [0, gl.getprogramparameter(program, gl.active_uniforms) - 1].
WebGLRenderingContext.getBufferParameter() - Web APIs
when using a webgl 2 context, the following values are available additionally: gl.copy_read_buffer: buffer for copying from one buffer object to another.
... gl.copy_write_buffer: buffer for copying from one buffer object to another.
WebGLRenderingContext.getShaderParameter() - Web APIs
possible values: gl.delete_status: returns a glboolean indicating whether or not the shader is flagged for deletion.
... gl.compile_status: returns a glboolean indicating whether or not the last shader compilation was successful.
WebGLRenderingContext.isEnabled() - Web APIs
the webglrenderingcontext.isenabled() method of the webgl api tests whether a specific webgl capability is enabled or not for this context.
... return value a glboolean indicating if the capability cap is enabled (true), or not (false).
WebGLRenderingContext.makeXRCompatible() - Web APIs
usage notes because makexrcompatible() may involve replacing the underlying webgl context with a new one that uses the new rendering hardware, the existing contents of the context may be lost and, therefore, would need to be re-rendered.
...note the inclusion of a use-webxr class on the vr mode button.
Boilerplate 1 - Web APIs
]</button> <canvas>your browser does not seem to support html5 canvas.</canvas> css body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } javascript function getrenderingcontext() { var canvas = document.queryselector("...
...canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } the source code of this example is also available on github.
Raining rectangles - Web APIs
you missed <strong>0</strong>.</p> <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; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } ;(function(){ "use strict" window.addeventlistener("load", setupanimation, false); v...
... function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } })(); the source code of this example is also available on github.
Simple color animation - Web APIs
<p>a simple webgl program that shows color animation.</p> <p>you can click the button below to toggle the color animation on or off.</p> <canvas id="canvas-view">your browser does not seem to support html5 canvas.</canvas> <button id="animation-onoff"> press here to <strong>[verb goes here]</strong> the animation </button> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : inline-block; font-size : inherit; margin : auto;...
... 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.
WebGL by example - Web APIs
you should read all comments, because more advanced examples could not repeat comments about parts of the code that were previously explained.
... canvas size and webgl the example explores the effect of setting (or not setting) the canvas size to its element size in css pixels, as it appears in the browser window.
WebGL tutorial - Web APIs
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.
WebRTC API - Web APIs
you can be notified before closing completes by watching for the closing event instead.
...this event does not bubble (except where otherwise stated) and is not cancelable (except where otherwise stated).
WebSocket.bufferedAmount - Web APIs
the websocket.bufferedamount read-only property returns the number of bytes of data that have been queued using calls to send() but not yet transmitted to the network.
...this value does not reset to zero when the connection is closed; if you keep calling send(), this will continue to climb.
Targeting and hit detection - Web APIs
consider these just editor's notes for now.
... testing for collisions with the real world is a different problem, which may involve not only interpreting the imagery from the device's camera (if available) but also potentially multiple additional sensors.
Web NFC API - Web APIs
note: devices and tags have to be formatted and recorded specifically to support ndef record format to be used with web nfc.
... low-level operations are currently not supported by the api, however there is a public discussion about api that would add such functuionality.
WheelEvent - Web APIs
do not confuse the wheel event with the scroll event: the default action of a wheel event is implementation-defined.
...therefore, do not rely on delta* properties to get the content's scrolling direction.
Window.alert() - Web APIs
WebAPIWindowalert
example window.alert("hello world!"); alert("hello world!"); both produce: notes the alert dialog should be used for messages which do not require any response on the part of the user, other than the acknowledgement of the message.
...for this reason, you should not overuse any function that creates a dialog box (or modal window).
Window: animationiteration event - Web APIs
the animationiteration event is fired when an iteration of a css animation ends, and another one begins.
... this event does not occur at the same time as the animationend event, and therefore does not occur for animations with an animation-iteration-count of one.
Window.back() - Web APIs
WebAPIWindowback
note: use the standard history.back method instead.
... function handlemybackbutton() { if (cangoback) { window.back(); } } specification this is not part of any specification.
Window.closed - Web APIs
WebAPIWindowclosed
the window.closed read-only property indicates whether the referenced window is closed or not.
...before attempting to change the url, it checks that the current window has an opener using the window.opener property and that the opener isn't closed: // check that an opener exists and is not closed if (window.opener && !window.opener.closed) { window.opener.location.href = 'http://www.mozilla.org'; } note that popups can only access the window that opened them.
Window.confirm() - Web APIs
WebAPIWindowconfirm
example if (window.confirm("do you really want to leave?")) { window.open("exit.html", "thanks for visiting!"); } produces: notes the following text is shared between this article, dom:window.prompt and dom:window.alert dialog boxes are modal windows — they prevent the user from accessing the rest of the program's interface until the dialog box is closed.
... for this reason, you should not overuse any function that creates a dialog box (or modal window).
Window.console - Web APIs
WebAPIWindowconsole
these methods are intended for debugging purposes only and should not be relied on for presenting information to end users.
... currently there are many implementation differences among browsers, but work is being done to bring them together and make them more consistent with one another.
Window.controllers - Web APIs
not part of specification.
... however, the added controllers must be explicitly removed when the window is unloaded, as this is not done automatically.
Window.convertPointFromPageToNode - Web APIs
please review the browser compatibility section before using this method, as it's not widely supported (nor is the point object it uses).
...it is not present in the current css transforms module level 1 working draft.
Window.forward() - Web APIs
WebAPIWindowforward
note: use the standard window.history.forward() method instead.
... example function goforward() { if (cangoforward) { window.forward(); } } specification this is not part of any specification.
Window.frameElement - Web APIs
note: despite this property's name, it works for documents embedded within any embedding point, including <object>, <iframe>, or <embed>.
...if the window isn't embedded into another document, or if the document into which it's embedded has a different origin, the value is null instead.
Window.frames - Web APIs
WebAPIWindowframes
it is similar to an array in that it has a length property and its items can be accessed using the [i] notation.
... each item in the window.frames pseudo-array represents the window object corresponding to the given <frame>'s or <iframe>'s content, not the (i)frame dom element (i.e., window.frames[0] is the same thing as document.getelementsbytagname("iframe")[0].contentwindow).
Window.getAttention() - Web APIs
syntax window.getattention(); notes on windows, the taskbar button for the window flashes, if this hasn't been disabled by the user.
...not part of specification.
Window.getDefaultComputedStyle() - Web APIs
must be null (or not specified) for regular elements.
... <style> h3:after { content: ' rocks!'; } </style> <h3>generated content</h3> <script> var h3 = document.queryselector('h3'), result = getdefaultcomputedstyle(h3, ':after').content; console.log('the generated content is: ', result); // returns 'none' </script> notes the returned value is, in certain known cases, expressly incorrect by deliberate intent.
Window.localStorage - Web APIs
exceptions securityerror the request violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if the origin uses the file: or data: scheme, for example).
... localstorage.setitem('mycat', 'tom'); the syntax for reading the localstorage item is as follows: const cat = localstorage.getitem('mycat'); the syntax for removing the localstorage item is as follows: localstorage.removeitem('mycat'); the syntax for removing all the localstorage items is as follows: localstorage.clear(); note: please refer to the using the web storage api article for a full example.
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.
... bubbles no cancelable no interface messageevent event handler property onmessage examples suppose a script sends a message to a different browsing context, such as another <iframe>, using code like this: const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const windowmessagebutton = document.queryselector('#window-message'); windowmessagebutton.addeventlistener('click', () => { targetframe.postmessage('hello there', targetorigin); }); the receiver can listen for the message using addeventlistener() with code like this: window.addeventlistener('message', (event) => { console.log(`received message: ${event.data}`); }); alternatively the listener could use the onmessage event handler property...
Window.mozInnerScreenX - Web APIs
note: this coordinate is reported in css pixels, not in hardware pixels.
... specification not part of any w3c technical specification or recommendation.
Window.mozInnerScreenY - Web APIs
note: this coordinate is reported in css pixels, not in hardware pixels.
... specification not part of any w3c technical specification or recommendation.
Window.onmozbeforepaint - Web APIs
notes this event fires immediately before the browser window is repainted, if the event has been requested by one or more scripts calling window.mozrequestanimationframe().
... specification not part of a specification.
Obsolete features - Web APIs
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 does not really work in msie 6 sp2.
Window.personalbar - Web APIs
due to deprecation of enableprivilege this functionality can not be used in web pages.
... <!doctype html> <html> <head> <title>various dom tests</title> <script> // changing bar states on the existing window netscape.security.privilegemanager.enableprivilege("universalbrowserwrite"); window.personalbar.visible = !window.personalbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> notes when you load the example page above, the browser displays the following dialog: to toggle the visibility of these bars, you must either sign your scripts or enable the appropriate privileges, as in the example above.
Window.requestFileSystem() - Web APIs
even compared to the rest of the file and directory entries api, requestfilesystem() is especially non-standard; only chrome implements it, and all other browser makers have decided that they will not implement it.
...do not use this method!
Window.routeEvent() - Web APIs
WebAPIWindowrouteEvent
not for use in new websites.deprecated.
... not for use in new websites.
Window.screenLeft - Web APIs
WebAPIWindowscreenLeft
note: screenleft is an alias of the older window.screenx property.
...tupdate + (width/2), topupdate + (height/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); also in the code we include a snippet that detects whether screenleft is supported, and if not, polyfills in screenleft/screentop using window.screenx/window.screeny.
Window.screenTop - Web APIs
WebAPIWindowscreenTop
note: screentop is an alias of the older window.screeny property.
...tupdate + (width/2), topupdate + (height/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); also in the code we include a snippet that detects whether screenleft is supported, and if not, polyfills in screenleft/screentop using window.screenx/window.screeny.
Window.screenX - Web APIs
WebAPIWindowscreenX
note: an alias of screenx was implemented across modern browsers in more recent times — window.screenleft.
... also in the code we include a snippet that detects whether screenleft is supported, and if not, polyfills in screenleft/screentop using screenx/screeny.
Window.screenY - Web APIs
WebAPIWindowscreenY
note: an alias of screeny was implemented across modern browsers in more recent times — window.screentop.
... also in the code we include a snippet that detects whether screenleft is supported, and if not, polyfills in screenleft/screentop using screenx/screeny.
Window.scrollMaxX - Web APIs
WebAPIWindowscrollMaxX
example // scroll to right edge of the page let maxx = window.scrollmaxx; window.scrollto(maxx, 0); notes do not use this property to get the total document width, which is not equivalent to window.innerwidth + window.scrollmaxx, because window.innerwidth includes the width of any visible vertical scrollbar, thus the result would exceed the total document width by the width of any visible vertical scrollbar.
... specification this is not part of any specification.
Window.scrollMaxY - Web APIs
WebAPIWindowscrollMaxY
example // scroll to the bottom of the page let maxy = window.scrollmaxy; window.scrollto(0, maxy); notes do not use this property to get the total document height, which is not equivalent to window.innerheight + window.scrollmaxy, because window.innerheight includes the width of any visible horizontal scrollbar, thus the result would exceed the total document height by the width of any visible horizontal scrollbar.
... specification this is not part of any specification.
Window.scrollX - Web APIs
WebAPIWindowscrollX
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.
Window.scrollY - Web APIs
WebAPIWindowscrollY
} window.scrollbypages(1); notes use this property to check that the document hasn't already been scrolled when using relative scroll functions such as scrollby(), scrollbylines(), or scrollbypages().
...additionally, older versions of internet explorer (< 9) do not support either property and must be worked around by checking other non-standard properties.
Window.sessionStorage - Web APIs
exceptions securityerror the request violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if the origin uses the file: or data: scheme, for example).
...s will only happen if the page is accidentally refreshed) if (sessionstorage.getitem("autosave")) { // restore the contents of the text field field.value = sessionstorage.getitem("autosave"); } // listen for changes in the text field field.addeventlistener("change", function() { // and save the results into the session storage object sessionstorage.setitem("autosave", field.value); }); note: please refer to the using the web storage api article for a full example.
Window.setCursor() - Web APIs
WebAPIWindowsetCursor
"wait" : "auto"); } notes the cursor isn't reset until it's set back to auto.
... specification this is not part of any specification.
Window.toolbar - Web APIs
WebAPIWindowtoolbar
due to deprecation of enableprivilege this functionality can not be used in web pages.
... <!doctype html> <html> <head> <title>various dom tests</title> <script> // changing bar states on the existing window netscape.security.privilegemanager.enableprivilege("universalbrowserwrite"); window.toolbar.visible=!window.toolbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> notes when you load the example page above, the browser displays the following dialog: to toggle the visibility of these bars, you must either sign your scripts or enable the appropriate privileges, as in the example above.
Window: transitionend event - Web APIs
in the case where a transition is removed before completion, such as if the transition-property is removed or display is set to none, then the event will not be generated.
...if the transitioncancel event is fired, the transitionend event will not fire.
Window.updateCommands() - Web APIs
notes this enables or disables items (setting or clearing the "disabled" attribute on the command node as appropriate), or ensures that the command state reflects the state of the selection by setting current state information in the "state" attribute of the xul command nodes.
...not part of specification.
WindowEventHandlers.onbeforeunload - Web APIs
note: to combat unwanted pop-ups, some browsers don't display prompts created in beforeunload event handlers unless the page has been interacted with.
...default behavior in mozilla firefox prompt will always be shown // chrome requires returnvalue to be set e.returnvalue = ''; }); guarantee the browser unload by removing the returnvalue property of the event window.addeventlistener('beforeunload', function (e) { // the absence of a returnvalue property on the event will guarantee the browser unload happens delete e['returnvalue']; }); notes when your page uses javascript to render content, the javascript may stop when leaving and then navigating back to the page.
WindowEventHandlers.onmessageerror - Web APIs
the onmessageerror event handler of the windoweventhandlers interface is an eventlistener, called whenever an messageevent of type messageerror is fired on a window—that is, when it receives a message that cannot be deserialized.
... note: this feature is available in web workers.
WindowEventHandlers.onpopstate - Web APIs
note: calling history.pushstate() or history.replacestate() won't trigger a popstate event.
...e 1", "?page=1"); history.pushstate({page: 2}, "title 2", "?page=2"); history.replacestate({page: 3}, "title 3", "?page=3"); history.back(); // alerts "location: http://example.com/example.html?page=1, state: {"page":1}" history.back(); // alerts "location: http://example.com/example.html, state: null history.go(2); // alerts "location: http://example.com/example.html?page=3, state: {"page":3} note that even though the original history entry (for http://example.com/example.html) has no state object associated with it, a popstate event is still fired, when we activate that entry after the second call to history.back().
WindowEventHandlers.onstorage - Web APIs
the storage event fires when a storage area has been changed in the context of another document.
... example this example logs the value for a storage key whenever it changes in another document.
WindowEventHandlers - Web APIs
note: windoweventhandlers is a mixin and not an interface; you can't actually create an object of type windoweventhandlers.
... windoweventhandlers.onunhandledrejection is an eventhandler representing the code to be called when the unhandledrejection event is raised, indicating that a promise was rejected but the rejection was not handled.
WindowOrWorkerGlobalScope.atob() - Web APIs
for use with unicode or utf-8 strings, see the note on "unicode strings" in the page for btoa().
... exceptions domexception (name: invalidcharactererror) throws if encodeddata is not valid base64.
WindowOrWorkerGlobalScope.btoa() - Web APIs
exceptions invalidcharactererror the string contained a character that did not fit in a single byte.
...so if you pass a string into btoa() containing characters that occupy more than one byte, you will get an error, because this is not considered binary data: const ok = "a"; console.log(ok.codepointat(0).tostring(16)); // 61: occupies < 1 byte const notok = "✓" console.log(notok.codepointat(0).tostring(16)); // 2713: occupies > 1 byte console.log(btoa(ok)); // yq== console.log(btoa(notok)); // error if you need to encode unicode text as ascii using btoa(), one option is to convert the string such that each 16-bit uni...
WindowOrWorkerGlobalScope.clearTimeout() - Web APIs
it's worth noting that the pool of ids used by settimeout() and setinterval() are shared, which means you can technically use cleartimeout() and clearinterval() interchangeably.
...{ alert(amessage); this.timeoutid = undefined; }, setup: function() { if (typeof this.timeoutid === 'number') { this.cancel(); } this.timeoutid = window.settimeout(function(msg) { this.remind(msg); }.bind(this), 1000, 'wake up!'); }, cancel: function() { window.cleartimeout(this.timeoutid); } }; window.onclick = function() { alarm.setup(); }; notes passing an invalid id to cleartimeout() silently does nothing; no exception is thrown.
WindowOrWorkerGlobalScope - Web APIs
note: windoworworkerglobalscope is a mixin and not an interface; you can't actually create an object of type windoworworkerglobalscope.
... windoworworkerglobalscope.issecurecontext read only returns a boolean indicating whether the current context is secure (true) or not (false).
Worker.onmessage - Web APIs
WebAPIWorkeronmessage
note: the message payload is available in the message event's data property.
...ult.textcontent = e.data; console.log('message received from worker'); } in the worker.js script, an onmessage handler is used to the handle messages from the main script: onmessage = function(e) { console.log('message received from main script'); var workerresult = 'result: ' + (e.data[0] * e.data[1]); console.log('posting message back to main script'); postmessage(workerresult); } notice how in the main script, onmessage has to be called on myworker, whereas inside the worker script you just need onmessage because the worker is effectively the global scope (dedicatedworkerglobalscope).
Worker.onmessageerror - Web APIs
the onmessageerror event handler of the worker interface is an eventlistener, called whenever an messageevent of type messageerror is fired on the worker instance — that is, when it receives a message that cannot be deserialized.
... note: this feature is available in web workers.
WorkerGlobalScope.performance - Web APIs
not all performance properties and methods are available to web workers.
... note: firefox has a bug with using console.log inside shared/service workers (see bug 1058644), which may return strange results, but this should be fixed soon.
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
note: you generally wouldn't use this constructor manually; instead, you'd use the writablestream.getwriter() method.
... exceptions typeerror the provided stream value is not a writablestream, or it is locked to another writer already.
WritableStreamDefaultWriter.abort() - Web APIs
if not, it returns a rejected promise.
... exceptions typeerror the stream you are trying to abort is not a writablestream, or it is locked.
WritableStreamDefaultWriter.desiredSize - Web APIs
note that this can be negative if the queue is over-full.
... the value will be null if the stream cannot be successfully written to (due to either being errored, or having an abort queued up), and zero if the stream is closed.
WritableStreamDefaultWriter.write() - Web APIs
note that what "success" means is up to the underlying sink; it might indicate simply that the chunk has been accepted, and not necessarily that it is safely saved to its ultimate destination.
... exceptions typeerror the target stream is not a writable stream, or it does not have an owner.
XDomainRequest.onerror - Web APIs
note: there is no way to determine the cause of the error from the xdomainrequest interface.
... example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.onerror = function(){ //handle error } xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification.
XDomainRequest.onprogress - Web APIs
note: while handling this event, you can look at xdomainrequest.responsetext to get the response so far.
... example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.onprogress = function(){ //handle partial response with xdr.responsetext } xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification.
XDomainRequest.responseText - Web APIs
note: this property is valid during the xdomainrequest.onprogress and xdomainrequest.onload events.
... example var response = xdr.responsetext; specification not part of any specification.
XMLHttpRequest.getAllResponseHeaders() - Web APIs
note: for multipart requests, this returns the headers from the current part of the request, not from the original channel.
... note: in modern browsers, the header names are returned in all lower case, as per the latest spec.
XMLHttpRequest.getResponseHeader() - Web APIs
note: the search for the header name is case-insensitive.
... return value a bytestring representing the header's text value, or null if either the response has not yet been received or the header doesn't exist in the response.
XMLHttpRequest.openRequest() - 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.
XMLHttpRequest.response - Web APIs
the value is null if the request is not yet complete or was unsuccessful, with the exception that when reading text data using a responsetype of "text" or the empty string (""), the response can contain the response so far while the request is still in the loading readystate (3).
... the content is handled as raw text data (since nothing here is overriding the default responsetype).
XMLHttpRequest.upload - Web APIs
timeout ontimeout the upload timed out because a reply did not arrive within the time interval specified by the xmlhttprequest.timeout.
...this event does not differentiate between success or failure, and is sent at the end of the upload regardless of the outcome.
XMLSerializer - Web APIs
note: in the real world, you should usually instead call importnode() method to import the new node into the dom, then call one of the following methods to add the node to the dom tree: the document and element methods append() and prepend() the node.replacewith() method (to replace an existing node with the new one) the document.insertadjacentelement() and element.insertadjacentelement() method...
... because insertadjacenthtml() accepts a string and not a node as its second parameter, xmlserializer is used to first convert the node into a string.
XPathEvaluator.createExpression() - Web APIs
exceptions invalid_expression_err if the expression is not legal according to the rules of the xpathevaluator, an xpathexception of type invalid_expression_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.
XPathException - Web APIs
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.
XPathResult.booleanValue - Web APIs
note: this feature is available in web workers.
... exceptions type_err in case xpathresult.resulttype is not boolean_type, an xpathexception of type type_err is thrown.
XPathResult.numberValue - Web APIs
note: this feature is available in web workers.
... exceptions type_err in case xpathresult.resulttype is not number_type, an xpathexception of type type_err is thrown.
XPathResult.singleNodeValue - Web APIs
note: this feature is available in web workers.
... exceptions type_err in case xpathresult.resulttype is not any_unordered_node_type or first_ordered_node_type, an xpathexception of type type_err is thrown.
XPathResult.snapshotLength - Web APIs
note: this feature is available in web workers.
... exceptions type_err in case xpathresult.resulttype is not unordered_node_snapshot_type or ordered_node_snapshot_type, an xpathexception of type type_err is thrown.
XPathResult.stringValue - Web APIs
note: this feature is available in web workers.
... exceptions type_err in case xpathresult.resulttype is not string_type, an xpathexception of type type_err is thrown.
XRInputSource - Web APIs
note: while xrinputsource uses the gamepad interface from the gamepad api, this input device is strictly associated with the webxr hardware and is not a general-purpose gaming device.
... usage notes actions and the target ray if the device provides an indication of the direction in which it is pointed, this is done using a target ray.
XRInputSourceArray - Web APIs
in addition to being able to access the input sources in the list using standard array notation (that is, with index numbers insize square brackets), methods are available to allow the use of iterators and the foreach() method is also available.
... in addition to these methods, you may use array notation to access items in the list by index for example, the snippet of code below calls a function handleinput(), passing into it the first item in the input source list, if the list isn't empty.
XRPermissionDescriptor.optionalFeatures - Web APIs
xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object.
... xrreferencespace usage notes examples let xrpermissiondesc = { name: "xr", mode: "immersive-vr", optionalfeatures: [ "bounded-floor" ] }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({state}) => { switch(state) { case "granted": setupxr(); break; case "prompt": promptandsetupxr(); break; default: /* do nothing other...
XRPermissionStatus.granted - Web APIs
xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object.
... xrreferencespace usage notes examples specifications specification status comment webxr device apithe definition of 'xrpermissionstatus.granted' in that specification.
XRPermissionStatus - Web APIs
the xrpermissionstatus interface defines the object returned by calling navigator.permissions.query() for the xr permission name; it indicates whether or not the app or site has permission to use webxr, an may be monitored over time for changes to that permissions tate.
... usage notes examples specifications specification status comment webxr device apithe definition of 'xrpermissionstatus' in that specification.
XRReferenceSpaceEventInit - Web APIs
you will not usually need to use this, since these events are created by the webxr infrastructure.
... usage notes all of this dictionary's properties must have valid values set on them before calling the xrreferencespaceevent() constructor.
XRRenderStateInit - Web APIs
this property must not be specified for immersive sessions, so the value is null by default for immersive sessions.
... usage notes any properties not specified in the xrrenderstateinit compliant object passed into updaterenderstate() are left at their current values.
XRRigidTransform.matrix - Web APIs
usage notes matrix format all 4x4 transform matrices used in webgl are stored in 16-element float32arrays.
...it begins by allocating a new matrix and writing a 4x4 identity matrix into it: [1000010000100001]\begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 1 \end{bmatrix} this is a transform that will not change either the orientation or position of any point, vector, or object to which it's applied.
XRSession.onselectstart - Web APIs
note: not to be confused with xrsession.onselect and xrsession.onselectend.
...} example xrsession.onselectstart = function(event) { console.log("the user has started a primary action, but might not have completed it.") } specifications specification status comment webxr device apithe definition of 'xrsession.onselectstart' in that specification.
XRSession.requestAnimationFrame() - Web APIs
note: despite the obvious similarities between these methods and the global requestanimationframe() function provided by the window interface, you must not treat these as interchangeable.
... 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().
XRSession.requestReferenceSpace() - Web APIs
xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned 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.
XRSession: visibilitychange event - Web APIs
the visibilitychange event is sent to an xrsession to inform it when it becomes visible or hidden, or when it becomes visible but not currently focused.
...tychange", e => { switch(e.session.visiblitystate) { case "visible": case "visible-blurred": mysessionvisible(true); break; case "hidden": mysessionvisible(false); break; } }); }); when a visibility state change occurs, the event is received and dispatched to a function mysessionvisible(), with a boolean parameter indicating whether or not the session is presently being displayed to the user.
XRSystem - Web APIs
WebAPIXRSystem
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.
...rsivebutton.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.
XRView.eye - Web APIs
WebAPIXRVieweye
usage notes the primary purpose of this property is to allow the correct area of any pre-rendered stereo content to be presented to the correct eye.
... for dynamically-rendered 3d content, you can usually ignore this and simply render each of the viewer's views, one after another.
XRView - Web APIs
WebAPIXRView
usage notes positions and number of xrviews per frame while rendering a scene, the set of views that are used to render the scene for the viewer as of the current frame are obtained by calling the xrframe object's getviewerpose() method to get the xrviewerpose representing (in essence) the position of the viewer's head.
...there might also be views representing observers watching the action, or other viewspoints not direclty associated with a player's eye.
XRWebGLLayer.antialias - Web APIs
the specific antialiasing technique used is left to the user agent's discretion and cannot be specified by the web site or web app.
... usage notes since this is a read-only property, you can set the antialiasing mode only when initially creating the xrwebgllayer, by specifying the antialias object in the xrwebgllayer() constructor's layerinit parameter.
XRWebGLLayerInit.ignoreDepthValues - Web APIs
this property differs from depth in that depth requests a webgl layer that does not have a depth buffer at all, while ignoredepthvalues merely asks that the depth layer be ignored.
... usage notes if ignoredepthvalues is true, the webxr compositor will ignore the contents of the depth buffer, if it exists, while compositing and rendering the scene.
Generating HTML - Web APIs
since there is no html namespace, and using the xhtml namespace would force the xsl to create an xml document that would not behave like a html document, the xsl:output in the xsl stylesheet will make sure the resulting document will be handled as html.
...by setting the output to be html and not having a namespace on the resulting elements (colored in blue), those elements will be treated as html elements.
Introduction - Web APIs
introduction one noticeable trend in w3c standards has been the effort to separate content from style.
... 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.
msCapsLockWarningOff - 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.
msPutPropertyEnabled - 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.
Web APIs
WebAPI
information api ppage visibility apipayment request apiperformance apiperformance timeline apipermissions apipointer eventspointer lock apiproximity events push api rresize observer apiresource timing apisserver sent eventsservice workers apistoragestorage access apistreams ttouch eventsuurl apivvibration apivisual viewport wweb animationsweb audio apiweb authentication apiweb crypto apiweb notificationsweb storage apiweb workers apiwebglwebrtcwebvttwebxr device apiwebsockets api interfaces this is a list of all the interfaces (that is, types of objects) that are available.
...wheelevent mutationevent mutationobserver mutationobserverinit mutationrecord n ndefmessage ndefreader ndefreadingevent ndefrecord ndefwriter namelist namednodemap navigationpreloadmanager navigator navigatorconcurrenthardware navigatorid navigatorlanguage navigatoronline navigatorplugins navigatorstorage networkinformation node nodefilter nodeiterator nodelist nondocumenttypechildnode notation notification notificationaction notificationevent notifyaudioavailableevent o oes_element_index_uint oes_fbo_render_mipmap oes_standard_derivatives oes_texture_float oes_texture_float_linear oes_texture_half_float oes_texture_half_float_linear oes_vertex_array_object ovr_multiview2 offlineaudiocompletionevent offlineaudiocontext offscreencanvas orientationsensor oscillatornode ove...
ARIA Screen Reader Implementors Guide - Accessibility
busy regions: any changes in a region marked with aria-busy="true" should not be added to the queue until that attribute is cleared.
... atomic (aria-atomic="true") regions with multiple changes should not be presented twice with the same content.
x-ms-aria-flowfrom - Accessibility
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.
Using ARIA: Roles, states, and properties - Accessibility
addition of aria semantics only exposes extra information to a browser's accessibility api, and does not affect a page's dom.
... combobox grid (including row, gridcell, rowheader, columnheader roles) listbox (including option role) menu menubar radiogroup (see radio role) tablist (including tab and tabpanel roles) tree treegrid document structure roles application article cell columnheader definition directory document feed figure group heading img list listitem math none note presentation row rowgroup rowheader separator table term textbox toolbar tooltip landmark roles banner complementary contentinfo form main navigation region search live region roles alert log marquee status timer window roles alertdialog dialog states and properties widget attributes aria-autocomplete aria-checked aria-current aria-disabled ...
How to file ARIA-related bugs - Accessibility
if you notice an implementation issue, please take a little time and let the developers know.
... tbd: add proper accessibility markup to table genre software where to file notes screen readers freedom scientific jaws jaws technical support form gw micro window eyes window-eyes comments, questions, and feedback (email) non visual desktop access (nvda) file nvda bugs discuss nvda issues browsers apple safari file webkit.org bugs google chrome file chromium bugs microsoft internet explorer file ie bugs microsoft edge file ms edge bugs view existing ms edge aria bugs mozilla firefox f...
ARIA: Complementary role - Accessibility
<aside aria-label="note about usage"> <!-- content --> </aside> ...
...because of this, you do not need to describe what the landmark is in its label.
ARIA: document role - Accessibility
in contrast to the article role, the document role does not have any relation to other elements with a document role, it merely has a relationship to the containing composit widget.
...other values include the default undefined which means the document is not collapsible.
ARIA: Navigation Role - Accessibility
if the html5 nav element technique is not being used, use a role="navigation" attribute to define a navigation landmark.
...because of this, you do not need to describe what the landmark is in its label.
ARIA: Suggestion role - Accessibility
the suggestion landmark role semantically denotes a single proposed change to an editable document.
... examples when you’ve got a content change that involves an insertion and a deletion, there is no way for a screenreader user to work out if the two are related or not.
Custom properties (--*): CSS variables - CSS: Cascading Style Sheets
WebCSS--*
initial valuesee proseapplies toall elementsinheritedyescomputed valueas specified with variables substitutedanimation typediscrete syntax --somekeyword: left; --somecolor: #0000ff; --somecomplexvalue: 3px 6px rgb(20, 32, 54); <declaration-value> this value matches any sequence of one or more tokens, so long as the sequence does not contain an unallowed token.
... note: custom property names are case sensitive — --my-color will be treated as a separate custom property to --my-color.
-moz-image-rect - CSS: Cascading Style Sheets
notice that before it begins doing so it saves a copy of the last box's style since it will be overwritten by the third element's style.
... what it looks like specifications not part of any standard.
-moz-outline-radius-bottomleft - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples rounding a outline since this is a firefox-only property, this example will not display the desired effect if you are viewing this in a browser other than firefox.
... html <p>look at this paragraph's bottom-left corner.</p> css p { margin: 10px; border: solid cyan; outline: dotted green; -moz-outline-radius-bottomleft: 2em; } result specifications not part of any standard.
-moz-outline-radius-bottomright - CSS: Cascading Style Sheets
ng dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples html <p>look at this paragraph's bottom-right corner.</p> css p { margin: 5px; border: solid cyan; outline: dotted red; -moz-outline-radius-bottomright: 2em; } result the example above will not display the desired effect if you are viewing this in a browser other than firefox.
... specifications not part of any standard.
-moz-outline-radius-topleft - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples the example below will not display the desired effect if you are viewing this in a browser other than firefox.
... html <p>look at this paragraph's top-left corner.</p> css p { margin: 5px; border: solid cyan; outline: dotted red; -moz-outline-radius-topleft: 2em; } result specifications not part of any standard.
-moz-outline-radius-topright - CSS: Cascading Style Sheets
sponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples html <p>look at this paragraph's top-right corner.</p> css p { margin: 5px; border: solid cyan; outline: dotted red; -moz-outline-radius-topright: 2em; } result the example above will not display the desired effect if you are viewing this in a browser other than firefox.
... specifications not part of any standard.
-webkit-border-before - CSS: Cascading Style Sheets
nitial valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumborder-style: as each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: nonecolor: varies from one browser to anotherapplies toall elementsinheritedyespercentagesas each of the properties of the shorthand:-webkit-border-before-width: logical-width of containing blockcomputed valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if ...
...)where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples applying a border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; -webkit-border-before: 5px dashed blue; } result specifications not part of any standard, but it relates to the standards-track border-block-start property.
-webkit-box-reflect - CSS: Cascading Style Sheets
/* direction values */ -webkit-box-reflect: above; -webkit-box-reflect: below; -webkit-box-reflect: left; -webkit-box-reflect: right; /* offset value */ -webkit-box-reflect: below 10px; /* mask value */ -webkit-box-reflect: below 0 linear-gradient(transparent, white); /* global values */ -webkit-box-reflect: inherit; -webkit-box-reflect: initial; -webkit-box-reflect: unset; note: this feature is not intended to be used by web sites.
...er> | <angle><linear-color-stop> = <color> <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> specifications not part of any standard.
-webkit-line-clamp - CSS: Cascading Style Sheets
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.
-webkit-mask-attachment - CSS: Cascading Style Sheets
fixed if fixed is specified, the mask image does not scroll with its containing element, instead remaining stationary within the viewport.
... formal definition initial valuescrollapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <attachment>#where <attachment> = scroll | fixed | local examples fixing a mask image to the viewport body { -webkit-mask-image: url('images/mask.png'); -webkit-mask-attachment: fixed; } specifications not part of any standard.
-webkit-mask-composite - CSS: Cascading Style Sheets
the -webkit-mask-composite property specifies the manner in which multiple mask images applied to the same element are composited with one another.
...pecifiedanimation typediscrete formal syntax <composite-style>#where <composite-style> = clear | copy | source-over | source-in | source-out | source-atop | destination-over | destination-in | destination-out | destination-atop | xor examples compositing with xor .example { -webkit-mask-image: url(mask1.png), url('mask2.png'); -webkit-mask-composite: xor, source-over; } specifications not part of any standard.
:-moz-broken - CSS: Cascading Style Sheets
note: this selector is mainly intended to be used by theme developers.
...:-("> css :-moz-broken { background: bisque; padding: 8px; } result specifications not part of any standard.
:-moz-handler-blocked - CSS: Cascading Style Sheets
note: this selector is mainly intended to be used by theme developers.
... syntax :-moz-handler-blocked specifications not part of any standard.
:-moz-handler-crashed - CSS: Cascading Style Sheets
note: this selector is mainly intended to be used by theme developers.
... syntax :-moz-handler-crashed specifications not part of any standard.
:-moz-handler-disabled - CSS: Cascading Style Sheets
note: this selector is mainly intended to be used by theme developers.
... syntax :-moz-handler-disabled specifications not part of any standard.
:-moz-only-whitespace - CSS: Cascading Style Sheets
note: in selectors level 4 the :empty selector was changed to act like :-moz-only-whitespace, but no browser currently supports this yet.
...(this includes elements with empty text nodes and elements with no child nodes.) syntax syntax not found in db!
:-moz-submit-invalid - CSS: Cascading Style Sheets
syntax syntax not found in db!
... specifications not part of any standard.
:-moz-suppressed - CSS: Cascading Style Sheets
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.
:-webkit-autofill - CSS: Cascading Style Sheets
note: the user agent style sheets of many browsers use !important in their :-webkit-autofill style declarations, making them non-overrideable by webpages without resorting to javascript hacks.
... syntax :-webkit-autofill specifications not part of any standard.
::-moz-page-sequence - CSS: Cascading Style Sheets
syntax syntax not found in db!
... specifications not part of any standard.
::-moz-page - CSS: Cascading Style Sheets
syntax syntax not found in db!
... specifications not part of any standard.
::-moz-range-progress - CSS: Cascading Style Sheets
note: using ::-moz-range-progress with anything but an <input type="range"> doesn't match anything and has no effect.
... syntax ::-moz-range-progress examples html <input type="range" min="0" max="100" step="5" value="50"/> css input[type=range]::-moz-range-progress { background-color: green; height: 1em; } result a progress bar using this style might look something like this: specifications not part of any standard.
::-moz-range-thumb - CSS: Cascading Style Sheets
note: using ::-moz-range-thumb with anything but an <input type="range"> doesn't match anything and has no effect.
... syntax ::-moz-range-thumb examples html <input type="range" min="0" max="100" step="5" value="50"/> css input[type=range]::-moz-range-thumb { background-color: green; } result a progress bar using this style might look something like this: specifications not part of any standard.
::-moz-range-track - CSS: Cascading Style Sheets
note: using ::-moz-range-track with anything but an <input type="range"> doesn't match anything and has no effect.
... syntax ::-moz-range-track examples html <input type="range" min="0" max="100" step="5" value="50"/> css input[type=range]::-moz-range-track { background-color: green; } result a progress bar using this style might look something like this: specifications not part of any standard.
::-moz-scrolled-page-sequence - CSS: Cascading Style Sheets
syntax syntax not found in db!
... specifications not part of any standard.
::-webkit-progress-bar - CSS: Cascading Style Sheets
note: for ::-webkit-progress-value to take effect, appearance needs to be set to none on the <progress> element.
... syntax ::-webkit-progress-bar examples css content progress { -webkit-appearance: none; } ::-webkit-progress-bar { background-color: orange; } html content <progress value="10" max="50"> result result screenshot if you're not using a webkit or blink browser, the code above results in a progress bar that looks like this: specifications not part of any standard.
::-webkit-progress-inner-element - CSS: Cascading Style Sheets
note: in order to let ::-webkit-progress-value take effect, -webkit-appearance needs to be set to none on the <progress> element.
... html <progress value="10" max="50"> css progress { -webkit-appearance: none; } ::-webkit-progress-inner-element { border: 2px solid black; } result result screenshot if you're not using a blink or webkit browsear, the above code resuls in a progress bar looking like this: specifications not part of any standard.
::-webkit-progress-value - CSS: Cascading Style Sheets
note: in order to let ::-webkit-progress-value take effect, -webkit-appearance needs to be set to none on the <progress> element.
... html <progress value="10" max="50"> css progress { -webkit-appearance: none; } ::-webkit-progress-value { background-color: orange; } result result screenshot a progress bar using the style above would look like this: specifications not part of any standard.
::after (:after) - CSS: Cascading Style Sheets
WebCSS::after
/* add an arrow after links */ a::after { content: "→"; } note: the pseudo-elements generated by ::before and ::after are contained by the element's formatting box, and thus don't apply to replaced elements such as <img>, or to <br> elements.
... syntax /* css3 syntax */ ::after /* css2 syntax */ :after note: css3 introduced the ::after notation (with two colons) to distinguish pseudo-classes from pseudo-elements.
:blank - CSS: Cascading Style Sheets
WebCSS:blank
note: the :blank selector is considered at risk, as the csswg keeps changing it.
... 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.
:dir() - CSS: Cascading Style Sheets
WebCSS:dir
note: be aware that the behavior of the :dir() pseudo-class is not equivalent to the [dir=…] attribute selectors.
... note: in html, the direction is determined by the dir attribute.
:left - CSS: Cascading Style Sheets
WebCSS:left
note: this pseudo-class can be used to change only the margin, padding, border, and background properties of the page box.
... all other properties will be ignored, and only the page box, not the document content on the page, will be affected.
:nth-of-type() - CSS: Cascading Style Sheets
> <p>2nd paragraph.</p> <div>this element isn't counted.</div> <p>3rd paragraph.</p> <p class="fancy">4th paragraph.</p> </div> css /* odd paragraphs */ p:nth-of-type(2n+1) { color: red; } /* even paragraphs */ p:nth-of-type(2n) { color: blue; } /* first paragraph */ p:nth-of-type(1) { font-weight: bold; } /* this has no effect, as the .fancy class is only on the 4th p element, not the 1st */ p.fancy:nth-of-type(1) { text-decoration: underline; } result specifications specification status comment selectors level 4the definition of ':nth-of-type' in that specification.
... working draft matching elements are not required to have a parent.
:only-child - CSS: Cascading Style Sheets
/* selects each <p>, but only if it is the */ /* only child of its parent */ p:only-child { background-color: lime; } note: as originally defined, the selected element had to have a parent.
... working draft matching elements are not required to have a parent.
:only-of-type - CSS: Cascading Style Sheets
/* selects each <p>, but only if it is the */ /* only <p> element inside its parent */ p:only-of-type { background-color: lime; } note: as originally defined, the selected element had to have a parent.
... working draft matching elements are not required to have a parent.
:read-write - CSS: Cascading Style Sheets
<p contenteditable>this paragraph is editable; it is read-write.</p> <p>this paragraph is not editable; it is read-only.</p> p { font-size: 150%; padding: 5px; border-radius: 5px; } p:read-only { background-color: red; color: white; } p:read-write { background-color: lime; } specifications specification status comment html living standardthe definition of ':read-write' in that specification.
... working draft defines the pseudo-class, but not the associated semantics.
:required - CSS: Cascading Style Sheets
WebCSS:required
note: the :optional pseudo-class selects optional form fields.
... if the form also contains optional inputs, required inputs should be indicated visually using a treatment that does not rely solely on color to convey meaning.
:right - CSS: Cascading Style Sheets
WebCSS:right
note: this pseudo-class can be used to change only the margin, padding, border, and background properties of the page box.
... all other properties will be ignored, and only the page box, not the document content on the page, will be affected.
symbols - CSS: Cascading Style Sheets
this must be one of the following data types: <string> <image> (note: this value is "at risk" and may be removed from the specification.
... it is not yet implemented.) <custom-ident> description a symbol can be a string, image, or identifier.
@counter-style - CSS: Cascading Style Sheets
the @counter-style css at-rule lets you define counter styles that are not part of the predefined set of styles.
...image values for symbols is currently an 'at risk' feature, and is not implemented in any browser.
font-stretch - CSS: Cascading Style Sheets
negative values are not allowed for this property.
... 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.
font-style - CSS: Cascading Style Sheets
note that a range is only supported when the font-style is oblique; for font-style: normal or italic, no second value is allowed.
...these fonts are specially created by font designers and are not artificially sloped.
src - CSS: Cascading Style Sheets
WebCSS@font-facesrc
the format hint contains a comma-separated list of format strings that denote well-known font formats.
...fonts containing invalid data or local font faces that are not found are ignored and the user agent loads the next font in the list.
-webkit-animation - CSS: Cascading Style Sheets
note: this media feature is only supported by webkit.
... examples @media (-webkit-animation) { /* css to use if animations are supported */ } specifications not part of any standard.
-webkit-transform-2d - CSS: Cascading Style Sheets
false the 2d css transforms prefixed with -webkit are not supported by the browser.
...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-transform-3d - CSS: Cascading Style Sheets
note: this media feature is only supported by webkit and blink.
... false the 3d css transforms prefixed with -webkit are not supported by the browser.
any-pointer - CSS: Cascading Style Sheets
note: if you want to test the accuracy of the primary pointing device, use pointer instead.
... note: more than one value can match if the available devices have different characteristics, although none only matches when none of them are pointing devices.
color - CSS: Cascading Style Sheets
WebCSS@mediacolor
if the device is not a color device, the value is zero.
... note: if the various color components are represented by different numbers of bits, the smallest number is used.
grid - CSS: Cascading Style Sheets
WebCSS@mediagrid
syntax the grid feature is specified as a <mq-boolean> value (0 or 1) representing whether or not the ouput device is grid-based.
...neato!</p> css :not(.unknown) { color: lightgray; } @media (grid: 0) { .unknown { color: lightgray; } .bitmap { color: red; text-transform: uppercase; } } @media (grid: 1) { .unknown { color: lightgray; } .grid { color: black; text-transform: uppercase; } } result specifications specification status comment media queries level 4the definition of 'grid' in that specification.
light-level - CSS: Cascading Style Sheets
normal the device is used in a environment with a light level in the ideal range for the screen, and which does not necessitate any particular adjustment.
... examples this code will likely not work on any devices (device compatibility is low).
pointer - CSS: Cascading Style Sheets
WebCSS@mediapointer
note: if you want to test the accuracy of any pointing device, use any-pointer instead.
... none the primary input mechanism does not include a pointing device.
prefers-color-scheme - CSS: Cascading Style Sheets
syntax light indicates that user has notified the system that they prefer an interface that has a light theme, or has not expressed an active preference.
... dark indicates that user has notified the system that they prefer an interface that has a dark theme.
prefers-contrast - CSS: Cascading Style Sheets
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.
prefers-reduced-data - CSS: Cascading Style Sheets
note: this feature is not supported by any user agent and its specifics are subject to change.
... examples note: no browser currently implements this feature so the following example will not work.
prefers-reduced-transparency - CSS: Cascading Style Sheets
reduce indicates that user has notified the system that they prefer an interface that minimizes the amount of transparent or translucent layer effects.
... examples note: no browser currently implements this feature so the following example will not work.
scripting - CSS: Cascading Style Sheets
WebCSS@mediascripting
initial-only scripting is enabled during the initial page load, but not afterwards.
... examples html <p class="script-none">you do not have scripting available.
update - CSS: Cascading Style Sheets
slow the layout may change dynamically according to the usual rules of css, but the output device is not able to render or display changes quickly enough for them to be perceived as a smooth animation.
... fast the layout may change dynamically according to the usual rules of css, and the output device is not unusually constrained in speed, so regularly-updating things like css animations can be used.
@page - CSS: Cascading Style Sheets
WebCSS@page
note: the w3c is discussing how to handle viewport-related <length> units, vh, vw, vmin, and vmax.
... meanwhile do not use them within a @page at-rule.
height - CSS: Cascading Style Sheets
WebCSS@viewportheight
if the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as 0.max-height: the percentage is calculated with respect to the height of the generated box's containing block.
... if the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as none.computed valueas each of the properties of the shorthand:min-height: the percentage as specified or the absolute lengthmax-height: the percentage as specified or the absolute length or none formal syntax <viewport-length>{1,2}where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting minimum and maximum height @viewport { height: 500px; } specifications specification status comment css device adaptationthe definition of '"height" descriptor' in that specification.
user-zoom - CSS: Cascading Style Sheets
the user-zoom css descriptor controls whether or not the user can change the zoom factor of a document defined by @viewport.
... fixed the user cannot zoom in or out.
At-rules - CSS: Cascading Style Sheets
WebCSSAt-rule
(currently at the working draft stage) @counter-style — defines specific counter styles that are not part of the predefined set of styles.
... (at the candidate recommendation stage, but only implemented in gecko as of writing) @font-feature-values (plus @swash, @ornaments, @annotation, @stylistic, @styleset and @character-variant) — define common names in font-variant-alternates for feature activated differently in opentype.
Attribute selectors - CSS: Cascading Style Sheets
*/ div:not([lang]) { font-style: italic; } /* all divs in us english are blue.
...*/ /* note: you could also use hyphenated attributes without double quotes */ div[data-lang="zh-tw"] { color: purple; } html <div lang="en-us en-gb en-au en-nz">hello world!</div> <div lang="pt">olá mundo!</div> <div lang="zh-cn">世界您好!</div> <div lang="zh-tw">世界您好!</div> <div data-lang="zh-tw">世界您好!</div> result html ordered lists the html specification requires the type attribute to be matched case-insensitively due to it primarily being used i...
Using multiple backgrounds - CSS: Cascading Style Sheets
these are layered atop one another with the first background you provide on top and the last background listed in the back.
...100%; height: 400px; background-image: url(https://mdn.mozillademos.org/files/11305/firefox.png), url(https://mdn.mozillademos.org/files/11307/bubbles.png), linear-gradient(to right, rgba(30, 75, 115, 1), rgba(255, 255, 255, 0)); background-repeat: no-repeat, no-repeat, no-repeat; background-position: bottom right, left, right; } result (if image does not appear in codepen, click the 'tidy' button in the css section) as you can see here, the firefox logo (listed first within background-image) is on top, directly above the bubbles graphic, followed by the gradient (listed last) sitting underneath all previous 'images'.
Box alignment in grid layout - CSS: Cascading Style Sheets
in this case the item will be aligned to start in both dimensions in order that the image is not distorted.
... the updated properties have not yet been implemented in all browsers.
Introduction to the CSS basic box model - CSS: Cascading Style Sheets
when margin collapsing occurs, the margin area is not clearly defined since margins are shared between boxes.
... finally, note that for non-replaced inline elements, the amount of space taken up (the contribution to the height of the line) is determined by the line-height property, even though the borders and padding are still displayed around the content.
Basic Concepts of Multicol - CSS: Cascading Style Sheets
this is because a multicol container creates a new block formatting context (bfc) which means margins on child elements do not collapse with any margin on the container.
...if there is not enough space for two columns of 200px, however, we get one.
Using multi-column layouts - CSS: Cascading Style Sheets
if column-count is not also set, then the browser will automatically make as many columns as fit in the available width.
...as values for these properties do not overlap, it is often convenient to use the shorthand columns.
Logical properties for sizing - CSS: Cascading Style Sheets
logical keywords for resize the resize property sets whether or not an item can be resized and has physical values of horizontal and vertical.
... note that currently the logical values for resize are only supported by firefox.
CSS Scrollbars - CSS: Cascading Style Sheets
scrollbar-color desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetscrollbar-colorchrome no support noedge no support nofirefox full support 64notes full support 64notes notes on macos, you need to set the general > show scroll bars setting in system preferences to "always" for this property to have any effect.
...pport nosafari ios no support nosamsung internet android no support nolegend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
Overview of CSS Shapes - CSS: Cascading Style Sheets
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.
... note that images used in this way must be cors compatible, otherwise shape-outside will act as if none had been given as the value, and you will get no shape.
CSS Text Decoration - CSS: Cascading Style Sheets
{ text-decoration: none; } .underover { text-decoration: dashed underline overline; } .thick { text-decoration: solid underline purple 4px; } .blink { text-decoration: blink; } <p class="under">this text has a line underneath it.</p> <p class="over">this text has a line over it.</p> <p class="line">this text has a line 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 css text decoration module level 3 candidate recommendation css level 2 (revision 1) recommendation css level 1 recommendation initial definition ...
General sibling combinator - CSS: Cascading Style Sheets
the general sibling combinator (~) separates two selectors and matches the second element only if it follows the first element (though not necessarily immediately), and both are children of the same parent element.
... /* paragraphs that are siblings of and subsequent to any image */ img ~ p { color: red; } syntax former_element ~ target_element { style properties } examples css p ~ span { color: red; } html <span>this is not red.</span> <p>here is a paragraph.</p> <code>here is some code.</code> <span>and here is a red span!</span> <code>more code...</code> <span>and this is a red span!</span> result specifications specification status comment selectors level 4the definition of 'subsequent-sibling combinator' in that specification.
Breadcrumb Navigation - CSS: Cascading Style Sheets
recipe download this example note: the example above uses two selectors to insert content before every li except the first one.
... this could also be achieved using one selector only: .breadcrumb li:not(:first-child)::before { content: "→"; } this solution uses a more complex selector, but requires less rules.
Cookbook template - CSS: Cascading Style Sheets
note: this is a template page for a css cookbook page.
...if not relevant for your pattern this can be omitted.
Recipe: Media objects - CSS: Cascading Style Sheets
another reason to use grid layout is in order that i can use fit-content() for the track sizing of the image.
... 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.
Sticky footers - CSS: Cascading Style Sheets
the recipe download this example note: in this example and the following one we are using a wrapper set to min-height: 100% in order that our live example works.
... alternate method if you need compatibility with browsers that do not support grid layout you can also use flexbox to create a sticky footer.
Layout mode - CSS: Cascading Style Sheets
note: not all css properties apply to all layout modes.
... most of them apply to one or two of them and have no effect if they are set on an element participating in another layout mode.
Using Media Queries for Accessibility - CSS: Cascading Style Sheets
reduce indicates that user has notified the system that they prefer an interface that minimizes the amount of movement or animation, preferably to the point where all non-essential movement is removed.
... this will help not only users with low vision and contrast sensitivity issues but also users that are working on a computer or phone with direct sunlight.
Media queries - CSS: Cascading Style Sheets
you can also use mediaquerylist.addlistener() to be notified whenever the state of a query changes.
... testing media queries programmatically describes how to use media queries in your javascript code to determine the state of a device, and to set up listeners that notify your code when the results of media queries change (such as when the user rotates the screen or resizes the browser).
Mozilla CSS extensions - CSS: Cascading Style Sheets
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.
...d-forward) :-moz-system-metric(scrollbar-start-backward) :-moz-system-metric(scrollbar-start-forward) :-moz-system-metric(scrollbar-thumb-proportional) :-moz-system-metric(touch-enabled) :-moz-system-metric(windows-default-theme) -moz-user-focus -moz-user-input -moz-user-modify -moz-window-dragging -moz-window-shadow formerly proprietary properties that are now standard note: to maximize the compatibility of your css, you should use the unprefixed standard properties instead of the prefixed ones listed below.
align-self - CSS: Cascading Style Sheets
syntax /* keyword values */ align-self: auto; align-self: normal; /* positional alignment */ /* align-self does not take left and right values */ align-self: center; /* put the item around the center */ align-self: start; /* put the item at the start */ align-self: end; /* put the item at the end */ align-self: self-start; /* align the item flush at the start */ align-self: self-end; /* align the item flush at the end */ align-self: flex-start; /* put the flex item at the start */ align-self: flex-end; /* put ...
... stretch if the combined size of the items along the cross axis is less than the size of the alignment container and the item is auto-sized, its size is increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size of all auto-sized items exactly fills the alignment container along the cross axis.
animation-duration - CSS: Cascading Style Sheets
note: negative values are invalid, causing the declaration to be ignored.
... note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are.
animation-fill-mode - CSS: Cascading Style Sheets
syntax /* single animation */ animation-fill-mode: none; animation-fill-mode: forwards; animation-fill-mode: backwards; animation-fill-mode: both; /* multiple animations */ animation-fill-mode: none, backwards; animation-fill-mode: both, forwards, none; values none the animation will not apply any styles to the target when it's not executing.
... note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are.
animation-name - CSS: Cascading Style Sheets
syntax /* single animation */ animation-name: none; animation-name: test_05; animation-name: -specific; animation-name: sliding-vertically; /* multiple animations */ animation-name: test1, animation4; animation-name: none, -moz-specific, sliding; /* global values */ animation-name: initial animation-name: inherit animation-name: unset values none a special keyword denoting no keyframes.
... note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are.
animation-timing-function - CSS: Cascading Style Sheets
whether the animation holds temporarily at 0%, 20%, 40%, 60% and 80%, on the 20%, 40%, 60%, 80% and 100%, or makes 5 stops between the 0% and 100% along the animation, or makes 5 stops including the 0% and 100% marks (on the 0%, 25%, 50%, 75%, and 100%) depends on which of the following jump terms is used: jump-start denotes a left-continuous function, so that the first jump happens when the animation begins; jump-end denotes a right-continuous function, so that the last jump happens when the animation ends; jump-none there is no jump on either end.
... step-start equal to steps(1, jump-start) step-end equal to steps(1, jump-end) note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are.
background-clip - CSS: Cascading Style Sheets
note: because the root element has a different background painting area, the background-clip property has no effect when specified on it.
... see "the backgrounds of special elements." note: for documents whose root element is an html element: if the computed value of background-image on the root element is none and its background-color is transparent, user agents must instead propagate the computed values of the background properties from that element’s first html <body> child element.
background - CSS: Cascading Style Sheets
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.
border-end-end-radius - CSS: Cascading Style Sheets
syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse.
... formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse.
border-end-start-radius - CSS: Cascading Style Sheets
syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse.
... formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse.
border-inline-end - CSS: Cascading Style Sheets
nitial valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumborder-style: as each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: nonecolor: varies from one browser to anotherapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hidd...
...nitial valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumborder-style: as each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: nonecolor: varies from one browser to anotherapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hidd...
border-spacing - CSS: Cascading Style Sheets
note: the border-spacing property is equivalent to the deprecated cellspacing <table> attribute, except that it has an optional second value that can be used to set different horizontal and vertical spacing.
...note how, along its outside edges, the table's padding values are added to its border-spacing values.
border-start-end-radius - CSS: Cascading Style Sheets
syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse.
... formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse.
border-start-start-radius - CSS: Cascading Style Sheets
syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse.
... formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse.
border-style - CSS: Cascading Style Sheets
the spacing of the dots is not defined by the specification and is implementation-specific.
...the exact size and length of the segments are not defined by the specification and are implementation-specific.
bottom - CSS: Cascading Style Sheets
WebCSSbottom
for relatively positioned elements, the distance of the element from its normal position is based on the top property; or if top is also auto, the element is not moved vertically at all.
... inherit specifies that the value is the same as the computed value from its parent element (which might not be its containing block).
box-lines - CSS: Cascading Style Sheets
WebCSSbox-lines
if the children in a horizontal box still do not fit on a line after being reduced to their minimum widths, then children are moved one by one onto a new line, until the elements remaining on the previous line fit.
... specifications not part of any standard.
box-pack - CSS: Cascading Style Sheets
WebCSSbox-pack
notes the edge of the box designated the start for packing purposes depends on the box's orientation and direction: normal reverse horizontal left right vertical top bottom the edge opposite to the start is designated the end.
... /* mozilla */ -webkit-box-pack: end; /* webkit */ } div.example p { /* make children narrower than their parent, so there is room for the box-align */ width: 200px; } <div class="example"> <p>i will be second from the bottom of div.example, centered horizontally.</p> <p>i will be on the bottom of div.example, centered horizontally.</p> </div> specifications not part of any standard.
clamp() - CSS: Cascading Style Sheets
WebCSSclamp
note that using clamp() for font sizes, as in these examples, allows you to set a font-size that grows with the size of the viewport, but doesn't go below a minimum font-size or above a maximum font-size.
... notes math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if auto had been specified.
clip - CSS: Cascading Style Sheets
WebCSSclip
/* keyword value */ clip: auto; /* <shape> values */ clip: rect(1px 10em 3rem 2ch); clip: rect(1px, 10em, 3rem, 2ch); /* global values */ clip: inherit; clip: initial; clip: unset; syntax note: where possible, authors are encouraged to use the newer clip-path property instead.
... auto the element does not clip (default).
color - CSS: Cascading Style Sheets
WebCSScolor
note that the value must be a uniform color.
... 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 valuevaries from one browser to anotherapplies toall elements.
column-rule - CSS: Cascading Style Sheets
note: as with all shorthand properties, any individual value that is not specified is set to its corresponding initial value (possibly overriding values previously set using non-shorthand properties).
... take note of how the `column-rule` property is used to adjust the style, width, and color of the rule that appears between the columns.
counter-reset - CSS: Cascading Style Sheets
note: the counter's value can be increased or decreased using the counter-increment css property.
...defaults to 0 if not specified.
counter-set - CSS: Cascading Style Sheets
note: the counter's value can be incremented or decremented using the counter-increment css property.
...defaults to 0 if not specified.
counter() - CSS: Cascading Style Sheets
WebCSScounter
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.
...the name cannot start with two dashes and can't be none, unset, initial, or inherit.
counters() - CSS: Cascading Style Sheets
WebCSScounters
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.
...the name cannot start with two dashes and can't be none, unset, initial, or inherit.
<display-legacy> - CSS: Cascading Style Sheets
inline-table the inline-table value does not have a direct mapping in html.
... html <div class="container"> <div>flex item</div> <div>flex item</div> </div> not a flex item css .container { display: inline-flex; } result in the new syntax the inline flex container would be created using two values, inline for the outer display type, and flex for the inner display type.
<display-outside> - CSS: Cascading Style Sheets
inline the element generates one or more inline element boxes that do not generate line breaks before or after themselves.
... 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.
flex-basis - CSS: Cascading Style Sheets
note: in case both flex-basis (other than auto) and width (or height in case of flex-direction: column) are set for an element, flex-basis has priority.
... note: this value was not present in the initial release of flexible box layout, and thus some older implementations will not support it.
flex-direction - CSS: Cascading Style Sheets
note that the values row and row-reverse are affected by the directionality of the flex container.
...if the visual (css) order is important, then screen reader users will not have access to the correct reading order.
font-kerning - CSS: Cascading Style Sheets
in the image below, for instance, the examples on the left do not use kerning, while the ones on the right do: syntax the font-kerning property is specified as one of the keyword values listed below.
... values auto the browser determines whether font kerning should be used or not.
font-synthesis - CSS: Cascading Style Sheets
description most standard western fonts include italic and bold variants, but many novelty fonts do not.
... fonts used for chinese, japanese, korean and other logographic scripts tend not to include these variants, and synthesizing them may impede the legibility of the text.
font-variant-caps - CSS: Cascading Style Sheets
if petite capital glyphs are not available, they are rendered using small capital glyphs.
... if these are not present, the browser synthesizes them from the uppercase glyphs.
font-variant-position - CSS: Cascading Style Sheets
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.
...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.
font - CSS: Cascading Style Sheets
WebCSSfont
as with any shorthand property, any individual value that is not specified is set to its corresponding initial value (possibly overriding values previously set using non-shorthand properties).
... though not directly settable by font, the longhands font-size-adjust and font-kerning are also reset to their initial values.
<gradient> - CSS: Cascading Style Sheets
WebCSSgradient
(be aware that older browsers may not use this behavior when using the transparent keyword.) examples linear gradient example a simple linear gradient.
...note that this isn't supported widely across browser as of yet.
grid - CSS: Cascading Style Sheets
WebCSSgrid
note: you can only specify the explicit or the implicit grid properties in a single grid declaration.
...also, the gutter properties are not reset by this shorthand.
height - CSS: Cascading Style Sheets
WebCSSheight
accessibility concerns ensure that elements set with a height are not truncated and/or do not obscure other content when the page is zoomed to increase text size.
...if the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the value computes to auto.
image-rendering - CSS: Cascading Style Sheets
crisp-edges the image must be scaled with an algorithm that preserves contrast and edges in the image, and which does not smooth colors or introduce blur to the image in the process.
... note: the values optimizequality and optimizespeed present in an early draft (and coming from its svg counterpart image-rendering) are defined as synonyms for the smooth and pixelated values respectively.
inherit - CSS: Cascading Style Sheets
WebCSSinherit
for inherited properties, this reinforces the default behavior, and is only needed to override another rule.
... inheritance is always from the parent element in the document tree, even when the parent element is not the containing block.
Initial value - CSS: Cascading Style Sheets
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.
... note: the initial value should not be confused with the value specified by the browser's style sheet.
line-break - CSS: Cascading Style Sheets
the different wrapping opportunities must not be prioritized.
... hyphenation is not applied.
list-style-position - CSS: Cascading Style Sheets
note: this property is applied to list items, i.e., elements with display: list-item;.
... note that there is variance among browsers regarding behavior when a block element is placed first within a list element declared as list-style-position: inside.
max() - CSS: Cascading Style Sheets
WebCSSmax
notes math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if auto had been specified.
... formal syntax max( <calc-sum># )where <calc-sum> = <calc-product> [ [ '+' | '-' ] <calc-product> ]*where <calc-product> = <calc-value> [ '*' <calc-value> | '/' <number> ]*where <calc-value> = <number> | <dimension> | <percentage> | ( <calc-sum> ) examples setting a minimum size for a font another use case for css functions is allow a font size to grow while ensuring it is at least a mimum size, enabling responsive font sizes while ensuring legibility.
min() - CSS: Cascading Style Sheets
WebCSSmin
notes math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if auto had been specified.
... mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 examples setting a maximum size for a label and input another use case for css functions is to set a maximum size on responsive form controls: enabling the width of labels and inputs to shrink as the width of the form shrinks.
overflow-wrap - CSS: Cascading Style Sheets
note: in contrast to word-break, overflow-wrap will only create a break if an entire word cannot be placed on its own line without overflowing.
... break-word the same as the anywhere value, with normally unbreakable words allowed to be broken at arbitrary points if there are no otherwise acceptable break points in the line, but soft wrap opportunities introduced by the word break are not considered when calculating min-content intrinsic sizes.
overscroll-behavior-x - CSS: Cascading Style Sheets
underlying elements will not scroll.
... by default, when the inner box is scrolled and a scroll boundary is reached, the whole page will begin to scroll, which is probably not what we want.
padding-bottom - CSS: Cascading Style Sheets
note: the padding property can be used to set paddings on all four sides of an element with a single declaration.
...unlike margins, negative values are not allowed for padding.
padding-left - CSS: Cascading Style Sheets
note: the padding property can be used to set paddings on all four sides of an element with a single declaration.
...unlike margins, negative values are not allowed for padding.
padding-right - CSS: Cascading Style Sheets
note: the padding property can be used to set paddings on all four sides of an element with a single declaration.
...unlike margins, negative values are not allowed for padding.
padding-top - CSS: Cascading Style Sheets
note: the padding property can be used to set paddings on all four sides of an element with a single declaration.
...unlike margins, negative values are not allowed for padding.
place-self - CSS: Cascading Style Sheets
if the second value is not present, the first value is also used for it.
... stretch if the combined size of the items along the cross axis is less than the size of the alignment container and the item is auto-sized, its size is increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size of all auto-sized items exactly fills the alignment container along the cross axis.
scroll-behavior - CSS: Cascading Style Sheets
note that any other scrolls, such as those performed by the user, are not affected by this property.
...this property specified on the body element will not propagate to the viewport.
scroll-margin-inline-end - CSS: Cascading Style Sheets
the aim here is to create four horizontally-scrolling blocks, the second and third of which snap into place, near but not quite at the right of each block.
...the outer container is styled like this: .scroller { text-align: left; width: 250px; height: 250px; overflow-x: scroll; display: flex; box-sizing: border-box; border: 1px solid #000; scroll-snap-type: x mandatory; } the main parts relevant to the scroll snapping are overflow-x: scroll, which makes sure the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point.
scroll-margin-inline-start - CSS: Cascading Style Sheets
the aim here is to create four horizontally-scrolling blocks, the second and third of which snap into place, near but not quite at the left of each block.
...the outer container is styled like this: .scroller { text-align: left; width: 250px; height: 250px; overflow-x: scroll; display: flex; box-sizing: border-box; border: 1px solid #000; scroll-snap-type: x mandatory; } the main parts relevant to the scroll snapping are overflow-x: scroll, which makes sure the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point.
scroll-snap-coordinate - CSS: Cascading Style Sheets
syntax values none specifies that the element does not contribute to a snap point.
...ght: 100px; text-align: center; font-size: 50px; } .coordinate0 > div { scroll-snap-coordinate: 0 0; } .coordinate25 > div { scroll-snap-coordinate: 25px 0; } .coordinate50 > div { scroll-snap-coordinate: 50px 0; } .scrollcontainer > div:nth-child(even) { background-color: #87ea87; } .scrollcontainer > div:nth-child(odd) { background-color: #87ccea; } result specifications not part of any standard.
scroll-snap-points-x - CSS: Cascading Style Sheets
/* keyword value */ scroll-snap-points-x: none; /* repeating snap points */ scroll-snap-points-x: repeat(400px); /* global values */ scroll-snap-points-x: inherit; scroll-snap-points-x: initial; scroll-snap-points-x: unset; syntax values none the scroll container does not define any snap points.
... nowrap; scroll-snap-points-x: repeat(100%); scroll-snap-type: mandatory; font-size: 0; } #container > div { width: 200px; height: 200px; display: inline-block; line-height: 200px; text-align: center; font-size: 100px; } #container > div:nth-child(even) { background-color: #87ea87; } #container > div:nth-child(odd) { background-color: #87ccea; } result specifications not part of any standard.
scroll-snap-points-y - CSS: Cascading Style Sheets
/* keyword value */ scroll-snap-points-y: none; /* repeated snap points */ scroll-snap-points-y: repeat(400px); /* global values */ scroll-snap-points-y: inherit; scroll-snap-points-y: initial; scroll-snap-points-y: unset; syntax values none the scroll container does not define any snap points.
...: auto; scroll-snap-points-y: repeat(200px); scroll-snap-type: mandatory; font-size: 0; } #container > div { width: 200px; height: 200px; display: inline-block; line-height: 200px; text-align: center; font-size: 100px; } #container > div:nth-child(even) { background-color: #87ea87; } #container > div:nth-child(odd) { background-color: #87ccea; } result specifications not part of any standard.
scroll-snap-type-x - CSS: Cascading Style Sheets
specifying any precise animations or physics used to enforce those snap points is not covered by this property but instead left up to the user agent.
... formal definition initial valuenoneapplies toscroll containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | mandatory | proximity specifications not part of any standard.
scroll-snap-type-y - CSS: Cascading Style Sheets
specifying any precise animations or physics used to enforce those snap points is not covered by this property but instead left up to the user agent.
... formal definition initial valuenoneapplies toscroll containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | mandatory | proximity specifications not part of any standard.
scrollbar-width - CSS: Cascading Style Sheets
note: user agents must apply any scrollbar-width value set on the root element to the viewport.
... accessibility concerns use this property with caution — setting scrollbar-width to thin or none can make content hard or impossible to scroll if the author does not provide an alternative scrolling mechanism.
Specified value - CSS: Cascading Style Sheets
examples html <p>my specified color is given explicitly in the css.</p> <div>the specified values of all my properties default to their initial values, because none of them are given in the css.</div> <div class="fun"> <p>the specified value of my font family is not given explicitly in the css, so it is inherited from my parent.
... however, the border is not an inheriting property.</p> </div> css .fun { border: 1px dotted pink; font-family: fantasy; } p { color: green; } result specifications specification status comment css level 2 (revision 2)the definition of 'cascaded value' in that specification.
table-layout - CSS: Cascading Style Sheets
cells in subsequent rows do not affect column widths.
...this can speed up rendering time over the "automatic" layout method, but subsequent cell content might not fit in the column widths provided.
text-align - CSS: Cascading Style Sheets
mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.8 | understanding wcag 2.0 formal definition initial valuestart, or a nameless value that acts as left if direction is ltr, right if direction is rtl if start is not supported by the browser.applies toblock containersinheritedyescomputed valueas specified, except for the match-parent value which is calculated against its parent's direction value and results in a computed value of either left or rightanimation typediscrete formal syntax start | end | left | right | center | justify | match-parent examples left alignment html <p class="example"> integer...
...</p> css .example { text-align: justify; border: solid; } result notes the standard-compatible way to center a block itself without centering its inline content is setting the left and right margin to auto, e.g.: .something { margin: auto; } .something { margin: 0 auto; } .something { margin-left: auto; margin-right: auto; } specifications specification status comment css logical properties and values level 1the definit...
text-decoration-skip - CSS: Cascading Style Sheets
note: most other browsers are converging on supporting the simpler text-decoration-skip-ink property.
...-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-decoration-skip: unset; syntax values none nothing is skipped.
text-emphasis-style - CSS: Cascading Style Sheets
/* initial value */ text-emphasis-style: none; /* no emphasis marks */ /* <string> values */ text-emphasis-style: 'x'; text-emphasis-style: '点'; text-emphasis-style: '\25b2'; text-emphasis-style: '*'; text-emphasis-style: 'foo'; /* should not be used.
...authors should not specify more than one character in <string>.
text-justify - CSS: Cascading Style Sheets
this has the same effect as not setting text-align at all, although it is useful if you need to turn justification on and off for some reason.
...this is the default justification used if text-justify is not set at all.
text-orientation - CSS: Cascading Style Sheets
it only affects text in vertical mode (when writing-mode is not horizontal-tb).
...note that this keyword causes all characters to be considered as left-to-right: the used value of direction is forced to be ltr.
text-rendering - CSS: Cascading Style Sheets
/* keyword values */ text-rendering: auto; text-rendering: optimizespeed; text-rendering: optimizelegibility; text-rendering: geometricprecision; /* global values */ text-rendering: inherit; text-rendering: initial; text-rendering: unset; note: the text-rendering property is an svg property that is not defined in any css standard.
... note: webkit precisely applies the specified value, but gecko treats the value the same as optimizelegibility.
text-underline-offset - CSS: Cascading Style Sheets
text-underline-offset is not part of the text-decoration shorthand.
... while an element can have multiple text-decoration lines, text-underline-offset only impacts underlining, and not other possible line decoration options such as overline or line-through.
<time-percentage> - CSS: Cascading Style Sheets
valid percentages 50% +50% optional plus sign -50% negative percentages are not valid for all properties that accept percentages invalid percentages 50 % space not allowed between the space and the percentage sign valid times 12s positive integer -456ms negative integer 4.3ms non-integer 14ms the unit is case-insensitive, although capital letters are not recommended.
...12.0 this is a <number>, not a <time>, because it's missing a unit.
top - CSS: Cascading Style Sheets
WebCSStop
for relatively positioned elements, the distance of the element from its normal position is based on the bottom property; or if bottom is also auto, the element is not moved vertically at all.
... inherit specifies that the value is the same as the computed value from its parent element (which might not be its containing block).
touch-action - CSS: Cascading Style Sheets
after a gesture starts, changes to touch-action will not have any impact on the behavior of the current gesture.
...note that scrolling "up" (pan-up) means that the user is dragging their finger downward on the screen surface, and likewise pan-left means the user is dragging their finger to the right.
transform-box - CSS: Cascading Style Sheets
the reference box of a <table> is the border box of its table wrapper box, not its table box.
...the reference box of a <table> is the border box of its table wrapper box, not its table box.
rotate() - CSS: Cascading Style Sheets
a positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one.
...os(a)0001 cos(a)-sin(a)00sin(a)cos(a)0000100001 [cos(a) sin(a) -sin(a) cos(a) 0 0] examples basic example html <div>normal</div> <div class="rotated">rotated</div> css div { width: 80px; height: 80px; background-color: skyblue; } .rotated { transform: rotate(45deg); /* equal to rotatez(45deg) */ background-color: pink; } result combining rotation with another transformation if you want apply multiple transformations to an element, be careful about the order in which you specify your transformations.
scale() - CSS: Cascading Style Sheets
note: the scale() function only scales in 2d.
...if not defined, its default value is sx, resulting in a uniform scaling that preserves the element's aspect ratio.
scaleX() - CSS: Cascading Style Sheets
the scaling is not isotropic, and the angles of the element are not conserved.
... note: scalex(sx) is equivalent to scale(sx, 1) or scale3d(sx, 1, 1).
scaleY() - CSS: Cascading Style Sheets
the scaling is not isotropic, and the angles of the element are not conserved.
... note: scaley(sy) is equivalent to scale(1, sy) or scale3d(1, sy, 1).
scaleZ() - CSS: Cascading Style Sheets
the scaling is not isotropic, and the angles of the element are not conserved.
... note: scalez(sz) is equivalent to to scale3d(1, 1, sz).
translateX() - CSS: Cascading Style Sheets
note: translatex(tx) is equivalent to translate(tx, 0) or translate3d(tx, 0, 0).
... cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 a translation is not a linear transformation in ℝ2 and can't be represented using a cartesian-coordinate matrix.
translateY() - CSS: Cascading Style Sheets
note: translatey(ty) is equivalent to translate(0, ty) or translate3d(0, ty, 0).
... cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 a translation is not a linear transformation in ℝ2 and can't be represented using a cartesian-coordinate matrix.
unset - CSS: Cascading Style Sheets
WebCSSunset
the unset css keyword resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not.
...>this text is also red.</p> </div> <div class="bar"> <p>this text is green (default inherited value).</p> </div> css .foo { color: blue; } .bar { color: green; } p { color: red; } .bar p { color: unset; } result border html <p>this text has a red border.</p> <div> <p>this text has a red border.</p> </div> <div class="bar"> <p>this text has a black border (initial default, not inherited).</p> </div> css div { border: 1px solid green; } p { border: 1px solid red; } .bar p { border-color: unset; } result specifications specification status comment css cascading and inheritance level 4the definition of 'unset' in that specification.
white-space - CSS: Cascading Style Sheets
note: to make words break within themselves, use overflow-wrap, word-break, or hyphens instead.
... such preserved spaces take up space and do not hang, and thus affect the box’s intrinsic sizes (min-content size and max-content size).
word-break - CSS: Cascading Style Sheets
keep-all word breaks should not be used for chinese/japanese/korean (cjk) text.
... note: in contrast to word-break: break-word and overflow-wrap: break-word (see overflow-wrap), word-break: break-all will create a break at the exact place where text would otherwise overflow its container (even if putting an entire word on its own line would negate the need for a break).
z-index - CSS: Cascading Style Sheets
WebCSSz-index
values auto the box does not establish a new local stacking context.
...this means that the z-indexes of descendants are not compared to the z-indexes of elements outside this element.
zoom - CSS: Cascading Style Sheets
WebCSSzoom
reset do not (de)magnify this element if the user applies non-pinch-based zooming (e.g.
...b" class="circle"></div> <div id="c" class="circle"></div> css div.circle { width: 25px; height: 25px; border-radius: 100%; text-align: center; vertical-align: middle; display: inline-block; zoom: 1.5; } div#a { background-color: gold; zoom: normal; } div#b { background-color: green; zoom: 200%; } div#c { background-color: blue; zoom: 2.9; } result specifications not part of any standard.
exsl:object-type() - EXSLT
note: most xslt object types can be coerced into each other safely; however, certain coercsions to raise error conditions.
... in particular, treating something that's not a node-set as a node-set will do so.
set:difference() - EXSLT
WebEXSLTsetdifference
in other words, it returns a node-set whose nodes are in one node-set but not in the other.
... returns a node-set containing the nodes that are in nodeset1 but not in nodeset2.
Index - Event reference
WebEventsIndex
found 2 pages: # page tags and summary 1 event reference event, overview, reference dom events are sent to notify code of interesting things that have taken place.
...events can represent everything from basic user interactions to automated notifications of things happening in the rendering model.
Ajax - Developer guides
WebGuideAJAX
asynchronous javascript and xml, while not a technology in itself, is a term coined in 2005 by jesse james garrett, that describes a "new" approach to using a number of existing technologies together, including html or xhtml, css, javascript, dom, xml, xslt, and most importantly the xmlhttprequest object.
...as well as this, it can also be used to test addressed nodes within a document to determine whether they match a pattern or not.
Challenge solutions - Developer guides
these are not the only possible solutions.
... solution add the following style declaration to the strong rule: font: 200% serif; if you use separate declarations for font-size and font-family, then the font-style setting on the first paragraph is not overridden.
Creating and triggering events - Developer guides
events dynamically elements can listen for events that haven't been created yet: <form> <textarea></textarea> </form> const form = document.queryselector('form'); const textarea = document.queryselector('textarea'); form.addeventlistener('awesome', e => console.log(e.detail.text())); textarea.addeventlistener('input', function() { // create and dispatch/trigger an event on the fly // note: optionally, we've also leveraged the "function expression" (instead of the "arrow function expression") so "this" will represent the element this.dispatchevent(new customevent('awesome', { bubbles: true, detail: { text: () => textarea.value } })) }); triggering built-in events this example demonstrates simulating a click (that is programmatically generating a click event) on a checkbox usi...
... alert("not cancelled"); } } ...
Orientation and motion data explained - Developer guides
the y axis follows along the ground plane, and is positive toward true north (that is, the north pole, not magnetic north) and negative toward true south.
... note: on a phone or tablet, the orientation of the device is always considered in relation to the standard orientation of the screen; this is the "portrait" orientation on most devices.
Mobile-friendliness - Developer guides
needless to say, a fixed-width, three-column layout filled with complex javascript animations and mouse-over effects is not going to look or feel quite right on a phone with a 2-inch-wide screen and a diminutive processor.
...know your audience while not strictly a part of the definition of being mobile friendly, defining who your target audience is makes these goals much more concrete.
Mobile Web Development - Developer guides
WebGuideMobile
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.
...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 be usable in a browser which is not targeted by your linear-gradient rule.
Printing - Developer guides
note: you can also use window.onbeforeprint and window.onafterprint to assign handlers for these events, but using eventtarget.addeventlistener() is preferred.
... = "0"; ohiddframe.style.bottom = "0"; ohiddframe.style.width = "0"; ohiddframe.style.height = "0"; ohiddframe.style.border = "0"; ohiddframe.src = surl; document.body.appendchild(ohiddframe); } </script> </head> <body> <p><span onclick="printpage('externalpage.html');" style="cursor:pointer;text-decoration:underline;color:#0000ff;">print external page!</span></p> </body> </html> note: older versions of internet explorer cannot print the contents of a hidden <iframe>.
HTML attribute: capture - HTML: Hypertext Markup Language
environment the outward-facing camera and/or microphone should be used note: capture was previously a boolean attribute which, if present, requested that the device's media capture device(s) such as camera or microphone be used instead of requesting a file input.
...ndfile">what does your voice sound like?:</label> <input type="file" id="soundfile" capture="user" accept="audio/*"> </p> <p> <label for="videofile">upload a video:</label> <input type="file" id="videofile" capture="environment" accept="video/*"> </p> <p> <label for="imagefile">upload a photo of yourself:</label> <input type="file" id="imagefile" capture="user" accept="image/*"> </p> note these work better on mobile devices; if your device is a desktop computer, you'll likely get a typical file picker.
HTML attribute: max - HTML: Hypertext Markup Language
WebHTMLAttributesmax
if the max attribute is present by is not specified or is invalid, no max value is applied.
... week yyyy-w## <input type="week" max="2019-w23" step=""> time hh:mm <input type="time" max="17:00" step="900"> datetime-local yyyy-mm-ddthh:mm <input type="datetime-local" min="2019-12-25t23:59"> number <number> <input type="number" min="0" step="5" max="100"> range <number> <input type="range" min="60" step="5" max="100"> note: when the data entered by the user doesn't adhere to the maximum value set, the value is considered invalid in contraint validation and will match the :invalid and :out-of-range pseudoclasses see client-side validation and rangeoverflow for more information.
DASH Adaptive Streaming for HTML 5 Video - HTML: Hypertext Markup Language
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.
... 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.
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
WebHTMLElementapplet
alt this attribute causes a descriptive text alternate to be displayed on browsers that do not support java.
...the meaning and use is unclear and not part of the html standard.
<bdo>: The Bidirectional Text Override element - HTML: Hypertext Markup Language
WebHTMLElementbdo
the text's characters are drawn from the starting point in the given direction; the individual characters' orientation is not affected (so characters don't get drawn backward, for example).
... examples <!-- switch text direction --> <p>this text will go left to right.</p> <p><bdo dir="rtl">this text will go right to left.</bdo></p> result notes the html 4 specification did not specify events for this element; they were added in xhtml.
<big>: The Bigger Text element - HTML: Hypertext Markup Language
WebHTMLElementbig
usage note: as it was purely presentational, this element has been removed in html5 and shouldn't be used anymore.
... implementation note: up to gecko 1.9.2 inclusive, firefox implements the htmlspanelement interface for this element.
<blink>: The Blinking Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementblink
do not use this element as it is obsolete and is bad design practice.
... example <blink>why would somebody use this?</blink> result (toned down!) specification this element is non-standard and not part of any specification.
<blockquote>: The Block Quotation element - HTML: Hypertext Markup Language
usually, this is rendered visually by indentation (see notes for how to change it).
... usage notes to change the indentation applied to the quoted text, use the css margin-left and/or margin-right properties, or the margin shorthand property.
<body>: The Document Body element - HTML: Hypertext Markup Language
WebHTMLElementbody
tag omission the start tag may be omitted if the first thing inside it is not a space character, comment, <script> element or <style> element.
... the end tag may be omitted if the <body> element has contents or has a start tag, and is not immediately followed by a comment.
<center>: The Centered Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementcenter
implementation note: up to gecko 1.9.2 inclusive, firefox implements the htmlspanelement interface for this element.
...<p>so will this paragraph.</p></div> example 3 (css alternative) <p style="text-align:center">this line will be centered.<br> and so will this line.</p> note applying text-align:center to a <div> or <p> element centers the contents of those elements while leaving their overall dimensions unchanged.
<cite>: The Citation element - HTML: Hypertext Markup Language
WebHTMLElementcite
usage notes in the context of the <cite> element, a creative work that might be cited could be, for example, one of the following: a book a research paper an essay a poem a musical score a song a play or film script a film a television show a game a sculpture a painting a theatrical production a play an opera a musical an exhibition a legal case report a computer program a web site ...
... it's worth noting that the w3c specification says that a reference to a creative work, as included within a <cite> element, may include the name of the work’s author.
<dl>: The Description List element - HTML: Hypertext Markup Language
WebHTMLElementdl
<dl> <div> <dt>name</dt> <dd>godzilla</dd> </div> <div> <dt>born</dt> <dd>1952</dd> </div> <div> <dt>birthplace</dt> <dd>japan</dd> </div> <div> <dt>color</dt> <dd>green</dd> </div> </dl> notes do not use this element (nor <ul> elements) to merely create indentation on a page.
...some screen readers, such as voiceover on ios, will not announce that <dl> content is a list.
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
WebHTMLElementfigure
usage notes usually a <figure> is an image, illustration, diagram, code snippet, etc., that is referenced in the main flow of a document, but that can be moved to another part of the document or to an appendix without affecting the main flow.
...debugging is the process of removing software bugs, then programming must be the process of putting them in.</blockquote> </figure> poems <figure> <p style="white-space:pre"> bid me discourse, i will enchant thine ear, or like a fairy trip upon the green, or, like a nymph, with long dishevell'd hair, dance on the sands, and yet no footing seen: love is a spirit all compact of fire, not gross to sink, but light, and will aspire.</p> <figcaption><cite>venus and adonis</cite>, by william shakespeare</figcaption> </figure> specifications specification status comment html living standardthe definition of '<figure>' in that specification.
<font> - HTML: Hypertext Markup Language
WebHTMLElementfont
usage note: do not use this element!
... starting with html 4, html does not convey styling information anymore (outside the <style> element or the style attribute of each element).
<input type="reset"> - HTML: Hypertext Markup Language
WebHTMLElementinputreset
adding a tooltip to the button (using the title attribute) can also help, although it's not a complete solution for accessibility purposes.
... note: see the <input type="button"> page for more ideas about enabling and disabling buttons.
<marquee>: The Marquee element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementmarquee
note that any value smaller than 60 is ignored and the value 60 is used instead, unless truespeed is specified.
...if truespeed is present, those values are not ignored.
<optgroup> - HTML: Hypertext Markup Language
WebHTMLElementoptgroup
the end tag is optional if this element is immediately followed by another <optgroup> element, or if the parent element has no more content.
... implicit aria role group permitted aria roles no role permitted dom interface htmloptgroupelement note: optgroup elements may not be nested.
<output>: The Output element - HTML: Hypertext Markup Language
WebHTMLElementoutput
(if this attribute is not set, the <output> is associated with its ancestor <form> element, if any.) this attribute lets you associate <output> elements to <form>s anywhere in the document, not just inside a <form>.
... the <output> value, name, and contents are not submitted during form submission.
<param>: The Object Parameter element - HTML: Hypertext Markup Language
WebHTMLElementparam
tag omission as it is a void element, the start tag must be present and the end tag must not be present.
... object: an id of another <object> in the same document.
<progress>: The Progress Indicator element - HTML: Hypertext Markup Language
WebHTMLElementprogress
note: unlike the <meter> element, the minimum value is always 0, and the min attribute is not allowed for the <progress> element.
... note: the :indeterminate pseudo-class can be used to match against indeterminate progress bars.
<rtc>: The Ruby Text Container element - HTML: Hypertext Markup Language
WebHTMLElementrtc
the html ruby text container (<rtc>) element embraces semantic annotations of characters presented in a ruby of <rb> elements used inside of <ruby> element.
... <rb> elements can have both pronunciation (<rt>) and semantic (<rtc>) annotations.
<ruby> - HTML: Hypertext Markup Language
WebHTMLElementruby
the html <ruby> element represents a ruby annotation.
... ruby annotations are for showing pronunciation of east asian characters.
<sup>: The Superscript element - HTML: Hypertext Markup Language
WebHTMLElementsup
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: <p>one of the most common equations in all of physics is <var>e</var>=<var>m</var><var>c</var><sup>2</sup>.<p> the resulting output looks like this: superior lettering superior lettering is not technically the same thing as superscript.
<tt>: The Teletype Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementtt
the terms non-proportional, monotype, and monospace are used interchangeably and have the same general meaning: they describe a typeface whose characters are all the same number of pixels wide.
... can override the browser's default font—if the browser permits you to do so, which it isn't required to do—using css: css tt { font-family: "lucida console", "menlo", "monaco", "courier", monospace; } html <p>enter the following at the telnet command prompt: <code>set localecho</code><br /> the telnet client should display: <tt>local echo is on</tt></p> result usage notes the <tt> element is, by default, rendered using the browser's default non-proportional font.
<var>: The Variable element - HTML: Hypertext Markup Language
WebHTMLElementvar
usage notes related elements other elements that are used in contexts in which <var> is commonly used include: <code>: the html code element <kbd>: the html keyboard input element <samp>: the html sample output element if you encounter code that is mistakenly using <var> for style purposes rather than semantic purposes, you should either use a <span> with appropriate css or, an appropriate semanti...
...this can be overridden in css, like this: var { font: bold 15px "courier", "courier new", monospace; } examples basic example here's a simple example, using <var> to denote variable names in a mathematical equation.
contenteditable - HTML: Hypertext Markup Language
false, which indicates that the element is not editable.
... note that although its allowed values include true and false, this attribute is an enumerated one and not a boolean one.
data-* - HTML: Hypertext Markup Language
the * may be replaced by any name following the production rule of xml names with the following restrictions: the name must not start with xml, whatever case is used for these letters; the name must not contain any semicolon (u+003a); the name must not contain capital letters.
... note that the htmlelement.dataset property is a domstringmap, and the name of the custom data attribute data-test-value will be accessible via htmlelement.dataset.testvalue (or by htmlelement.dataset["testvalue"]) as any dash (u+002d) is replaced by the capitalization of the next letter, converting the name to camelcase.
inputmode - HTML: Hypertext Markup Language
devices may or may not show a minus key (-).
...devices may or may not show a minus key.
style - HTML: Hypertext Markup Language
note that it is recommended for styles to be defined in a separate file or files.
... usage note: this attribute must not be used to convey semantic information.
Microformats - HTML: Hypertext Markup Language
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.
...p://mozilla.org/" >mozilla foundation</a>) </div> parsed json: { "items": [{ "type": ["h-card"], "properties": { "name": ["mitchell baker"], "url": ["http://blog.lizardwrangler.com/"], "org": [{ "value": "mozilla foundation", "type": ["h-card"], "properties": { "name": ["mozilla foundation"], "url": ["http://mozilla.org/"] } }] } }] } note: the nested h-card has implied 'name' and 'url' properties, just like any other root-class-name-only h-card on an <a href> would.
Common MIME types - HTTP
a textual file should be human-readable and must not contain binary data.
... image/webp .woff web open font format (woff) font/woff .woff2 web open font format (woff) font/woff2 .xhtml xhtml application/xhtml+xml .xls microsoft excel application/vnd.ms-excel .xlsx microsoft excel (openxml) application/vnd.openxmlformats-officedocument.spreadsheetml.sheet .xml xml application/xml if not readable from casual users (rfc 3023, section 3) text/xml if readable from casual users (rfc 3023, section 3) .xul xul application/vnd.mozilla.xul+xml .zip zip archive application/zip .3gp 3gpp audio/video container video/3gpp audio/3gpp if it doesn't contain video .3g2 3gpp2 audio/video container video/3gpp2 audio/3gpp2 if i...
Reason: expected ‘true’ in CORS header ‘Access-Control-Allow-Credentials’ - HTTP
to fix this problem on the client side, revise the code to not request the use of credentials.
... if the request is being issued using xmlhttprequest, make sure you're not setting withcredentials to true.
Accept-CH - HTTP
note: client hints are accessible only on secure origins (via tls).
... syntax accept-ch: <list of client hints> examples accept-ch: dpr, viewport-width accept-ch: width accept-ch-lifetime: 86400 vary: dpr, viewport-width, width note: remember to vary the response based on the accepted client hints.
Accept-Charset - HTTP
if the server cannot serve any character encoding from this request header, it can theoretically send back a 406 not acceptable error code.
... * any charset not mentioned elsewhere in the header; * is used as a wildcard.
Access-Control-Allow-Credentials - HTTP
when used as part of a response to a preflight request, this indicates whether or not the actual request can be made using credentials.
... note that simple get requests are not preflighted, and so if a request is made for a resource with credentials, if this header is not returned with the resource, the response is ignored by the browser and not returned to web content.
Authorization - HTTP
the http authorization request header contains the credentials to authenticate a user agent with a server, usually, but not necessarily, after the server has responded with a 401 unauthorized status and the www-authenticate header.
... note: base64 encoding does not mean encryption or hashing!
Content-Disposition - HTTP
a name with a value of '_charset_' indicates that the part is not an html field, but the default charset to use for parts without explicit charset information.
...the filename is always optional and must not be used blindly by the application: path information should be stripped, and conversion to the server file system rules should be done.
Content-Encoding - HTTP
like the compress program, which has disappeared from most unix distributions, this content-encoding is not used by many browsers today, partly because of a patent issue (it expired in 2003).
... content-encoding: gzip note that the server is not obligated to use any compression method.
CSP: plugin-types - HTTP
instantiation of an <embed>, <object> or <applet> element will fail if: the element to load does not declare a valid mime type, the declared type does not match one of specified types in the plugin-types directive, the fetched resource does not match the declared type.
...not setting this allows anything.
CSP: report-uri - HTTP
csp version 1 directive type reporting directive this directive is not supported in the <meta> element.
... "\n\nfurther cps violations will be logged to the following log file, but no further email notifications will be sent until this log file is deleted:\n\n" .
Content-Type - HTTP
browsers will do mime sniffing in some cases and will not necessarily follow the value of this header; to prevent this behavior, the header x-content-type-options can be set to nosniff.
... boundary for multipart entities the boundary directive is required, which consists of 1 to 70 characters from a set of characters known to be very robust through email gateways, and not ending with white space.
Cross-Origin-Embedder-Policy - HTTP
require-corp a document can only load resources from the same origin, or resources explicitly marked as loadable from another origin.
...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.
Digest - HTTP
WebHTTPHeadersDigest
the representation itself may be: fully contained in the response message body not at all contained in the 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).
...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.
Expect - HTTP
WebHTTPHeadersExpect
the only expectation defined in the specification is expect: 100-continue, to which the server shall respond with: 100 if the information contained in the header is sufficient to cause an immediate success, 417 (expectation failed) if it cannot meet the expectation; or any other 4xx status otherwise.
... put /somewhere/fun http/1.1 host: origin.example.com content-type: video/h264 content-length: 1234567890987 expect: 100-continue the server now checks the request headers and may respond with a 100 (continue) response to instruct the client to go ahead and send the message body, or it will send a 417 (expectation failed) status if any of the expectations cannot be met.
Feature-Policy: camera - HTTP
when this policy is enabled, the promise returned by mediadevices.getusermedia() will reject with a notallowederror.
...the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: fullscreen - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
...it can do so by delivering the following http response header to define a feature policy: feature-policy: fullscreen 'self' then include an allow attribute on the <iframe> element: <iframe src="https://other.com/videoplayer" allow="fullscreen"></iframe> iframe attributes can selectively enable features in certain frames, and not in others, even if those frames contain documents from the same origin.
Feature-Policy: geolocation - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
...it can do so by delivering the following http response header to define a feature policy: feature-policy: geolocation 'self' then include an allow attribute on the <iframe> element: <iframe src="https://other.com/map" allow="geolocation"></iframe> iframe attributes can selectively enable features in certain frames, and not in others, even if those frames contain documents from the same origin.
Feature-Policy: microphone - HTTP
when this policy is enabled, the promise returned by mediadevices.getusermedia() will reject with a notallowederror.
...the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: unsized-media - HTTP
this restriction solves "layout instability" problem caused by providing default dimensions for images whose size is not specified in advance so that image doesn't change size after loading.
...the feature is not allowed in cross-origin documents in nested browsing contexts.
Forwarded - HTTP
this can be either: an ip address (v4 or v6, optionally with a port, and ipv6 quoted and enclosed in square brackets), an obfuscated identifier (such as "_hidden" or "_secret"), or "unknown" when the preceding entity is not known (and you still want to indicate that forwarding of the request was made).
...note that ipv6 address are quoted and enclosed in square brackets in forwarded.
Keep-Alive - HTTP
note that timeouts longer than the tcp timeout may be ignored if no keep-alive tcp message is set at the transport level.
...unless 0, this value is ignored for non-pipelined connections as another request will be sent in the next response.
Public-Key-Pins-Report-Only - HTTP
note: public key pinning mechanism was deprecated in favor of certificate transparency and expect-ct header.
... max-age=<expire-time> this directive is meaningless for the public-key-pins-report-only header, it will be ignored by user agents and the header will not be cached.
Save-Data - HTTP
note: disabling http/2 server push (rfc 7540, section 8.2: server push) might be desirable too for reducing data downloads.
... examples the vary header ensures that the content is cached properly (for instance ensuring that the user is not served a lower-quality image from the cache when save-data header is no longer present [e.g.
Vary - HTTP
WebHTTPHeadersVary
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-name> a comma-separated list of header names to take into account when deciding whether or not a cached response can be used.
Warning - HTTP
WebHTTPHeadersWarning
note: the warning header is soon to be deprecated; see warning (https://github.com/httpwg/http-core/issues/139) and warning: header & stale-while-revalidate (https://github.com/whatwg/fetch/issues/913) for more details.
... 2xx warn-codes describe some aspect of the representation that is not rectified by a validation and won't be deleted by a cache after validation unless a full response is sent.
X-Forwarded-For - HTTP
x-forwarded-for is also an email-header indicating that an email-message was forwarded from another account.
... examples x-forwarded-for: 2001:db8:85a3:8d3:1319:8a2e:370:7348 x-forwarded-for: 203.0.113.195 x-forwarded-for: 203.0.113.195, 70.41.3.18, 150.172.238.178 other non-standard forms: # used for some google services x-proxyuser-ip: 203.0.113.19 specifications not part of any current specification.
X-Forwarded-Proto - HTTP
your server access logs contain the protocol used between the server and the load balancer, but not the protocol used between the client and the load balancer.
... examples x-forwarded-proto: https other non-standard forms: # microsoft front-end-https: on x-forwarded-protocol: https x-forwarded-ssl: on x-url-scheme: https specifications not part of any current specification.
X-XSS-Protection - HTTP
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.
... example block pages from loading when they detect reflected xss attacks: x-xss-protection: 1; mode=block php header("x-xss-protection: 1; mode=block"); apache (.htaccess) <ifmodule mod_headers.c> header set x-xss-protection "1; mode=block" </ifmodule> nginx add_header "x-xss-protection" "1; mode=block"; specifications not part of any specifications or drafts.
POST - HTTP
WebHTTPMethodsPOST
non-alphanumeric characters in both keys and values are percent encoded: this is the reason why this type is not suitable to use with binary data (use multipart/form-data instead) multipart/form-data: each value is sent as a block of data ("body part"), with a user agent-defined delimiter ("boundary") separating each part.
...as described in the http 1.1 specification, post is designed to allow a uniform method to cover the following functions: annotation of existing resources posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; adding a new user through a signup modal; providing a block of data, such as the result of submitting a form, to a data-handling process; extending a database through an append operation.
Proxy servers and tunneling - HTTP
to provide information about the proxy itself (not about the client connecting to it), the via header can be used.
...note, however, that not all proxy servers support the connect method or limit it to port 443 only.
307 Temporary Redirect - HTTP
WebHTTPStatus307
this is useful when you want to give an answer to a put method that is not the uploaded resources, but a confirmation message (like "you successfully uploaded xyz").
... the only difference between 307 and 302 is that 307 guarantees that the method and the body will not be changed when the redirected request is made.
308 Permanent Redirect - HTTP
WebHTTPStatus308
the request method and the body will not be altered, whereas 301 may incorrectly sometimes be changed to a get method.
... note: some web applications may use the 308 permanent redirect in a non-standard way and for other purposes.
400 Bad Request - HTTP
WebHTTPStatus400
the hypertext transfer protocol (http) 400 bad request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
... the client should not repeat this request without modification.
402 Payment Required - HTTP
WebHTTPStatus402
sometimes, this code indicates that the request can not be processed until the client makes a payment.
... originally it was created to enable digital cash or (micro) payment systems and would indicate that the requested content is not available until the client makes a payment.
412 Precondition Failed - HTTP
WebHTTPStatus412
this happens with conditional requests on methods other than get or head when the condition defined by the if-unmodified-since or if-none-match headers is not fulfilled.
... in that case, the request, usually an upload or a modification of a resource, cannot be made and this error response is sent back.
503 Service Unavailable - HTTP
WebHTTPStatus503
the hypertext transfer protocol (http) 503 service unavailable server error response code indicates that the server is not ready to handle the request.
... note: together with this response, a user-friendly page explaining the problem should be sent.
504 Gateway Timeout - HTTP
WebHTTPStatus504
the hypertext transfer protocol (http) 504 gateway timeout server error response code indicates that the server, while acting as a gateway or proxy, did not get a response in time from the upstream server that it needed in order to complete the request.
... note: a gateway might refer to different things in networking and a 504 error is usually not something you can fix, but requires a fix by the web server or the proxies you are trying to get access through.
511 Network Authentication Required - HTTP
WebHTTPStatus511
this status is not generated by origin servers, but by intercepting proxies that control access to the network.
...they often identify clients who have not done so using their media access control (mac) addresses.
About JavaScript - JavaScript
contrary to popular misconception, javascript is not "interpreted java".
... another common application for javascript is as a (web) server side scripting language.
Private class fields - JavaScript
class classwithprivatefield { #privatefield constructor() { this.#privatefield = 42 this.#randomfield = 666 // syntax error } } const instance = new classwithprivatefield() instance.#privatefield === 42 // syntax error private methods private static methods like their public equivalent, private static methods are called on the class itself, not instances of the class.
...in the following example this refers to the derived class (not the base class) when we try to call derived.publicstaticmethod2(), and thus exhibits the same "provenance restriction" as mentioned above: class base { static #privatestaticmethod() { return 42; } static publicstaticmethod1() { return base.#privatestaticmethod(); } static publicstaticmethod2() { return this.#privatestaticmethod(); } } class derive...
extends - JavaScript
the extends keyword is used in class declarations or class expressions to create a class that is a child of another class.
... 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'.
RangeError: radix must be an integer - JavaScript
the javascript exception "radix must be an integer at least 2 and no greater than 36" occurs when the optional radix parameter of the number.prototype.tostring() or the bigint.prototype.tostring() method was specified and is not between 2 and 36.
... examples invalid cases (42).tostring(0); (42).tostring(1); (42).tostring(37); (42).tostring(150); // you cannot use a string like this for formatting: (12071989).tostring('mm-dd-yyyy'); valid cases (42).tostring(2); // "101010" (binary) (13).tostring(8); // "15" (octal) (0x42).tostring(10); // "66" (decimal) (100000).tostring(16) // "186a0" (hexadecimal) ...
SyntaxError: test for equality (==) mistyped as assignment (=)? - JavaScript
examples assignment within conditional expressions it is advisable to not use simple assignments in a conditional expression (such as if...else), because the assignment can be confused with equality when glancing over the code.
... for example, do not use the following code: if (x = y) { // do the right thing } if you need to use an assignment in a conditional expression, a common practice is to put additional parentheses around the assignment.
RangeError: invalid array length - JavaScript
if you are creating an array, using the constructor, you probably want to use the literal notation instead, as the first argument is interpreted as the length of the array.
...; // set 2^32 to the length property valid cases [ math.pow(2, 40) ] // [ 1099511627776 ] [ -1 ] // [ -1 ] new arraybuffer(math.pow(2, 32) - 1) new arraybuffer(0) let a = []; a.length = math.max(0, a.length - 1); let b = new array(math.pow(2, 32) - 1); b.length = math.min(0xffffffff, b.length + 1); // 0xffffffff is the hexadecimal notation for 2^32 - 1 // which can also be written as (-1 >>> 0) ...
SyntaxError: JSON.parse: bad parsing - JavaScript
examples json.parse() does not allow trailing commas both lines will throw a syntaxerror: json.parse('[1, 2, 3, 4,]'); json.parse('{"foo": 1,}'); // syntaxerror json.parse: unexpected character // at line 1 column 14 of the json data omit the trailing commas to parse the json correctly: json.parse('[1, 2, 3, 4]'); json.parse('{"foo": 1}'); property names must be double-quoted strings you cannot use single-quotes around ...
... json.parse("{'foo': 1}"); // syntaxerror: json.parse: expected property name or '}' // at line 1 column 2 of the json data instead write "foo": json.parse('{"foo": 1}'); leading zeros and decimal points you cannot use leading zeros, like 01, and decimal points must be followed by at least one digit.
URIError: malformed URI sequence - JavaScript
an argument given to either the decodeuri, encodeuri, encodeuricomponent, or decodeuricomponent function was not valid, so that the function was unable encode or decode properly.
...an urierror will be thrown if there is an attempt to encode a surrogate which is not part of a high-low pair, for example: encodeuri('\ud800'); // "urierror: malformed uri sequence" encodeuri('\udfff'); // "urierror: malformed uri sequence" a high-low pair is ok.
SyntaxError: missing formal parameter - JavaScript
in the declaration of a function, the parameters must be identifiers, not any value like numbers, strings, or objects.
... in javascript, identifiers can contain only alphanumeric characters (or "$" or "_"), and may not start with a digit.
SyntaxError: missing name after . operator - JavaScript
examples property access property accessors in javascript use either the dot (.) or square brackets ([]), but not both.
...concatenation if you are coming from another programming language (like php), it is also easy to mix up the dot operator (.) and the concatenation operator (+).
TypeError: More arguments needed - JavaScript
message typeerror: argument is not an object and is not null (edge) typeerror: object.create requires at least 1 argument, but only 0 were passed typeerror: object.setprototypeof requires at least 2 arguments, but only 0 were passed typeerror: object.defineproperties requires at least 1 argument, but only 0 were passed error type typeerror.
... examples required arguments not provided the object.create() method requires at least one argument and the object.setprototypeof() method requires at least two arguments: var obj = object.create(); // typeerror: object.create requires at least 1 argument, but only 0 were passed var obj = object.setprototypeof({}); // typeerror: object.setprototypeof requires at least 2 arguments, but only 1 were passed you can fix this by setting null as the prototype, for example: var obj = object.create(null); var obj = object.setprototypeof({}, null); ...
TypeError: can't delete non-configurable array element - JavaScript
message typeerror: can't delete non-configurable array element (firefox) typeerror: cannot delete property '2' of [object array] (chrome) error type typeerror what went wrong?
...in case of a copy, shortening the copy of the array does not modify the original array length.
SyntaxError: redeclaration of formal parameter "x" - JavaScript
redeclaring the same variable within the same function or block scope using let is not allowed in javascript.
... function f(arg) { let arg = 'foo'; } // syntaxerror: redeclaration of formal parameter "arg" if you want to change the value of "arg" in the function body, you can do so, but you do not need to declare the same variable again.
SyntaxError: Unexpected token - JavaScript
examples expression expected for example, when chaining expressions, trailing commas are not allowed.
... for (let i = 0; i < 5,; ++i) { console.log(i); } // syntaxerror: expected expression, got ')' correct would be omitting the comma or adding another expression: for (let i = 0; i < 5; ++i) { console.log(i); } not enough brackets sometimes, you leave out brackets around if statements: function round(n, upperbound, lowerbound){ if(n > upperbound) || (n < lowerbound){ throw 'number ' + string(n) + ' is more than ' + string(upperbound) + ' or less than ' + string(lowerbound); }else if(n < ((upperbound + lowerbound)/2)){ return lowerbound; }else{ return upperbound; } } // syntaxerror: expected expression, got '||' the brackets may look correct at first, but note how the || is outside the brackets.
SyntaxError: unterminated string literal - JavaScript
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.
... that form looks like this: var longstring = 'this is a very long string which needs \ to wrap across multiple lines because \ otherwise my code is unreadable.'; another possibility is to use template literals, which are supported in ecmascript 2015 environments: var longstring = `this is a very long string which needs to wrap across multiple lines because otherwise my code is unreadable.`; ...
Array.prototype[@@unscopables] - JavaScript
the @@unscopable symbol property contains property names that were not included in the ecmascript standard prior to the es2015 version.
...that means that inside with environments, "keys" would now be the method and not the variable.
Array.prototype.flat() - JavaScript
flatdeep(val, d - 1) : val), []) : arr.slice(); }; flatdeep(arr, infinity); // [1, 2, 3, 4, 5, 6] use a stack // non recursive flatten deep using a stack // note that depth control is hard/inefficient as we will need to tag each value with its own depth // also possible w/o reversing on shift/unshift, but array ops on the end tends to be faster function flatten(input) { const stack = [...input]; const res = []; while(stack.length) { // pop value from stack const next = stack.pop(); if(array.isarray(next)) { // push back array item...
...rator function function* flatten(array, depth) { if(depth === undefined) { depth = 1; } for(const item of array) { if(array.isarray(item) && depth > 0) { yield* flatten(item, depth - 1); } else { yield item; } } } const arr = [1, 2, [3, 4, [5, 6]]]; const flattened = [...flatten(arr, infinity)]; // [1, 2, 3, 4, 5, 6] please do not add polyfills on this article.
Array.isArray() - JavaScript
see the article “determining with absolute accuracy whether or not a javascript object is an array” for more details.
... polyfill running the following code before any other code will create array.isarray() if it's not natively available.
Array.prototype.length - JavaScript
console.log(arr); // [ 1, 2, <3 empty items> ] arr.foreach(element => console.log(element)); // 1 // 2 as you can see, the length property does not necessarily indicate the number of defined values in the array.
... property attributes of array.prototype.length writable yes enumerable no configurable no writable: if this attribute set to false, the value of the property cannot be changed.
Array.of() - JavaScript
the difference between array.of() and the array constructor is in the handling of integer arguments: array.of(7) creates an array with a single element, 7, whereas array(7) creates an empty array with a length property of 7 (note: this implies an array of 7 empty slots, not slots with actual undefined values).
... for more information, see: array.of() array.from() proposal array.of() polyfill polyfill running the following code before any other code will create array.of() if it's not natively available.
Array.prototype.splice() - JavaScript
note: in ie8, it won't delete all when deletecount is omitted.
...if you do not specify any elements, splice() will only remove elements from the array.
Array.prototype.unshift() - JavaScript
objects which do not contain a length property—reflecting the last in a series of consecutive, zero-based numerical properties—may not behave in any meaningful manner.
... please note that, if multiple elements are passed as parameters, they're inserted in chunk at the beginning of the object, in the exact same order they were passed as parameters.
ArrayBuffer - JavaScript
it is an array of bytes, often referred to in other languages as a "byte array".you cannot directly manipulate the contents of an arraybuffer; instead, you create one of the typed array objects or a dataview object which represents the buffer in a specific format, and use that to read and write the contents of the buffer.
...this is established when the array is constructed and cannot be changed.
Atomics.compareExchange() - JavaScript
it returns the old value at that position whether it was equal to the expected value or not.
... exceptions throws a typeerror, if typedarray is not one of the allowed integer types.
BigInt64Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation).
... examples different ways to create a bigint64array // from a length var bigint64 = new bigint64array(2); bigint64[0] = 42n; console.log(bigint64[0]); // 42n console.log(bigint64.length); // 2 console.log(bigint64.bytes_per_element); // 8 // from an array var arr = new bigint64array([21n,31n]); console.log(arr[1]); // 31n // from another typedarray var x = new bigint64array([21n, 31n]); var y = new bigint64array(x); console.log(y[0]); // 21n // from an arraybuffer var buffer = new arraybuffer(32); var z = new bigint64array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1n, 2n, 3n]; }(); var bigint64 = new bigint64array(iterable); // bigint64array[1n, 2n, 3n] specifications specification ...
BigUint64Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation).
... examples different ways to create a biguint64array // from a length var biguint64 = new biguint64array(2); biguint64[0] = 42n; console.log(biguint64[0]); // 42n console.log(biguint64.length); // 2 console.log(biguint64.bytes_per_element); // 8 // from an array var arr = new biguint64array([21n,31n]); console.log(arr[1]); // 31n // from another typedarray var x = new biguint64array([21n, 31n]); var y = new biguint64array(x); console.log(y[0]); // 21n // from an arraybuffer var buffer = new arraybuffer(32); var z = new biguint64array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1n, 2n, 3n]; }(); var biguint64 = new biguint64array(iterable); // biguint64array[1n, 2n, 3n] specifications specificat...
DataView.prototype.byteLength - JavaScript
the value is established when an dataview is constructed and cannot be changed.
... if the dataview is not specifying an offset or a bytelength, the bytelength of the referenced arraybuffer or sharedarraybuffer will be returned.
Date.prototype.getTimezoneOffset() - JavaScript
note that this means that the offset is positive if the local timezone is behind utc, and negative if it is ahead.
... examples using gettimezoneoffset() // get current timezone offset for host device let x = new date(); let currenttimezoneoffsetinhours = x.gettimezoneoffset() / 60; // 1 // get timezone offset for international labour day (may 1) in 2016 // be careful, the date() constructor uses 0-indexed months, so may is // represented with 4 (and not 5) let labourday = new date(2016, 4, 1) let labourdayoffset = labourday.gettimezoneoffset() / 60; specifications specification ecmascript (ecma-262)the definition of 'date.prototype.gettimezoneoffset' in that specification.
Date.prototype.toDateString() - JavaScript
the todatestring() method is especially useful because compliant engines implementing ecma-262 may differ in the string obtained from tostring() for date objects, as the format is implementation-dependent and simple string slicing approaches may not produce consistent results across multiple engines.
... examples a basic usage of todatestring() var d = new date(1993, 5, 28, 14, 39, 7); console.log(d.tostring()); // logs mon jun 28 1993 14:39:07 gmt-0600 (pdt) console.log(d.todatestring()); // logs mon jun 28 1993 note: month are 0-indexed when used as an argument of date (thus 0 corresponds to january and 11 to december).
Date.prototype.toLocaleDateString() - JavaScript
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.
...�۱/۹/۳۰" // 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...
Date.prototype.toLocaleTimeString() - JavaScript
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.
...h english 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 = { ...
Error.prototype.lineNumber - JavaScript
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.
... specifications not part of any standard.
Error.prototype.toSource() - JavaScript
note: be aware that the properties used by the tosource method in the creation of this string are mutable and may not accurately reflect the function used to create an error instance or the filename or line number where the actual error occurred.
... specifications not part of any standard.
Error - JavaScript
typeerror creates an instance representing an error that occurs when a variable or parameter is not of a valid type.
...otherwise, old versions of babel and other transpilers will not correctly handle the following code without additional configuration.
EvalError() constructor - JavaScript
this exception is not thrown by javascript anymore, however the evalerror object remains for compatibility.
...the line number of the code that caused the exception examples evalerror is not used in the current ecmascript specification and will thus not be thrown by the runtime.
EvalError - JavaScript
this exception is not thrown by javascript anymore, however the evalerror object remains for compatibility.
... examples evalerror is not used in the current ecmascript specification and will thus not be thrown by the runtime.
Float32Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... examples different ways to create a float32array // from a length var float32 = new float32array(2); float32[0] = 42; console.log(float32[0]); // 42 console.log(float32.length); // 2 console.log(float32.bytes_per_element); // 4 // from an array var arr = new float32array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new float32array([21, 31]); var y = new float32array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(16); var z = new float32array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var float32 = new float32array(iterable); // float32array[1, 2, 3] specifications specification ecmasc...
Float64Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... examples different ways to create a float64array // from a length var float64 = new float64array(2); float64[0] = 42; console.log(float64[0]); // 42 console.log(float64.length); // 2 console.log(float64.bytes_per_element); // 8 // from an array var arr = new float64array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new float64array([21, 31]); var y = new float64array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(32); var z = new float64array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var float64 = new float64array(iterable); // float64array[1, 2, 3] specifications specification ecmasc...
Function.arguments - JavaScript
the value of the arguments property is normally null if there is no outstanding invocation of the function in progress (that is, the function has been called but has not yet returned.
... examples using the arguments object function f(n) { g(n - 1) } function g(n) { console.log('before: ' + g.arguments[0]) if (n > 0) { f(n) } console.log('after: ' + g.arguments[0]) } f(2) console.log('returned: ' + g.arguments) // output // before: 1 // before: 0 // after: 0 // after: 1 // returned: null specifications not part of any standard.
Function.caller - JavaScript
notes note that in case of recursion, you can't reconstruct the call stack using this property.
... function myfunc() { if (myfunc.caller == null) { return 'the function was called from the top!'; } else { return 'this function\'s caller was ' + myfunc.caller; } } specifications not part of any standard.
Function.displayName - JavaScript
popup.displayname); // "show popup" defining a displayname in function expressions you can define a function with a display name in a function expression: var object = { somemethod: function() {} }; object.somemethod.displayname = 'somemethod'; console.log(object.somemethod.displayname); // logs "somemethod" try { somemethod } catch(e) { console.log(e); } // referenceerror: somemethod is not defined changing displayname dynamically you can dynamically change the displayname of a function: var object = { // anonymous somemethod: function(value) { arguments.callee.displayname = 'somemethod (' + value + ')'; } }; console.log(object.somemethod.displayname); // "undefined" object.somemethod('123') console.log(object.somemethod.displayname); // "somemethod (123)" specific...
...ations not part of any standard.
Function.prototype.toString() - JavaScript
description the function object overrides the tostring method inherited from object; it does not inherit object.prototype.tostring.
... the tostring() method will throw a typeerror exception ("function.prototype.tostring called on incompatible object"), if its this value object is not a function object.
Generator.prototype.next() - JavaScript
this is equivalent of not specifying the done property altogether.
... note that the first call does not log anything, because the generator was not yielding anything initially.
Int16Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... examples different ways to create an int16array // from a length var int16 = new int16array(2); int16[0] = 42; console.log(int16[0]); // 42 console.log(int16.length); // 2 console.log(int16.bytes_per_element); // 2 // from an array var arr = new int16array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new int16array([21, 31]); var y = new int16array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new int16array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var int16 = new int16array(iterable); // int16array[1, 2, 3] specifications specification ecmascript (ecma-262)th...
Int32Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... examples different ways to create an int32array // from a length var int32 = new int32array(2); int32[0] = 42; console.log(int32[0]); // 42 console.log(int32.length); // 2 console.log(int32.bytes_per_element); // 4 // from an array var arr = new int32array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new int32array([21, 31]); var y = new int32array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(16); var z = new int32array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var int32 = new int32array(iterable); // int32array[1, 2, 3] specifications specification ecmascript (ecma-262)t...
Int8Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... examples different ways to create an int8array // from a length var int8 = new int8array(2); int8[0] = 42; console.log(int8[0]); // 42 console.log(int8.length); // 2 console.log(int8.bytes_per_element); // 1 // from an array var arr = new int8array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new int8array([21, 31]); var y = new int8array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new int8array(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var int8 = new int8array(iterable); // int8array[1, 2, 3] specifications specification ecmascript (ecma-262)the defi...
Intl.Collator.supportedLocalesOf() - JavaScript
examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in collation, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is not used with indonesian and a specialized german for indonesia is 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.
Intl.DateTimeFormat.prototype.formatToParts() - JavaScript
examples datetimeformat outputs localized, opaque strings that cannot be manipulated directly: var date = date.utc(2012, 11, 17, 3, 0, 42); var formatter = new intl.datetimeformat('en-us', { weekday: 'long', year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', fractionalseconddigits: 3, hour12: true, timezone: 'utc' }); formatter.format(date); // "monday, 12/17/2012, 3:00:42.000 am" howev...
... gregorian relatedyear: let opts = { year: "numeric", month: "numeric", day: "numeric" }; let df = new intl.datetimeformat("zh-u-ca-chinese", opts); df.formattoparts(date.utc(2012, 11, 17, 3, 0, 42)); // return value [ { type: 'relatedyear', value: '2012' }, { type: 'literal', value: '年' }, { type: 'month', value: '十一月' }, { type: 'day', value: '4' } ] if the year option is not set in the bag (to any value), the result will include only the relatedyear: let df = new intl.datetimeformat("zh-u-ca-chinese"); df.formattoparts(date.utc(2012, 11, 17, 3, 0, 42)); // return value [ { type: 'relatedyear', value: '2012' }, { type: 'literal', value: '年' }, { type: 'month', value: '十一月' }, { type: 'day', value: '4' } ] in cases where the year would be outp...
Intl.DateTimeFormat.prototype.resolvedOptions() - JavaScript
warning: applications should not rely on undefined being returned, as future versions may return a string value identifying the runtime’s default time zone instead.
...some of these properties may not be present, indicating that the corresponding components will not be represented in formatted output.
Intl.DateTimeFormat.supportedLocalesOf() - JavaScript
examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in date and time formatting, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is neither relevant to date and time formatting nor used with indonesian, and a specialized german for indonesia is 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.
Intl.DisplayNames.supportedLocalesOf() - JavaScript
examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in date and time formatting, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is neither relevant to date and time formatting nor used with indonesian, and a specialized german for indonesia is 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.
Intl.ListFormat.supportedLocalesOf() - JavaScript
examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in date and time formatting, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is neither relevant to date and time formatting nor used with indonesian, and a specialized german for indonesia is 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.
Intl.Locale.prototype.maximize() - JavaScript
other subtags after the "-u" in the locale indentifier are called extension subtags and are not affected by the maximize() method.
...// note that the extension tags (after "-u") remain unchanged.
Intl.Locale.prototype.minimize() - JavaScript
other subtags after the "-u" in the locale indentifier are called extension subtags and are not affected by the minimize() method.
...// note that the extension tags (after "-u") remain unchanged.
Intl.Locale.prototype.script - JavaScript
in many cases, denoting a script is not strictly necessary, since the language (which is necessary) is only written in a single script.
...note that the script is not a required part of a locale identifier.
Intl.NumberFormat.supportedLocalesOf() - JavaScript
examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in number formatting, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is neither relevant to number formatting nor used with indonesian, and a specialized german for indonesia is 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.
Intl.PluralRules.supportedLocalesOf() - JavaScript
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 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.
Intl.RelativeTimeFormat() constructor - JavaScript
the "auto" value allows to not always have to use numeric values in the output.
...this allows to not always have to use numeric values in the output.
Intl.RelativeTimeFormat.supportedLocalesOf() - JavaScript
examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in date and time formatting, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is neither relevant to date and time formatting nor used with indonesian, and a specialized german for indonesia is 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.
JSON - JavaScript
the json object contains methods for parsing javascript object notation (json) and converting values to json.
...it is based upon javascript syntax but is distinct from it: some javascript is not json.
Math.atan() - JavaScript
because atan() is a static method of math, you always use it as math.atan(), rather than as a method of a math object you created (math is not a constructor).
... examples using math.atan() math.atan(1); // 0.7853981633974483 math.atan(0); // 0 math.atan(-0); // -0 math.atan(infinity); // 1.5707963267948966 math.atan(-infinity); // -1.5707963267948966 // the angle that the line [(0,0);(x,y)] forms with the x-axis in a cartesian coordinate system math.atan(y / x); note that you may want to avoid using ±infinity for stylistic reasons.
Math.atan2() - JavaScript
note that the arguments to this function pass the y-coordinate first and the x-coordinate second.
... because atan2() is a static method of math, you always use it as math.atan2(), rather than as a method of a math object you created (math is not a constructor).
Math.imul() - JavaScript
because imul() is a static method of math, you always use it as math.imul(), rather than as a method of a math object you created (math is not a constructor).
... var alo = a & 0xffff; var bhi = (b >>> 16) & 0xffff; var blo = b & 0xffff; // the shift by 0 fixes the sign on the high part // the final |0 converts the unsigned value into a signed value return ((alo * blo) + (((ahi * blo + alo * bhi) << 16) >>> 0) | 0); }; however, the following function is more performant because it is likely that browsers in which this polyfill would be used do not optimize with an internal integer type in javascript, instead using floating points for all numbers.
Math.log2() - JavaScript
because log2() is a static method of math, you always use it as math.log2(), rather than as a method of a math object you created (math is not a constructor).
...note that it returns imprecise values on some inputs (like 1 << 29), wrap into math.round() if working with bit masks.
Number.NaN - JavaScript
the number.nan property represents not-a-number.
... you do not have to create a number object to access this static property (use number.nan).
Object.prototype.__defineSetter__() - JavaScript
examples non-standard and deprecated way var o = {}; o.__definesetter__('value', function(val) { this.anothervalue = val; }); o.value = 5; console.log(o.value); // undefined console.log(o.anothervalue); // 5 standard-compliant ways // using the set operator var o = { set value(val) { this.anothervalue = val; } }; o.value = 5; console.log(o.value); // undefined console.log(o.anothervalue); // 5 // using object.defineproperty var o = {}; object.defineproperty(o, 'value', { set: function(val) { ...
... this.anothervalue = val; } }); o.value = 5; console.log(o.value); // undefined console.log(o.anothervalue); // 5 specifications specification ecmascript (ecma-262)the definition of 'object.prototype.__definesetter__()' in that specification.
Object.defineProperties() - JavaScript
each value in props must be either a data descriptor or an accessor descriptor; it cannot be both (see object.defineproperty() for more details).
... polyfill assuming a pristine execution environment with all names and properties referring to their initial values, object.defineproperties is almost completely equivalent (note the comment in iscallable) to the following reimplementation in javascript: function defineproperties(obj, properties) { function converttodescriptor(desc) { function hasproperty(obj, prop) { return object.prototype.hasownproperty.call(obj, prop); } function iscallable(v) { // nb: modify as necessary if other values than functions are callable.
Object.entries() - JavaScript
the order of the array returned by object.entries() does not depend on how an object is defined.
... polyfill to add compatible object.entries() support in older environments that do not natively support it, you can use any of the following: a demonstration implementation of object.entries in the tc39/proposal-object-values-entries (if you don't need any support for ie); a polyfill in the es-shims/object.entries repositories; or, you can use the simple, ready-to-deploy polyfill listed below: if (!object.entries) { object.entries = function( obj ){ var ownprops = obje...
handler.getPrototypeOf() - JavaScript
if target is not extensible, object.getprototypeof(proxy) method must return the same value as object.getprototypeof(target).
...otypeof(p) === array.prototype, // true p.__proto__ === array.prototype, // true array.prototype.isprototypeof(p), // true p instanceof array // true ); two kinds of exceptions const obj = {}; const p = new proxy(obj, { getprototypeof(target) { return 'foo'; } }); object.getprototypeof(p); // typeerror: "foo" is not an object or null const obj = object.preventextensions({}); const p = new proxy(obj, { getprototypeof(target) { return {}; } }); object.getprototypeof(p); // typeerror: expected same prototype value specifications specification ecmascript (ecma-262)the definition of '[[getprototypeof]]' in that specification.
handler.has() - JavaScript
interceptions this trap can intercept these operations: property query: foo in proxy inherited property query: foo in object.create(proxy) with check: with(proxy) { (foo); } reflect.has() invariants if the following invariants are violated, the proxy will throw a typeerror: a property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object.
... a property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible.
Reflect.has() - JavaScript
return value a boolean indicating whether or not the target has the property.
... exceptions a typeerror, if target is not an object.
Reflect.set() - JavaScript
return value a boolean indicating whether or not setting the property was successful.
... exceptions a typeerror, if target is not an object.
RegExp.prototype.exec() - JavaScript
note that the lastindex property will not be reset when searching a different string, it will start its search at its existing lastindex .
...next match starts at 9 warning: do not place the regular expression literal (or regexp constructor) within the while condition!
RegExp.prototype.global - JavaScript
the global property indicates whether or not the "g" flag is used with the regular expression.
... you cannot change this property directly.
RegExp.prototype.ignoreCase - JavaScript
the ignorecase property indicates whether or not the "i" flag is used with the regular expression.
... you cannot change this property directly.
RegExp.prototype.multiline - JavaScript
the multiline property indicates whether or not the "m" flag is used with the regular expression.
... you cannot change this property directly.
RegExp.prototype.unicode - JavaScript
the unicode property indicates whether or not the "u" flag is used with a regular expression.
... you cannot change this property directly.
Set.prototype.has() - JavaScript
the has() method returns a boolean indicating whether an element with the specified value exists in a set object or not.
... note: technically speaking, has() uses the samevaluezero algorithm to determine whether the given element is found.
Planned changes to shared memory - JavaScript
note that setting the cross-origin-resource-policy header to any other value than same-origin opens up the resource to potential attacks, such as spectre.
... note that the cross-origin-opener-policy header limits your ability to retain a reference to popups.
String length - JavaScript
utf-16, the string format used by javascript, uses a single 16-bit code unit to represent the most common characters, but needs to use two code units for less commonly-used characters, so it's possible for the value returned by length to not match the actual number of characters in the string.
... unicode since `length` counts code units instead of characters, if you want to get the number of characters you need something like this: function getcharacterlength (str) { // the string iterator that is used here iterates over characters, // not mere code units return [...str].length; } console.log(getcharacterlength('a\ud87e\udc04z')); // 3 // while not recommended, you could add this to each string as follows: object.defineproperty(string.prototype, 'charlength', { get () { return getcharacterlength(this); } }); console.log('a\ud87e\udc04z'.charlength); // 3 examples basic usage let x = 'mozilla'; let empty = ''; con...
String.prototype.localeCompare() - JavaScript
negative when the referencestr occurs before comparestring positive when the referencestr occurs after comparestring returns 0 if they are equivalent do not rely on exact return values of -1 or 1!
... 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.
String.prototype.substr() - JavaScript
note: in microsoft jscript, negative values of the start argument are not considered to refer to the end of the string.
... polyfill microsoft's jscript does not support negative values for the start index.
String.prototype.toLocaleLowerCase() - JavaScript
tolocalelowercase() does not affect the value of the string itself.
... in most cases, this will produce the same result as tolowercase(), but for some locales, such as turkish, whose case mappings do not follow the default case mappings in unicode, there may be a different result.
String.prototype.toUpperCase() - JavaScript
this method does not affect the value of the string itself since javascript strings are immutable.
... examples basic usage console.log('alphabet'.touppercase()); // 'alphabet' conversion of non-string this values to strings this method will convert any non-string value to a string, when you set its this to a value that is not a string: const a = string.prototype.touppercase.call({ tostring: function tostring() { return 'abcdef'; } }); const b = string.prototype.touppercase.call(true); // prints out 'abcdef true'.
Symbol.prototype.description - JavaScript
description symbol objects can be created with an optional description which can be used for debugging but not to access the symbol itself.
...it is different to symbol.prototype.tostring() as it does not contain the enclosing "symbol()" string.
Symbol.for() - JavaScript
symbol.for() does also not necessarily create a new symbol on every call, but checks first if a symbol with the given key is already present in the registry.
... examples using symbol.for symbol.for('foo'); // create a new global symbol symbol.for('foo'); // retrieve the already created symbol // same global symbol, but not locally symbol.for('bar') === symbol.for('bar'); // true symbol('bar') === symbol('bar'); // false // the key is also used as the description var sym = symbol.for('mario'); sym.tostring(); // "symbol(mario)" to avoid name clashes with your global symbol keys and other (library code) global symbols, it might be a good idea to prefix your symbols: symbol.for('mdn.foo'); symbol.for('mdn.bar'); ...
Symbol.isConcatSpreadable - JavaScript
ic) // result: ['a', 'b', 'c', 1, 2, 3] when setting symbol.isconcatspreadable to false, you can disable the default behavior: let alpha = ['a', 'b', 'c'], let numeric = [1, 2, 3] numeric[symbol.isconcatspreadable] = false let alphanumeric = alpha.concat(numeric) console.log(alphanumeric) // result: ['a', 'b', 'c', [1, 2, 3] ] array-like objects for array-like objects, the default is to not spread.
... symbol.isconcatspreadable needs to be set to true in order to get a flattened array: let x = [1, 2, 3] let fakearray = { [symbol.isconcatspreadable]: true, length: 2, 0: 'hello', 1: 'world' } x.concat(fakearray) // [1, 2, 3, "hello", "world"] note: the length property is used to control the number of object properties to be added.
Symbol.prototype.toSource() - JavaScript
examples native function for the built-in symbol object, tosource returns the following string indicating that the source code is not available: "function symbol() { [native code] }" for instances of symbol, tosource returns a string representing the source code.
... "symbol()" specifications not part of any standard.
Symbol.prototype.toString() - JavaScript
description the symbol object overrides the tostring method of the object object; it does not inherit object.prototype.tostring().
... no string concatenation while you can call tostring() on symbols, you cannot use string concatenation with them: symbol('foo') + 'bar' // typeerror: can't convert symbol to string examples using tostring symbol('desc').tostring() // "symbol(desc)" // well-known symbols symbol.iterator.tostring() // "symbol(symbol.iterator) // global symbols symbol.for('foo').tostring() // "symbol(foo)" specifications specification ecmascript (ecma-262)the definition of 'symbol.prototype.tostring' in that specification.
TypeError - JavaScript
the typeerror object represents an error when an operation could not be performed, typically (but not exclusively) when a value is not of the expected type.
... a typeerror may be thrown when: an operand or argument passed to a function is incompatible with the type expected by that operator or function; or when attempting to modify a value that cannot be changed; or when attempting to use a value in an inappropriate way.
TypedArray.prototype.byteLength - JavaScript
the value is established when a typedarray is constructed and cannot be changed.
... if the typedarray is not specifying an byteoffset or a length, the length of the referenced arraybuffer will be returned.
TypedArray.prototype.length - JavaScript
the value is established when a typedarray is constructed and cannot be changed.
... if the typedarray is not specifying an byteoffset or a length, the length of the referenced arraybuffer will be returned.
TypedArray.prototype.some() - JavaScript
some does not mutate the typed array on which it is called.
... // 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.
Uint16Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
...6array constructor // without new is forbidden var dv = new uint16array([1, 2, 3]); examples different ways to create a uint16array // from a length var uint16 = new uint16array(2); uint16[0] = 42; console.log(uint16[0]); // 42 console.log(uint16.length); // 2 console.log(uint16.bytes_per_element); // 2 // from an array var arr = new uint16array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint16array([21, 31]); var y = new uint16array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint16array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint16 = new uint16array(iterable); // uint16array[1, 2, 3] specifications specification ecmascript (ecma-...
Uint32Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... examples different ways to create a uint32array // from a length var uint32 = new uint32array(2); uint32[0] = 42; console.log(uint32[0]); // 42 console.log(uint32.length); // 2 console.log(uint32.bytes_per_element); // 4 // from an array var arr = new uint32array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint32array([21, 31]); var y = new uint32array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(16); var z = new uint32array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint32 = new uint32array(iterable); // uint32array[1, 2, 3] specifications specification ecmascript (ecma...
Uint8Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... examples different ways to create a uint8array // from a length var uint8 = new uint8array(2); uint8[0] = 42; console.log(uint8[0]); // 42 console.log(uint8.length); // 2 console.log(uint8.bytes_per_element); // 1 // from an array var arr = new uint8array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint8array([21, 31]); var y = new uint8array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint8array(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint8 = new uint8array(iterable); // uint8array[1, 2, 3] specifications specification ecmascript (ecma-262)th...
Uint8ClampedArray() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... examples different ways to create a uint8clampedarray // from a length var uintc8 = new uint8clampedarray(2); uintc8[0] = 42; uintc8[1] = 1337; console.log(uintc8[0]); // 42 console.log(uintc8[1]); // 255 (clamped) console.log(uintc8.length); // 2 console.log(uintc8.bytes_per_element); // 1 // from an array var arr = new uint8clampedarray([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint8clampedarray([21, 31]); var y = new uint8clampedarray(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint8clampedarray(buffer, 1, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uintc8 = new uint8clampedarray(iterable); // uint8clampedarray[1, 2, 3] specifications specificat...
WeakSet() constructor - JavaScript
examples using the weakset object var ws = new weakset(); var foo = {}; var bar = {}; ws.add(foo); ws.add(bar); ws.has(foo); // true ws.has(bar); // true ws.delete(foo); // removes foo from the set ws.has(foo); // false, foo has been removed ws.has(bar); // true, bar is retained note that foo !== bar.
... while they are similar objects, they are not the same object.
WebAssembly.Global() constructor - JavaScript
mutable: a boolean value that determines whether the global is mutable or not.
...webassembly.instantiatestreaming(fetch('global.wasm'), { js: { global } }) .then(({instance}) => { asserteq("getting initial value from wasm", instance.exports.getglobal(), 0); global.value = 42; asserteq("getting js-updated value from wasm", instance.exports.getglobal(), 42); instance.exports.incglobal(); asserteq("getting wasm-updated value from js", global.value, 43); }); note: you can see the example running live on github; see also the source code.
WebAssembly.instantiateStreaming() - JavaScript
exceptions if either of the parameters are not of the correct type or structure, a typeerror is thrown.
... note: for this to work, .wasm files should be returned with an application/wasm mime type by the server.
decodeURI() - JavaScript
description replaces each escape sequence in the encoded uri with the character that it represents, but does not decode escape sequences that could not have been introduced by encodeuri.
... the character “#” is not decoded from escape sequences.
Standard built-in objects - JavaScript
the term "global objects" (or standard built-in objects) here is not to be confused with the global object.
... map set weakmap weakset structured data these objects represent and interact with structured data buffers and data coded using javascript object notation (json).
Exponentiation (**) - JavaScript
that is, you cannot put a unary operator (+/-/~/!/delete/void/typeof) immediately before the base number; doing so will cause a syntaxerror.
... note that some programming languages use the caret symbol ^ for exponentiation, but javascript uses that symbol for the bitwise logical xor operator.
Logical AND assignment (&&=) - JavaScript
syntax expr1 &&= expr2 description short-circuit evaluation the logical and operator is evaluated left to right, it is tested for possible short-circuit evaluation using the following rule: (some falsy expression) && expr is short-circuit evaluated to the falsy expression; short circuit means that the expr part above is not evaluated, hence any side effects of doing so do not take effect (e.g., if expr is a function call, the calling never takes place).
... logical and assignment short-circuits as well meaning that x &&= y is equivalent to: x && (x = y); and not equivalent to the following which would always perform an assignment: x = x && y; examples using logical and assignment let x = 0; let y = 1; x &&= 0; // 0 x &&= 1; // 0 y &&= 1; // 1 y &&= 0; // 0 specifications specification logical assignment operatorsthe definition of 'assignment operators' in that specification.
Logical nullish assignment (??=) - JavaScript
short circuit means that the expr part above is not evaluated, hence any side effects of doing so do not take effect (e.g., if expr is a function call, the calling never takes place).
...(x = y); and not equivalent to the following which would always perform an assignment: x = x ??
Right shift (>>) - JavaScript
since the new leftmost bit has the same value as the previous leftmost bit, the sign bit (the leftmost bit) does not change.
...since the new leftmost bit has the same value as the previous leftmost bit, the sign bit (the leftmost bit) does not change.
Strict inequality (!==) - JavaScript
the strict inequality operator (!==) checks whether its two operands are not equal, returning a boolean result.
... syntax x !== y description the strict inequality operator checks whether its operands are not equal.
yield - JavaScript
it cannot be called from nested functions or from callbacks.
...the value property is the result of evaluating the yield expression, and done is false, indicating that the generator function has not fully completed.
class - JavaScript
class declarations are not hoisted (unlike function declarations).
... note that super(), used in the constructor, can only be used in constructors, and must be called before the this keyword can be used.
for await...of - JavaScript
for await...of doesn't work with async iterators that are not async iterables.
... function* generator() { yield 0; yield 1; yield promise.resolve(2); yield promise.resolve(3); yield 4; } (async function() { for await (let num of generator()) { console.log(num); } })(); // 0 // 1 // 2 // 3 // 4 // compare with for-of loop: for (let numorpromise of generator()) { console.log(numorpromise); } // 0 // 1 // promise { 2 } // promise { 3 } // 4 note: be aware of yielding rejected promises from sync generator.
Statements and declarations - JavaScript
if the condition is false, another statement can be executed.
... import used to import functions exported from an external module, another script.
Template literals (Template strings) - JavaScript
line 2'); // "string text line 1 // string text line 2" using template literals, you can do the same like this: console.log(`string text line 1 string text line 2`); // "string text line 1 // string text line 2" expression interpolation in order to embed expressions within normal strings, you would use the following syntax: let a = 5; let b = 10; console.log('fifteen is ' + (a + b) + ' and\nnot ' + (2 * a + b) + '.'); // "fifteen is 15 and // not 20." now, with template literals, you are able to make use of the syntactic sugar, making substitutions like this more readable: let a = 5; let b = 10; console.log(`fifteen is ${a + b} and not ${2 * a + b}.`); // "fifteen is 15 and // not 20." nesting templates in certain cases, nesting a template is the easiest (and perhaps more readable) ...
...they will show up as undefined element in the “cooked” array: function latex(str) { return { "cooked": str[0], "raw": str.raw[0] } } latex`\unicode` // { cooked: undefined, raw: "\\unicode" } note that the escape sequence restriction is only dropped from tagged templates—not from untagged template literals: let bad = `bad escape sequence: \unicode`; specifications specification ecmascript (ecma-262)the definition of 'template literals' in that specification.
categories - Web app manifests
note: categories are used only as hints for catalogs or stores listing web applications.
... note: categories values are lower-cased by the stores and catalogs before processing, so "news" and "news" are treated as the same value.
display - Web app manifests
note: if the display member is not specified, it defaults to browser.
... note: you can selectively apply css to your app based on the display mode, using the display-mode media feature.
orientation - Web app manifests
note: orientation and/or its specific values might not be supported by a user agent on various display modes because supporting them does not make sense for the particular context.
... note: the orientation can be changed at runtime via the screen orientation api.
Web app manifests
ges/touch/homescreen192.png", "sizes": "192x192", "type": "image/png" }], "related_applications": [{ "platform": "play", "url": "https://play.google.com/store/apps/details?id=cheeaun.hackerweb" }] } 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).
... 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.
<merror> - MathML
WebMathMLElementmerror
note that this error is not thrown when your mathml markup is wrong or not well-formed xml.
... you will still get an xml parsing error (in case of the xhtml notation of mathml), which has nothing to do with <merror>.
<mglyph> - MathML
WebMathMLElementmglyph
the mathml <mglyph> element is used to display non-standard symbols where existing unicode characters are not available.
...users will see this displayed if the image url is wrong, the image is not in one of the supported formats, or until the image is downloaded.
Handling media support issues in web content - Web media technologies
this may be simply the first frame of video; however, in many cases, the first frame is blank, or contains nothing but the logo of a business, or some other image that doesn't give the reader any context for the video's contents.
... note: progressive (or interlaced) images are inherently slightly larger than the non-progressive versions of the same images.
Using audio and video in HTML - Web media technologies
note: this guide is a planned update to integrate content from various scattered places on mdn into one cohesive document or document set.
... the work is not yet scheduled but hopefully will come soon.
Guide to streaming audio and video - Web media technologies
the desktop version of android, however, does not support hls.
... 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.
Web media technologies
today, there are a large number of apis available, as well as html elements, dom interfaces, and other features that make it possible to not only perform these tasks, but use media in tandem with other technologies to do truly remarkable things.
...if you're not sure which api you should use, this is the place to start.
Performance Monitoring: RUM vs synthetic monitoring - Web Performance
the traffic measured is not of your actual users, but rather synthetically generated traffic collecting data on page performance.
...rum monitors actual use cases, not the synthetic, assumed use cases predefined by an engineer, pm, or marketing team.
How to make PWAs installable - Progressive web apps (PWAs)
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.
... 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.
SVG Core Attributes - SVG: Scalable Vector Graphics
WebSVGAttributeCore
it's almost identical in usage 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.
... note: instead of using the xml:space attribute you should use the white-space css property.
additive - SVG: Scalable Vector Graphics
the additive attribute controls whether or not an animation is additive.
... four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> usage notes value replace | sum default value replace animatable no sum specifies that the animation will add to the underlying value of the attribute and other lower priority animations.
baseProfile - SVG: Scalable Vector Graphics
the attribute does not specify any processing restrictions; it can be considered metadata.
... only one element is using this attribute: <svg> context notes value profile name default value none animatable no example <svg width="120" height="120" version="1.1" xmlns="http://www.w3.org/2000/svg" baseprofile="full"> ...
cap-height - SVG: Scalable Vector Graphics
note: it was specified to share the syntax and semantics of the obsolete cap-height descriptor of the @font-face at-rule defined in an early version of css 2.
... only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'cap-height' in that specification.
color-rendering - SVG: Scalable Vector Graphics
note: as a presentation attribute, color-rendering can be used as a css property.
...x="100" cy="100" r="100" fill="url(#gradient)" color-rendering="optimizequality" /> <text x="45" y="50%" color-rendering="optimizequality">quality-optimized</text> <circle cx="100" cy="100" r="100" color-rendering="optimizespeed" fill="url(#gradient)" style="transform: translatex(240px);" /> <text x="290" y="50%" color-rendering="optimizespeed">speed-optimized</text> </svg> usage notes value auto | optimizespeed | optimizequality default value auto animatable yes auto indicates that the user agent shall make appropriate tradeoffs to balance speed and quality, but quality shall be given more importance than speed.
contentScriptType - SVG: Scalable Vector Graphics
this language must be used for all instances of script that do not specify their own scripting language.
... usage notes value one of the content types specified in the media types default value application/ecmascript animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'contentscripttype' in that specification.
cursor - SVG: Scalable Vector Graphics
WebSVGAttributecursor
this attribute behaves exactly like the css cursor property except that if the browser supports the <cursor> element, you should be able to use it with the <funciri> notation.
... usage context categories presentation attribute value [[<funciri>,]* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize| text | wait | help ]] | inherit animatable yes normative document svg 1.1 (2nd edition) <funciri> functional notation for a reference.
cx - SVG: Scalable Vector Graphics
WebSVGAttributecx
value <length-percentage> default value 0 animatable yes note: starting with svg2 cx, is a geometry property, meaning this attribute can also be used as css property for circles.
... value <length-percentage> default value 0 animatable yes note: starting with svg2 cx, is a geometry property, meaning this attribute can also be used as css property for ellipses.
cy - SVG: Scalable Vector Graphics
WebSVGAttributecy
value <length> | <percentage> default value 0 animatable yes note: starting with svg2, cy is a geometry property meaning this attribute can also be used as a css property for circles.
... value <length> | <percentage> default value 0 animatable yes note: starting with svg2, cy is a geometry property meaning this attribute can also be used as a css property for ellipses.
descent - SVG: Scalable Vector Graphics
WebSVGAttributedescent
note: it was specified to share the syntax and semantics of the obsolete descent descriptor of the @font-face at-rule defined in an early version of css 2.
... only one element is using this attribute: <font-face> usage notes value <number> default value value of vert-origin-y animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'descent' in that specification.
direction - SVG: Scalable Vector Graphics
for other cases, such as when using right-to-left languages, it may be sufficient to add the direction attribute to the outermost <svg> element, and allow that direction to inherit to all text elements: note: as a presentation attribute, direction can be used as a css property.
... html, body, svg { height: 100%; } <svg viewbox="0 0 600 72" xmlns="http://www.w3.org/2000/svg" direction="rtl" lang="fa"> <text x="300" y="50" text-anchor="middle" font-size="36">داستان svg 1.1 se طولا ني است.</text> </svg> usage notes value ltr | rtl default value ltr animatable yes specifications specification status comment css writing modes module level 3the definition of 'direction' in that specification.
dominant-baseline - SVG: Scalable Vector Graphics
note: as a presentation attribute, dominant-baseline can be used as a css property.
...erdana, helvetica, arial, sans-serif; } <svg viewbox="0 0 200 120" xmlns="http://www.w3.org/2000/svg"> <path d="m20,20 l180,20 m20,50 l180,50 m20,80 l180,80" stroke="grey" /> <text dominant-baseline="baseline" x="30" y="20">baseline</text> <text dominant-baseline="middle" x="30" y="50">middle</text> <text dominant-baseline="hanging" x="30" y="80">hanging</text> </svg> usage notes value auto | text-bottom | alphabetic | ideographic | middle | central | mathematical | hanging | text-top default value auto animatable yes auto if this property occurs on a <text> element, then the computed value depends on the value of the writing-mode attribute.
dur - SVG: Scalable Vector Graphics
WebSVGAttributedur
220 150" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="indefinite"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="3s" repeatcount="indefinite"/> </rect> </svg> usage notes value <clock-value> | media | indefinite default value indefinite animatable no <clock-value> this value specifies the length of the simple duration.
... note: the interpolation will not work if the simple duration is indefinite (although this may still be useful for <set> elements).
elevation - SVG: Scalable Vector Graphics
note that the positive z-axis points towards the viewer of the content.
... <fedistantlight elevation="0" /> </fediffuselighting> </filter> <filter id="distantlight2"> <fediffuselighting> <fedistantlight elevation="45" /> </fediffuselighting> </filter> <circle cx="100" cy="100" r="80" style="filter: url(#distantlight1);" /> <circle cx="100" cy="100" r="80" style="filter: url(#distantlight2); transform: translatex(240px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'elevation' in that specification.
fill-opacity - SVG: Scalable Vector Graphics
note: as a presentation attribute fill-opacity can be used as a css property.
...fill opacity: 1 --> <circle cx="50" cy="50" r="40" /> <!-- fill opacity as a number --> <circle cx="150" cy="50" r="40" fill-opacity="0.7" /> <!-- fill opacity as a percentage --> <circle cx="250" cy="50" r="40" fill-opacity="50%" /> <!-- fill opacity as a css property --> <circle cx="350" cy="50" r="40" style="fill-opacity: .25;" /> </svg> usage notes value [0-1] | <percentage> default value 1 animatable yes note: svg2 introduces percentage values for fill-opacity, however, it is not widely supported yet (see browser compatibility below) as a consequence, it is best practices to set opacity with a value in the range [0-1].
filter - SVG: Scalable Vector Graphics
WebSVGAttributefilter
note: as a presentation attribute, filter can be used as a css property.
... html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <filter id="blur"> <fegaussianblur stddeviation="2" /> </filter> <rect x="10" y="10" width="80" height="80" filter="url(#blur)" /> </svg> usage notes value none | <filter-function-list> default value none animatable yes for a description of the values see the css filter property.
filterRes - SVG: Scalable Vector Graphics
note that negative values or zero values disable the rendering of the element which referenced the filter.
... only one element is using this attribute: <filter> usage notes value <number-optional-number> default value none animatable yes <number-optional-number> this value takes one or two values, the first one outlining the resolution in horizontal direction, the second one in vertical direction.
flood-color - SVG: Scalable Vector Graphics
note: as a presentation attribute, flood-color can be used as a css property.
... <feflood flood-color="skyblue" x="0" y="0" width="200" height="200"/> </filter> <filter id="flood2"> <feflood flood-color="seagreen" x="0" y="0" width="200" height="200"/> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood2); transform: translatex(220px);" /> </svg> usage notes value color initial value black animatable yes specifications specification status comment filter effects module level 1the definition of 'flood-color' in that specification.
flood-opacity - SVG: Scalable Vector Graphics
note: as a presentation attribute, flood-opacity can be used as a css property.
...od-opacity="1" x="0" y="0" width="200" height="200"/> </filter> <filter id="flood2"> <feflood flood-color="seagreen" flood-opacity="0.3" x="0" y="0" width="200" height="200"/> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood2); transform: translatex(220px);" /> </svg> usage notes value <alpha-value> initial value 1 animatable yes <alpha-value> a number or percentage indicating the opacity value to use across the current filter primitive subregion.
font-family - SVG: Scalable Vector Graphics
note: as a presentation attribute, font-family can be used as a css property.
...t can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 200 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-family="arial, helvetica, sans-serif">sans serif</text> <text x="100" y="20" font-family="monospace">monospace</text> </svg> usage notes value [ <family-name> | <generic-family> ]#where <family-name> = <string> | <custom-ident>+<generic-family> = serif | sans-serif | cursive | fantasy | monospace default value depends on user agent animatable yes for a description of the values, please refer to the css font-family property.
font-size - SVG: Scalable Vector Graphics
note: as a presentation attribute, font-size can be used as a css property.
... as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 200 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-size="smaller">smaller</text> <text x="100" y="20" font-size="2em">2em</text> </svg> usage notes value <absolute-size> | <relative-size> | <length-percentage> default value medium animatable yes for a description of the values, please refer to the css font-size property.
font-stretch - SVG: Scalable Vector Graphics
note: as a presentation attribute, font-stretch can be used as a css property.
... as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> usage notes value <font-stretch-absolute>where <font-stretch-absolute> = normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage> default value normal animatable yes specifications specification status comment css fonts module level 4the definition of 'font-stretch' in that specification.
font-style - SVG: Scalable Vector Graphics
note: as a presentation attribute, font-style can be used as a css property.
... attribute, it can be applied to any element but only has an effect on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 250 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-style="normal">normal font style</text> <text x="150" y="20" font-style="italic">italic font style</text> </svg> usage notes value normal | italic | oblique default value normal animatable yes for a description of the values, please refer to the css font-style property.
font-variant - SVG: Scalable Vector Graphics
note: as a presentation attribute, font-variant can be used as a css property.
...attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 250 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-variant="normal">normal text</text> <text x="100" y="20" font-variant="small-caps">small-caps text</text> </svg> usage notes value normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || stylistic( <feature-value-name> ) || historical-forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) || ...
font-weight - SVG: Scalable Vector Graphics
note: as a presentation attribute, font-weight can be used as a css property.
... presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 200 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-weight="normal">normal text</text> <text x="100" y="20" font-weight="bold">bold text</text> </svg> usage notes value normal | bold | bolder | lighter | <number> default value normal animatable yes for a description of the values, please refer to the css font-weight property.
glyph-name - SVG: Scalable Vector Graphics
the glyph names can be used in situations where unicode character numbers do not provide sufficient information to access the correct glyph, such as when there are multiple glyphs per unicode character.
... only one element is using this attribute: <glyph> context notes value <name># default value none animatable no <name># this value specifies a comma-separated list of names for the glyph.
gradientUnits - SVG: Scalable Vector Graphics
when the object's bounding box is not square, the gradient normal which is initially perpendicular to the gradient vector within object bounding box space may render non-perpendicular relative to the gradient vector in user space.
...when the object's bounding box is not square, the rings that are conceptually circular within object bounding box space will render as elliptical due to application of the non-uniform scaling transformation from bounding box space to user space.
horiz-origin-x - SVG: Scalable Vector Graphics
note: the origin applies to all glyphs in the font.
... only one element is using this attribute: <font> usage notes value <number> default value 0 animatable no <number> this value indicates the x-coordinate of the origin of a glyph for horizontally oriented text.
horiz-origin-y - SVG: Scalable Vector Graphics
note: the origin applies to all glyphs in the font.
... only one element is using this attribute: <font> usage notes value <number> default value 0 animatable no <number> this value indicates the x-coordinate of the origin of a glyph for horizontally oriented text.
image-rendering - SVG: Scalable Vector Graphics
note: as a presentation attribute, image-rendering can be used as a css property.
... as a presentation attribute, it can be applied to any element but it has effect only on the following element: <image> usage notes value auto | optimizespeed | optimizequality default value auto animatable yes auto indicates that the user agent shall make appropriate tradeoffs to balance speed and quality, but quality shall be given more importance than speed.
kernelMatrix - SVG: Scalable Vector Graphics
kernelmatrix="-1 0 0 0 0 0 0 0 1"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix1);"/> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix2); transform:translatex(220px);"/> </svg> usage notes value <list of numbers> default value none animatable yes <list of numbers> the list of <number>s that make up the kernel matrix for the convolution.
... if the result of orderx * ordery is not equal to the the number of entries in the value list, the filter primitive acts as a pass through filter.
kerning - SVG: Scalable Vector Graphics
WebSVGAttributekerning
note: as a presentation attribute kerning can be used as a css property.
... following four elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> html, body, svg { height: 100%; font: 36px verdana, helvetica, arial, sans-serif; } <svg viewbox="0 0 150 125" xmlns="http://www.w3.org/2000/svg"> <text x="10" y="30" kerning="auto">auto</text> <text x="10" y="70" kerning="0">number</text> <text x="10" y="110" kerning="20px">length</text> </svg> usage notes value auto | <length> default value auto animatable yes auto this value indicates that the spacing between glyphs is adjusted based on kerning tables that are included in the font that will be used.
keySplines - SVG: Scalable Vector Graphics
if there are any errors in the keysplines specification (bad values, too many or too few values), the animation will not occur.
...0 ; 60 ; 10 ; 60" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1" keysplines="0.5 0 0.5 1 ; 0.5 0 0.5 1 ; 0.5 0 0.5 1 ; 0.5 0 0.5 1"/> <animate attributename="cy" dur="4s" calcmode="spline" repeatcount="indefinite" values="10 ; 60 ; 110 ; 60 ; 10" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1" keysplines="0.5 0 0.5 1 ; 0.5 0 0.5 1 ; 0.5 0 0.5 1 ; 0.5 0 0.5 1"/> </circle> </svg> usage notes value <control-point> [ ; <control-point> ]* ;?
letter-spacing - SVG: Scalable Vector Graphics
note: as a presentation attribute, letter-spacing can be used as a css property.
... it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 400 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" letter-spacing="2">bigger letter-spacing</text> <text x="200" y="20" letter-spacing="-0.5">smaller letter-spacing</text> </svg> usage notes value normal | <length> default value normal animatable yes for a description of the values, please refer to the css letter-spacing property.
local - SVG: Scalable Vector Graphics
WebSVGAttributelocal
if both the xlink:href and the local attribute are specified, then the local file system is searched for the color profile first, and, if not available locally, then the resource identified by the xlink:href attribute is used.
... only one element is using this attribute: <color-profile> usage notes value <string> default value none animatable no <string> this value specifies the unique id for a locally stored color profile as specified by international color consortium.
mask - SVG: Scalable Vector Graphics
WebSVGAttributemask
note: as a presentation attribute mask can be used as a css property.
... as a presentation attribute, it can be applied to any element but it has noticeable effects mostly on the following nineteen elements: <a>, <circle>, <clippath>, <ellipse>, <g>, <glyph>, <image>, <line>, <marker>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <svg>, <symbol>, <text>, <use> usage notes value see the css property mask default value none animatable yes specifications specification status ...
media - SVG: Scalable Vector Graphics
WebSVGAttributemedia
one element is using this attribute: <style> html, body, svg { height: 100%; } <svg viewbox="0 0 240 220" xmlns="http://www.w3.org/2000/svg"> <style> rect { fill: black; } </style> <style media="all and (min-width: 600px)"> rect { fill: seagreen; } </style> <text y="15">resize the window to see the effect</text> <rect y="20" width="200" height="200" /> </svg> usage notes value <media-query-list> default value all animatable yes <media-query-list> this value holds a media query that needs to match in order for the style sheet to be applied.
... if not specified, the style sheet is applied unconditionally.
method - SVG: Scalable Vector Graphics
WebSVGAttributemethod
value align | stretch default value align animatable yes align this value indicates that the characters should be rendered so that they are not stretched or warped.
...cursive fonts), the connections may not align properly when text is rendered along the path.
name - SVG: Scalable Vector Graphics
WebSVGAttributename
note: if no name is provided, it will be impossible to reference the given color profile description.
...unlike the syntax allowed between the parentheses of the local(…) clause in an @font-face rule src descriptor, the font name specified in this attribute is not surrounded in single or double quotes.
paint-order - SVG: Scalable Vector Graphics
note: as a presentation attribute, paint-order can be used as a css property.
... as a presentation attribute, it can be applied to any element but it has effect only on the following ten elements: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, and <tspan> usage notes value normal | [ fill || stroke || markers ] default value normal animatable yes normal this value indicates that the fill will be painted first, then the stroke, and finally the markers.
path - SVG: Scalable Vector Graphics
WebSVGAttributepath
this means that the text within the <textpath> element does not render or contribute to the bounding box of the <text> element.
... if the attribute is not specified, the path specified in href is used instead.
pointer-events - SVG: Scalable Vector Graphics
note: as a presentation attribute pointer-events can be used as a css property.
...icked on e.target.style.fill = fill }) as a presentation attribute, it can be applied to any element but it is mostly relevant only on the following twenty-three elements: <a>, <circle>, <clippath>, <defs>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <marker>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <svg>, <switch>, <symbol>, <text>, <textpath>, <tspan>, <use> usage notes value bounding-box | visiblepainted | visiblefill | visiblestroke | visible | painted | fill | stroke | all | none default value visiblepainted animatable yes for a detailed explanation of each possible value, have a look at the css pointer-events documentation.
points - SVG: Scalable Vector Graphics
WebSVGAttributepoints
note: a polyline is an open shape, meaning the last point is not connected to the first point.
... note: a polygon is a closed shape, meaning the last point is connected to the first point.
refX - SVG: Scalable Vector Graphics
WebSVGAttributerefX
if the attribute is not specified, no horizontal adjustment is made, and the left side of the symbol’s rectangular viewport region (regardless of the viewbox coordinate) is positioned at the x coordinate.
... for backwards compatibility, the behavior when refx is not specified on a <symbol> element is different from when it is specified with a value of 0, and therefore different from the behavior when an equivalent attribute is not specified on a <marker> element.
refY - SVG: Scalable Vector Graphics
WebSVGAttributerefY
if the attribute is not specified, no vertical adjustment is made, and the top side of the symbol’s rectangular viewport region (regardless of the viewbox coordinate) is positioned at the y coordinate.
... for backwards compatibility, the behavior when refy is not specified on a <symbol> element is different from when it is specified with a value of 0, and therefore different from the behavior when an equivalent attribute is not specified on a <marker> element.
shape-rendering - SVG: Scalable Vector Graphics
note: as a presentation attribute, shape-rendering can be used as a css property.
...y element but it has effect only on the following seven elements: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <circle cx="100" cy="100" r="100" shape-rendering="geometricprecision"/> <circle cx="320" cy="100" r="100" shape-rendering="crispedges"/> </svg> usage notes value auto | optimizespeed | crispedges | geometricprecision default value auto animatable yes auto this value indicates that the user agent shall make appropriate tradeoffs to balance speed, crisp edges and geometric precision, but with geometric precision given more importance than speed and crisp edges.
spreadMethod - SVG: Scalable Vector Graphics
two elements are using this attribute: <lineargradient> and <radialgradient> context notes value pad | reflect | repeat initial value pad animatable yes pad this value indicates that the final color of the gradient fills the shape beyond the gradient's edges.
...<stop offset="0%" stop-color="fuchsia"/> <stop offset="100%" stop-color="orange"/> </lineargradient> </defs> <rect fill="url(#padgradient)" x="10" y="0" width="200" height="40"/> <rect fill="url(#reflectgradient)" x="10" y="50" width="200" height="40"/> <rect fill="url(#repeatgradient)" x="10" y="100" width="200" height="40"/> </svg> result notice that the middle third of each gradient is the same.
startOffset - SVG: Scalable Vector Graphics
</textpath> </text> </svg> usage notes value <length-percentage> | <number> default value 0 animatable yes <length-percentage> a length represents a distance along the path measured in the current user coordinate system for the <textpath> element.
... note: negative values and values larger than the path length (e.g.
stemv - SVG: Scalable Vector Graphics
WebSVGAttributestemv
this information is often tied to hinting, and may not be directly accessible in some font formats.
... only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the vertical stem width of the font.
stop-opacity - SVG: Scalable Vector Graphics
note: as a presentation attribute, stop-opacity can be used as a css property.
... as a presentation attribute, it can be applied to any element but it has effect only on the following element: <stop> usage notes value <opacity-value> default value 1 animatable yes <opacity-value> this value is either a <number> between 0 and 1 or a <percentage> value specifying the opacity of the color gradient stop.
stroke-dasharray - SVG: Scalable Vector Graphics
the stroke-dasharray attribute is a presentation attribute defining the pattern of dashes and gaps used to paint the outline of the shape; note: as a presentation attribute, stroke-dasharray can be used as a css property.
...e="black" stroke-dasharray="4 1" /> <!-- dashes and gaps of various sizes with an odd number of values --> <line x1="0" y1="7" x2="30" y2="7" stroke="black" stroke-dasharray="4 1 2" /> <!-- dashes and gaps of various sizes with an even number of values --> <line x1="0" y1="9" x2="30" y2="9" stroke="black" stroke-dasharray="4 1 2 3" /> </svg> usage notes value none | <dasharray> default value none animatable yes <dasharray> a list of comma and/or white space separated <length>s and <percentage>s that specify the lengths of alternating dashes and gaps.
stroke-dashoffset - SVG: Scalable Vector Graphics
note: as a presentation attribute stroke-dashoffset can be used as a css property.
...tation is pulled by 1 user units which ends up in the same rendering as the previous example --> <line x1="0" y1="9" x2="30" y2="9" stroke="black" stroke-dasharray="3 1" stroke-dashoffset="1" /> <!-- the following red lines highlight the offset of the dash array for each line --> <path d="m0,5 h-3 m0,7 h3 m0,9 h-1" stroke="rgba(255,0,0,.5)" /> </svg> usage notes value <percentage> | <length> default value 0 animatable yes the offset is usually expressed in user units resolved against the pathlength but if a <percentage> is used, the value is resolved as a percentage of the current viewport.
stroke-opacity - SVG: Scalable Vector Graphics
note: as a presentation attribute stroke-opacity can be used as a css property.
...reen" /> <!-- stroke opacity as a number --> <circle cx="15" cy="5" r="4" stroke="green" stroke-opacity="0.7" /> <!-- stroke opacity as a percentage --> <circle cx="25" cy="5" r="4" stroke="green" stroke-opacity="50%" /> <!-- stroke opacity as a css property --> <circle cx="35" cy="5" r="4" stroke="green" style="stroke-opacity: .3;" /> </svg> usage notes value [0-1] | <percentage> default value 1 animatable yes note: svg2 introduces percentage values for stroke-opacity, however, it is not widely supported yet (see browser compatibility below) as a consequence, it is best practices to set opacity with a value in the range [0-1].
text-decoration - SVG: Scalable Vector Graphics
note: as a presentation attribute, text-decoration can be used as a css property.
...n be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 250 50" xmlns="http://www.w3.org/2000/svg"> <text y="20" text-decoration="underline">underlined text</text> <text x="0" y="40" text-decoration="line-through">struck-through text</text> </svg> usage notes value <'text-decoration-line'> || <'text-decoration-style'> || <'text-decoration-color'> default value see individual properties animatable yes for a description of the values, please refer to the css text-decoration property.
text-rendering - SVG: Scalable Vector Graphics
note: as a presentation attribute, text-rendering can be used as a css property.
... as a presentation attribute, it can be applied to any element but it has effect only on the following element: <text> html, body, svg { height: 100%; } <svg viewbox="0 0 140 40" xmlns="http://www.w3.org/2000/svg"> <text y="15" text-rendering="geometricprecision">geometric precision</text> <text y="35" text-rendering="optimizelegibility">optimized legibility</text> </svg> usage notes value auto | optimizespeed | optimizelegibility | geometricprecision default value auto animatable yes auto this value indicates that the user agent shall make appropriate tradeoffs to balance speed, legibility and geometric precision, but with legibility given more importance than speed and geometric precision.
unicode-bidi - SVG: Scalable Vector Graphics
note: as a presentation attribute, unicode-bidi can be used as a css property.
... as a presentation attribute, it can be applied to any element but it has effect only on the following eleven elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> context notes value normal | embed | isolate | bidi-override | isolate-override | plaintext default value normal animatable no for a description of the values, please refer to the css unicode-bidi property.
units-per-em - SVG: Scalable Vector Graphics
note: this value is almost always necessary as nearly every other attribute requires the definition of a design grid.
... only one element is using this attribute: <font-face> usage notes value <number> default value 1000 animatable no <number> this value indicates the the number of coordinate units on the em square.
widths - SVG: Scalable Vector Graphics
WebSVGAttributewidths
only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value is a comma-separated list of ucs range values as defined in iso 10646, each followed by one or more glyph widths.
...if not enough glyph widths are given, the last in the list is replicated to cover that range.
word-spacing - SVG: Scalable Vector Graphics
note: as a presentation attribute, word-spacing can be used as a css property.
... be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 250 50" xmlns="http://www.w3.org/2000/svg"> <text y="20" word-spacing="2">bigger spacing between words</text> <text x="0" y="40" word-spacing="-0.5">smaller spacing between words</text> </svg> usage notes value normal | <length> animatable yes default values normal for a description of the values, please refer to the css letter-spacing property.
writing-mode - SVG: Scalable Vector Graphics
(note that the inline-progression-direction can change within a <text> element due to the unicode bidirectional algorithm and properties direction and unicode-bidi.) note: as a presentation attribute, writing-mode can be used as a css property.
... as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> usage notes default value horizontal-tb value horizontal-tb | vertical-rl | vertical-lr animatable yes horizontal-tb this value defines a top-to-bottom block flow direction.
xlink:arcrole - SVG: Scalable Vector Graphics
the xlink:arcrole attribute specifies a contextual role for the element and corresponds to the rdf primer notion of a property.
...her" and in the context of a different arc it might have the role of "daughter." twentytwo elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, <use> usage notes value <iri> default value none animatable no <iri> this value specifies an iri reference that identifies some resource that describes the intended property.
xml:space - SVG: Scalable Vector Graphics
note: instead of using the xml:space attribute, use the white-space css property.
... html, body, svg { height: 100%; } <svg viewbox="0 0 140 50" xmlns="http://www.w3.org/2000/svg"> <text y="20" xml:space="default">default spacing</text> <text y="40" xml:space="preserve">preserved spacing</text> </svg> usage notes value default | preserve default value default animatable no default with this value set, whitespace characters will be processed in this order: all newline characters are removed.
<desc> - SVG: Scalable Vector Graphics
WebSVGElementdesc
text in a <desc> element is not rendered as part of the graphic.
... </desc> </circle> </svg> attributes this element only includes global attributes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesdescriptive elementpermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<desc>' in that specification.
<feComposite> - SVG: Scalable Vector Graphics
the second set does not wipe out the background, with the result that the background sometimes shines through and is other cases is blended into itself (i.e., "double-counting").</desc> <filter id="overflood" filterunits="objectboundingbox" x="-5%" y="-5%" width="110%" height="110%"> <feflood flood-color="#ffffff" flood-opacity="1" result="flood"/> <fecomposite in="sourcegraphic" in2=...
...xt x="15" y="275">xor</text> </g> <g transform="translate(900,25)"> <use xlink:href="#red100" filter="url(#arithmeticflood)" /> <use xlink:href="#red50" filter="url(#arithmeticflood)" /> <text x="-25" y="275">arithmetic</text> </g> </g> <g transform="translate(0,325)" enable-background="new"> <desc>render the examples using the filters that do not obliterate the background, thus sometimes causing the background to continue to appear in some cases, and in other cases the background image blends into itself ("double-counting").</desc> <text x="15" y="75">opacity 1.0</text> <text x="15" y="115" font-size="27">(without feflood)</text> <text x="15" y="200">opacity 0.5</text> <text x="15" y="...
<g> - SVG: Scalable Vector Graphics
WebSVGElementg
html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- using g to inherit presentation attributes --> <g fill="white" stroke="green" stroke-width="5"> <circle cx="40" cy="40" r="25" /> <circle cx="60" cy="60" r="25" /> </g> </svg> attributes this element only includes global attributes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-event...
...a-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> spe...
<image> - SVG: Scalable Vector Graphics
WebSVGElementimage
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.
... note: the html spec defines <image> as a synonym for <img> while parsing html.
<marker> - SVG: Scalable Vector Graphics
WebSVGElementmarker
value type: <list-of-numbers> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke...
...a-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications ...
<mask> - SVG: Scalable Vector Graphics
WebSVGElementmask
value type: <length> ; default value: 120%; animatable: yes global attributes core attributes most notably: id styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage presentation attributes most notably: clip-path, clip-rule, color, display, fill, fill-opacity, fill-rule, filter, mask, opacity, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-wid...
...th, transform, vector-effect, visibility usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment css masking module level 1the definition of '<mask>' in that specification.
<path> - SVG: Scalable Vector Graphics
WebSVGElementpath
value type: <number> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-event...
...a-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesgraphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment svg pathsthe definition of '<path>' in that specification.
<polygon> - SVG: Scalable Vector Graphics
WebSVGElementpolygon
value type: <number> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-event...
...a-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<polygon>' in that specification.
<polyline> - SVG: Scalable Vector Graphics
WebSVGElementpolyline
value type: <number> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-event...
...a-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<polyline>' in that specification.
<solidcolor> - SVG: Scalable Vector Graphics
note: this is an experimental technology, and not yet implemented in browsers.
...this is less elegant, and unlike <solidcolor>, cannot itself be used in the definition of gradients.
<switch> - SVG: Scalable Vector Graphics
WebSVGElementswitch
other direct children will be bypassed and therefore not rendered.
... if a child element is a container element, like <g>, then its subtree is also processed/rendered or bypassed/not rendered.
<textPath> - SVG: Scalable Vector Graphics
WebSVGElementtextPath
value type: <length>|<percentage>|<number> ; default value: auto; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-event...
...level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role xlink attributes xlink:title usage notes categoriestext content element, text content child elementpermitted contentcharacter data and any number of the following elements, in any order:descriptive elements<a>, <altglyph>, <animate>, <animatecolor>, <set>, <tref>, <tspan> specifications specification status comment scalable vector graphics (svg) 2the definition of '<textpath>' in that specification.
SVG as an Image - SVG: Scalable Vector Graphics
images, stylesheets) cannot be loaded, though they can be used if inlined through data: uris.
... note that the above restrictions are specific to image contexts; they don't apply when svg content is viewed directly, or when it's embedded as a document via the <iframe>, <object>, or <embed> elements.
Basic Transformations - SVG: Scalable Vector Graphics
if the second value is not given, it is assumed to be 0.
...that means, the units you specify for the element and its children might not follow the 1:1 pixel mapping, but are also distorted, skewed, translated and scaled according to the transformation.
Other content in SVG - SVG: Scalable Vector Graphics
another often cited use case is the embedding of formulas with mathml.
... note: please keep in mind, that the content of the foreignobject must be processable by the viewer.
Positions - SVG: Scalable Vector Graphics
note that this is slightly different than the way you're taught to graph as a kid (y axis is flipped).
... however, this is the same way elements in html are positioned (by default, ltr documents are considered not the rtl documents which position x from right-to-left).
SVG image element - SVG: Scalable Vector Graphics
an svg object: <?xml version="1.0" standalone="no"?> <!doctype svg public "-//w3c//dtd svg 1.1//en" "http://www.w3.org/graphics/svg/1.1/dtd/svg11.dtd"> <svg width="5cm" height="4cm" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image href="firefox.jpg" x="0" y="0" height="50px" width="50px"/> </svg> there are some important things to take note of (referenced from the w3 specs): if you do not set the x or y attributes, they will be set to 0.
... if you do not set the height or width attributes, they will be set to 0.
SVG In HTML Introduction - SVG: Scalable Vector Graphics
(another style rule makes an error message appear.) this approach has the following points in its favor: we have taken a regular html form that could have been part of an existing web site, and added an attractive, interactive background the approach is backwards compatible to browsers that do not support svg; simply, no background appears in them it's very simple and performs very well the pict...
... related links another svg in html example: a swarm of motes working example that works in both mozilla and in internet explorer with adobe's svg viewer installed.
SVG and CSS - SVG: Scalable Vector Graphics
note: elements referenced by <use> elements inherit the styles from that element.
... result notes about this demonstration: the svg document links the stylesheet in the usual way.
Tools for SVG - SVG: Scalable Vector Graphics
notably older versions of internet explorer are supported by generating vml, a vector markup language, that is one of two ancestors of svg and exists since ie 5.5.
...it does not support the older browsers that raphael does.
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
note: the "additional plugins are required" bar can appear for legitimate reasons when the svg or its embedding html is broken or served incorrectly over the network (see the svg faq).
... if the blue square with the white cross displays when you load this scripting across embed demo, then you are not experiencing this problem.
Insecure passwords - Web security
note on password reuse sometimes websites require username and passwords but don't actually store data that is very sensitive.
... for example, a news site may save which news articles a user wants to go back to and read, but not save any other data about a user.
Subdomain takeovers - Web security
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.
... create an inventory of all of your organization’s domains and their hosting providers, and update it as things change, to ensure that nothing is left dangling.
XML introduction - XML: Extensible Markup Language
xml declaration xml - declaration is not a tag.
... <?xml-stylesheet type="text/css" href="stylesheet.css"?> there is also another more powerful way to display xml: the extensible stylesheet language transformations (xslt) which can be used to transform xml into other languages such as html.
child - XPath
WebXPathAxeschild
if an xpath expression does not specify an axis, the child axis is understood by default.
... since only the root node or element nodes have children, any other use will select nothing.
choose - XPath
note: this method should be used instead of if(), which has been deprecated.
... note: all parameters are evaluated, even the one that's not returned.
document - XPath
notes if the uri contains a fragment identifier and that fragment can be identified in the external document, that fragment will be treated as the root in the node-set argument's expression.
...it is not a part of the core xpath function library.
key - XPath
WebXPathFunctionskey
notes the xsl:key element defines what attribute on what given elements will be used to match the key.
...it is not a part of the core xpath function library.
number - XPath
notes strings are converted to a number by stripping the leading whitespace in the string before the number and ignoring whitespace after the number.
... if the string does not match this pattern, then the string is converted to nan.
substring - XPath
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.
translate - XPath
notes xpath notes that the translate function is not a sufficient solution for case conversion in all languages.
... 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.
unparsed-entity-url - XPath
if the argument is not a string, it is converted using the rules of the string() function.
... defined xslt 1.0 12.4 gecko support not supported.
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.
... boolean() ceiling() choose() concat() contains() count() current() xslt-specific document() xslt-specific element-available() false() floor() format-number() xslt-specific function-available() generate-id() xslt-specific id() (partially supported) key() xslt-specific lang() last() local-name() name() namespace-uri() normalize-space() not() number() position() round() starts-with() string() string-length() substring() substring-after() substring-before() sum() system-property() xslt-specific translate() true() unparsed-entity-url() xslt-specific (not supported) ...
<xsl:fallback> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementfallback
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.
... defined xslt, section 15 gecko support not supported at this time.
<xsl:namespace-alias> - XSLT: Extensible Stylesheet Language Transformations
the most common use for this element is in generating a stylesheet from another stylesheet.
... defined xslt, section 7.1.1 gecko support not supported at this time.
<xsl:value-of> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementvalue-of
optional attributes disable-output-escaping (netscape does not serialize the result of transformation - the "output" below - so this attribute is essentially irrelevant in context.
...if "yes" is set, for example, the character > is output as >, not as "&gt".
XSLT: Extensible Stylesheet Language Transformations
WebXSLT
although the process is referred to as "transformation," the original document is not changed; rather, a new xml document is created based on the content of an existing document.
... then, the new document may be serialized (output) by the processor in standard xml syntax or in another format, such as html or plain text.
Converting WebAssembly text format to wasm - WebAssembly
note: text format files are usually saved with a .wat extension.
... note: you can also convert the assembly back into the text representation using the wasm2wat tool; for example wasm2wat simple.wasm -o text.wat.
Window: deviceproximity event - Archive of obsolete content
note: this event has been disabled by default in firefox 62, behind the device.sensors.proximity.enabled preference (bug 1462308).
Loading Content Scripts - Archive of obsolete content
at this point, content scripts are able to interact with the dom content, but externally-referenced stylesheets and images may not have finished loading.
port - Archive of obsolete content
due to bug 816272 the page-mod's removelistener() function does not prevent the listener from receiving messages that are already queued.
self - Archive of obsolete content
note that the self object in content scripts is completely different from the self module, which provides an api for an add-on to access its data files and id.
Communicating using "postMessage" - Archive of obsolete content
however, the context-menu module does not support port, so to send messages from a content script to the add-on via a context menu object, you must use message events.
Module structure of the SDK - Archive of obsolete content
commonjs defines: an object called exports which contains all the objects which a commonjs module wants to make available to other modules a function called require which a module can use to import the exports object of another module.
passwords - Archive of obsolete content
.cgi"> <div>please log in.</div> <label>username:</label> <input type="text" name="uname"> <label>password:</label> <input type="password" name="pword"> </form> the corresponding values for the credential (excluding username and password) should be: url: "http://www.example.com" formsubmiturl: "http://login.example.com" usernamefield: "uname" passwordfield: "pword" note that for both url and formsubmiturl, the portion of the url after the hostname is omitted.
chrome - Archive of obsolete content
this module should not be confused with the "chrome" global variable that webextensions can use to access apis.
console/traceback - Archive of obsolete content
returns traceback : json representation of the traceback or null if not found.
event/core - Archive of obsolete content
if type is not passed removes all the listeners of the given event target.
io/byte-streams - Archive of obsolete content
if not given, the remainder of the entire stream is read.
loader/sandbox - Archive of obsolete content
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.
remote/child - Archive of obsolete content
isremote a boolean property indicating whether this process is remote from the main process or not.
stylesheet/style - Archive of obsolete content
if not provided, the default value is "author".
system/xul-app - Archive of obsolete content
the range does not include this bound.
tabs/utils - Archive of obsolete content
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.
test/utils - Archive of obsolete content
the promise cannot be rejected.
jpm-mobile - Archive of obsolete content
note that unlike cfx, jpm-mobile is available in every command prompt you start, as long as you installed it with the -g flag.
jpmignore - Archive of obsolete content
for example: .* * !/data/** !/lib/** !/locale/** !/node_modules/** !/package.json !/icon.png !/icon64.png !/copying !/bootstrap.js !/install.rdf this would include all editor backup files and similar in the whitelisted subdirectories, to avoid that you can append another blacklist after the whitelist.
Tools - Archive of obsolete content
package.json the package.json file contains manifest data for your add-on, providing not only descriptive information about the add-on for presentation in the add-ons manager, but other metadata required of add-ons.
Creating Event Targets - Archive of obsolete content
however: we're now importing from four modules: event/core gives us emit(): note that we don't need on, once, or off, since we will use eventtarget for adding and removing listeners event/target gives us eventtarget, 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 cl...
List Open Tabs - Archive of obsolete content
the following add-on adds an action button that logs the urls of open tabs when the user clicks it: require("sdk/ui/button/action").actionbutton({ id: "list-tabs", label: "list tabs", icon: "./icon-16.png", onclick: listtabs }); function listtabs() { var tabs = require("sdk/tabs"); for (let tab of tabs) console.log(tab.url); } note: to get this working, you will need to save an icon for the button to your add-on's "data" directory as "icon-16.png".
Logging - Archive of obsolete content
but note that by default, calls to console.log() will not result in any output in the error console for any installed add-ons: this includes add-ons installed using the add-on builder or using tools like the extension auto-installer.
Modifying the Page Hosted by a Tab - Archive of obsolete content
to do this, provide option contentscriptfile not contentscript, whose value is a url pointing to one or more content script files.
Troubleshooting - Archive of obsolete content
jpm may not have found an installation, or if you have multiple installations, jpm may have found the wrong one.
Using XPCOM without chrome - Archive of obsolete content
notice the small l var bmlistener = bmlistener(); placesutils.bookmarks.addobserver(bmlistener, false); ...
Add-on SDK - Archive of obsolete content
putting it together walkthrough of the annotator example add-on.
Autocomplete - Archive of obsolete content
turning autocomplete on for a xul widget this article is about xul widgets and not about html form inputs.
Boxes - Archive of obsolete content
this does not happen with xul box (or hbox and vbox) by default.
Customizing the download progress bar - Archive of obsolete content
background-image: url(chrome://myextension/skin/progress_bg_osx.png) !important; %endif %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.
Drag & Drop - Archive of obsolete content
= true; } function _dragdrop(aevent) { var dragservice = components.classes["@mozilla.org/widget/dragservice;1"].getservice(components.interfaces.nsidragservice); var dragsession = dragservice.getcurrentsession(); var _ios = components.classes['@mozilla.org/network/io-service;1'].getservice(components.interfaces.nsiioservice); var uris = new array(); // if sourcenode is not null, then the drop was from inside the application if (dragsession.sourcenode) return; // setup a transfer item to retrieve the file data var trans = components.classes["@mozilla.org/widget/transferable;1"].createinstance(components.interfaces.nsitransferable); trans.adddataflavor("text/x-moz-url"); trans.adddataflavor("application/x-moz-file"); for (var i=0; i<dr...
Embedding SVG - Archive of obsolete content
notice the template and example use xhtml to handle the namespacing.
Modules - Archive of obsolete content
the use of eval() will probably not be of concern because it is only being used on the exported_symbols array which should not depend on user input.
Page Loading - Archive of obsolete content
page loading on page load how to execute code each time a new page is loaded in browser/mail progress listeners progress listeners allow extensions to be notified of events associated with documents loading in the browser and with tab switching events.
Running applications - Archive of obsolete content
using nsilocalfile.launch() this method is not implemented on all platforms, especially not on unix/linux!
SVG General - Archive of obsolete content
svg template here is a basic markup template to start building an svg document: <svg xmlns="http://www.w3.org/2000/svg"> <!-- svg elements go here --> </svg> note: it is recommended that you do not use dtd's with svg documents.
JavaScript timers - Archive of obsolete content
timer.jsm the timer.jsm javascript code module contains pure-javascript implementations of settimeout and cleartimeout that are compatible with the dom window functions, but that can be used by code that does not have access to a dom window (for example, javascript code modules or content frame scripts).
View Source for XUL Applications - Archive of obsolete content
this is optional if outerwindowid is not passed.
XML-related code snippets - Archive of obsolete content
how to create a dom tree using xmlhttprequest parsing and serializing xml using xpath jxon (lossless javascript xml object notation) xsl transforms xlink xinclude xml:id xml:base support in old browsers xpointer svg namespaces, or why http://www.mozilla.org/keymaster/gat...re.is.only.xul is at the top of every xul document.
XPath - Archive of obsolete content
notes and sample code for xpath and ajax (the following was moved from document.evaluate) obj.evaluate(xpathexpression,contextnode,namespaceresolver,resulttype,result); //obj and contextnode should be the same object, if context is a ajax xml object (example: returnedxml) this should be used as : returnedxml.evaluate(xpathexpression,returnedxml,namespaceresolver,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...
Communication between HTML and your extension - Archive of obsolete content
the onreadystatechange was set to another little javascript function that would update a specific element on the html page with the result.
Custom about: URLs - Archive of obsolete content
it is imported to queryinterface the components.manager otherwise this will not work.
Hiding browser chrome - Archive of obsolete content
note: don't simply replace the hidechromeforlocation() method; this will likely hurt the functionality of firefox itself as well as other extensions.
Offering a context menu for form controls - Archive of obsolete content
as a result, all controls in the window will support a context menu when right-clicked, since we've changed the core behavior of context menus to override their default behavior of doing nothing on form controls.
XUL School Tutorial - Archive of obsolete content
introduction introduction getting started with firefox extensions the essentials of an extension setting up a development environment javascript object management basic functionality adding menus and submenus adding toolbars and toolbar buttons adding events and commands adding windows and dialogs adding sidebars user notifications and alerts intermediate functionality intercepting page loads connecting to remote content handling preferences local storage advanced topics the box model xpcom objects observer notifications custom xul elements with xbl mozilla documentation roadmap useful mozilla community sites appendices appendix a: add-on performance appendix b: i...
XML data - Archive of obsolete content
notes about this demonstration: the superscript 2 (in "million km²") a unicode character, coded as \b2 in the css file.
Beginner tutorials - Archive of obsolete content
this technical note examines the use of underscores in css, and why they should be generally avoided in most circumstances.xml datathis page contains an example of how you can use css with xml data.xul user interfacesthis page illustrates mozilla's specialized language for creating user interfaces.
chargingchange - Archive of obsolete content
returns true if the battery is charging, if the state of the system's battery is not determinable, or if no battery is attached to the system.
progress - Archive of obsolete content
lengthcomputable boolean specifies whether or not the total size of the transfer is known.
Install.js - Archive of obsolete content
nction() { // can't use string handling in install, so use if statement instead var args = install.arguments; if (args == 'p=0') { this.profileinstall = false; this.silentinstall = true; } else if (args == 'p=1') { this.profileinstall = true; this.silentinstall = true; } }, handleerror: function(err) { if (!this.silentinstall) { install.alert('error: could not install ' + this.extfullname + ' ' + this.extversion + ' (error code: ' + err + ')'); } install.cancelinstall(err); } }; xpiinstaller.install(); ...
Bypassing Security Restrictions and Signing Code - Archive of obsolete content
these privilege manager feature was not used much (aside from abuse), and its complexity made performance improvements difficult.
Environment variables affecting crash reporting - Archive of obsolete content
run this on the command line: defaults write org.mozilla.firefox oscrashreporter 1 note that you will get two crash dialogs with this setting, one from the os and one from mozilla.
Monitoring WiFi access points - Archive of obsolete content
tener = 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="d"><p></p></div> <div id="c"><p></p></div> </body> </html> the nsiwifilistener object the first thing the code above does is to prototype the listener object that will be receiving notifications of changes to the access point list.
Automated testing tips and tricks - Archive of obsolete content
todo: check example code in to the tree somewhere how to quit the browser on all platforms window.close() of the last open window does not quit the application on mac http://people.mozilla.com/~davel/scripts/ - look at quit.js and quit.xul install manifest file in appdir/chrome to map chrome://tests/content to directory containing quit.js and quit.xul example: content tests file:///users/davel/work/tests/ start app with command line flag -chrome chrome://tests/content/quit.xul how to create a new profile from the command line first, use the -createprofile command line flag to add a profile entry to profiles.ini and populate the new profile directory with a prefs.js file firefox-bin -createprofile "testprofile ${prof...
How Mozilla finds its configuration files - Archive of obsolete content
mozilla includes a profile manager, but unfortunately this always include a random part (salt) into the profile's filename, and thus cannot be used to point mozilla to a profile of the our chosing.
How Thunderbird and Firefox find their configuration files - Archive of obsolete content
note: for absolute paths thunderbird uses dos'ish backslashes (\) rather than unixish slashes (/).
Introduction - Archive of obsolete content
moreover, we want to lock certain settings, so that users cannot change them.
Kill the XUL.mfl file for good - Archive of obsolete content
but creating a subdirectory named xul.mfl in mozilla's profile directory seems to help (mozilla is not smart enough to remove the directory before creating the file, thus the presence of the directory effectively disables this (mis)feature).
Other Mozilla customization pages - Archive of obsolete content
other mozilla customization pages mcd, mission control desktop aka autoconfig pre-configuring mozilla mozexec, a mozilla launcher that writes a registry.bat before launching mozilla (contributed by petr kristan) mozptch: the main difference of the mozptch approach is, not to patch the registry.dat, but to create a new one with mozillas comandline option -createprofile.
Building TransforMiiX standalone - Archive of obsolete content
building from a full mozilla tree is not supported.
Creating a Mozilla Extension - Archive of obsolete content
whether or not the latest version of the code is compiling successfully and passing tests).
Creating a hybrid CD - Archive of obsolete content
it is used as the creator type for readme and other text files because it can handle unix and windows linebreaks, but teachtext cannot.
Drag and Drop Example - Archive of obsolete content
note that each button here has an additional elem attribute.
Extension Frequently Asked Questions - Archive of obsolete content
they are currently written with mostly firefox in mind, but most if not all should easily translate to seamonkey, thunderbird or any of the other applications.
Layout FAQ - Archive of obsolete content
block(body)(1)@035ff490 {120,120,8820,600} [state=00000010] sc=035ff264(i=2,b=0)< line 035ffc18: count=1 state=inline,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:linebr[0x5100] {0,0,330,300} < inline(span)(0)@035ffa04 next=035ffc48 next-continuation=035ffc48 {0,7,330,285} [content=0359ed50] [sc=035ff990]< text(0)@035ffa8c[0,4,t] next=035ffb1c {0,0,330,285} [state=41600020] sc=035ffa3c pst=:-moz-non-element< "\nabc" > frame(br)(1)@035ffb1c {330,225,0,0} [state=00000020] [content=035aebf0...
Firefox - Archive of obsolete content
note that this is an attempt at describing the current usage of these terms.
GRE Registration - Archive of obsolete content
xulrunner rpms/post-install scripts should register xulrunner as a gre by running <tt>xulrunner -register-global</tt> and not hand-create a .conf file.
Gecko Coding Help Wanted - Archive of obsolete content
not up for coding yet?
HTTP Class Overview - Archive of obsolete content
nshttphandler implements nsiprotocolhandler manages preferences owns the authentication cache holds references to frequently used services nshttpchannel implements nsihttpchannel talks to the cache initiates http transactions processes http response codes intercepts progress notifications nshttpconnection implements nsistreamlistener & nsistreamprovider talks to the socket transport service feeds data to its transaction object routes progress notifications nshttpconnectioninfo identifies a connection nshttptransaction implements nsirequest encapsulates a http request and response parses incoming data nshttpchunkeddecoder owned by a transaction s...
JavaScript OS.Shared - Archive of obsolete content
global object os.shared.type properties void_t voidptr_t char jschar int unsigned_int int32_t uint32_t int64_t uint64_t long bool off_t size_t ssize_t fd (unix only) negativeone_or_fd (unix only) negativeone_or_nothing (unix only) string (unix only) null_or_string (unix only) handle (windows only) maybe_handle (windows only) dword (windows only) negative_or_dword (windows only) zero_or_dword (windows only) zero_or_nothing (windows only) declareffi() intn_t() uintn_t()instances of os.shared.type convert_from_c() releasewith() attributes global object os.shared.hollowstructure in_ptr out_ptr inout_ptr ...
Page modifications - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Content - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Enabling Experimental Jetpack Features - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
First Run - Archive of obsolete content
first-run page when users install your jetpack, they will be greeted with a new page notifying them that installation was successful.
Settings - Archive of obsolete content
settings are private to each jetpack and are not accessible by other jetpacks.
Meta - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
File access - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Storage - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Clipboard - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Clipboard Test - Archive of obsolete content
<style></style> <style>.description{ display: block; font-size: 13pt; color: #444; font-style: italic; margin-bottom: 7px; } .method>.returns{display: none;} .method>.name>.param:not(:last-child):after{content: ","; padding-right: .5em; } .method>.name>.param:not(:last-child):after{content: ","; padding-right: .5em; } .method>.name>.param>.name:after{content: " as "; font-weight: normal; } .method>.params{display: block; color:#555;} .method>.params>.param{display: block; margin-bottom:5px;} .method>.params>.param>.name{font-weight:bold; margin-right:.5em; min-width:80px; display:inline-block;} .method>.params>.param>.description{display:inline-block; width:300px; vertical-align:top;margin-right:30px} .method>.params>.param>.type{display:inline-block; width:100px; vertical-align:top;font-weig...
System information - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
System - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Panel - Archive of obsolete content
ArchiveMozillaJetpackUIPanel
note: this page documents the jetpack prototype, which is no longer under active development.
Selection - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Tabs - Archive of obsolete content
ArchiveMozillaJetpackUITabs
note: this page documents the jetpack prototype, which is no longer under active development.
slideBar - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
statusBar - Archive of obsolete content
its acutally not implemented in the current version.
Litmus tests - Archive of obsolete content
it may not cover it at much depth, but it does try to cover the major features.
Mac OS X Build Prerequisites/fink - Archive of obsolete content
do not install the autoconf2.5 or autoconf2.54 packages.
Metro browser chrome tests - Archive of obsolete content
setup(), teardown(), and run() each have individual exception handlers to prevent one method from interfering with the execution of another.
Mozilla Application Framework - Archive of obsolete content
editor's note: this article should be rewritten to describe why use xulrunner to create your own application.
Porting NSPR to Unix Platforms - Archive of obsolete content
however, if you are not familiar with the structure of the nspr source tree and its build system, it may take you extra time.
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...
Build - Archive of obsolete content
this variable is called mozconfig export mozconfig=$pwd/.mozconfig #this should point to mozilla/prism/.mozconfig go back to the mozilla/ directory and do another build, this time, prism will get built cd ../ make -f client.mk build congratulations, you have just built prism.
Styling - Archive of obsolete content
note: you can also include a root level webapp.css which will be used if a platform-specific version is not found.
Running Windows Debug Builds Downloaded From Tinderbox - Archive of obsolete content
unfortunately these dlls are not redistributable.
Tamarin Acceptance Testing - Archive of obsolete content
successfully build release and debug versions of the shell with the debugger enabled [info] successfully run the following test suites: acceptance test suite [info] self tests [info] submit a sandbox build request to test against platforms that you may not have locally [info] available tamarin acceptance test suites actionscript acceptance tests: actionscript acceptance tests running tamarin acceptance tests abc assembler tests cmdline tests performance tests actionscript performance tests running tamarin performance tests built-in self tests see instructions in doc/selftest.h...
Using gdb on wimpy computers - Archive of obsolete content
if you don't allow those libraries to be loaded then gdb will not be able to properly debug threads on linux.
Mozilla Web Developer Community - Archive of obsolete content
the list of old devedge feeds is at http://devedge-temp.mozilla.org/comm.../feedlist.html feedback hendrix mdnproduct feedback bugzilla - report a bug in a mozilla product for questions related to this website (but not technical questions), please send your message to the mdc mailing list.
DOM Interfaces - Archive of obsolete content
see "not so anonymous nodes" on mozilla.dev.platform for some discussion about this.
Unix stub installer - Archive of obsolete content
note that there are two macro strings in the .jsts: $version$ which is replaced at packages time with the browser version.
Windows stub installer - Archive of obsolete content
note that there are several macro strings--a macro name wrapped in dollar ($) signs--which may be used in the .jsts, including: $version$ which is replaced at packages time with the browser version.
copy - Archive of obsolete content
if destination does not exist a new file will be created.
dirCreate - Archive of obsolete content
note that the getfolder method does not require that the folder or directory you specify exist in order for the object reference to be a valid one.
dirGetParent - Archive of obsolete content
returns a filespecobject if successful; null if not successful.
dirRemove - Archive of obsolete content
recursive an optional boolean value indicating whether the remove operation is to be performed recursively (1) or not (0).
diskSpaceAvailable - Archive of obsolete content
g, ...); if (err == 0) performinstall(); else cancelinstall(); } else { alert("not enough disk space.
exists - Archive of obsolete content
returns a boolean value specifying whether the file or directory does indeed exist or does not.
isDirectory - Archive of obsolete content
returns a boolean value indicating whether the object is a directory or not.
isFile - Archive of obsolete content
returns a boolean value indicating whether the filespecobject is a file or not.
move - Archive of obsolete content
move moves a file from one location to another.
compareTo - Archive of obsolete content
eturned by compareto: installversion.major_diff installversion.minor_diff installversion.rel_diff installversion.bld_diff installversion.equal installversion.major_diff_minus installversion.minor_diff_minus installversion.rel_diff_minus installversion.bld_diff_minus example this code uses the compareto method to determine whether or not version 3.2.1 of the royal airways software has been previously installed: existingvi = installtrigger.getversion("/royalairways/royalsw"); if ( existingvi.compareto("3.2.1") <= 0 ) { // ...
getComponentFolder - Archive of obsolete content
returns an object representing the directory in which the component is installed, or null if the component could not be found or if subdirectory refers to a file that already exists.
getFolder - Archive of obsolete content
for example, mydir = getfolder("file:///", "c|/mysoftco/somedir"); note that forward slashes are used, regardless of the platform.
getLastError - Archive of obsolete content
the getlasterror method does not return errors from methods that return objects, such as getfolder.
loadResources - Archive of obsolete content
be aware that the parameter specifies the file within the xpi and not on the file system, as the following example demonstrates.
resetError - Archive of obsolete content
returns nothing.
getString - Archive of obsolete content
unlike that function, this method does not support using a null key to return a list of keys in a section.
WinProfile Object - Archive of obsolete content
overview this object does not have a public constructor.
enumKeys - Archive of obsolete content
returns the name if it succeeded; null if the referenced value does not exist.
enumValueNames - Archive of obsolete content
returns the value of the key as a string if it succeeded; null if the referenced subkey does not exist.
getValueNumber - Archive of obsolete content
returns number value of the specified key or null if there's an error, the value is not found, or the value is not a string.
keyExists - Archive of obsolete content
method of winreg object syntax boolean keyexists ( string key); parameters the method has the following parameter: key a string representing the path to the key returns boolean value description if the user does not have read access to the given key, this will also return false.
setValueNumber - Archive of obsolete content
if the value is not a number, use the setvalue or setvaluestring methods instead.
setValueString - Archive of obsolete content
if the value is not a string, use the setvalue method instead.
WinReg Object - Archive of obsolete content
overview this object does not have a public constructor.
XRE - Archive of obsolete content
not all pages have to have categories, please leave this uncategorized for now, thanks.
Mozilla E4X - Archive of obsolete content
another e4x feature: the ability to bind a w3c dom document to a new xml object, reflecting the dom in e4x terms so that updates to either the dom or the e4x object hierarchy show up in the other.
movetoclick - Archive of obsolete content
if not specified, the default value is used, which varies for each platform.
norestorefocus - Archive of obsolete content
if true, the focus will not be reset, although it will be cleared if the focus is within the panel.
progressmeter.max - Archive of obsolete content
the default value if not specified is 100 such that the value may be used as a percentage.
treelines - Archive of obsolete content
« xul reference home treelines type: boolean when set to true, lines are drawn connecting the lines in the tree; when false, the lines are not drawn.
acceltext - Archive of obsolete content
this attribute does not apply to menus directly on the menubar.
accesskey - Archive of obsolete content
however in some languages, for example, in japanese, characters will not always map directly to single keys, and it is quite common to have labels which cannot have a single accesskey.
allownegativeassertions - Archive of obsolete content
when multiple datasources are used, one may override an assertion from another.
alwaysopenpopup - Archive of obsolete content
« xul reference home alwaysopenpopup obsolete since gecko 1.9.1 type: boolean note: applies to: thunderbird and seamonkeyif true, the autocomplete popup will be displayed even when there are no matches.
attribute - Archive of obsolete content
the id, ref, and persist attributes are not observed.
autofill - Archive of obsolete content
if false, the default, the value will not be filled in until the user selects an item.
checked - Archive of obsolete content
« xul reference home checked type: boolean indicates whether the element is checked or not.
closemenu - Archive of obsolete content
auto this, the default value if the closemenu attribute is not specified, closes up the menu and all parent menus.
coalesceduplicatearcs - Archive of obsolete content
when multiple datasources are used, one may override an assertion from another.
collapse - Archive of obsolete content
if this attribute is not specified, the splitter will not cause a collapse.
collapsed - Archive of obsolete content
« xul reference home collapsed type: boolean if true, then the element is collapsed and does not appear.
colorpicker.type - Archive of obsolete content
« xul reference home type type: string if this attribute is not present, the colorpicker is displayed inside the window.
containment - Archive of obsolete content
when generating content from a template this is used to determine which resources from the datasource are containers and thus can have child nodes and which ones are not containers.
crop - Archive of obsolete content
ArchiveMozillaXULAttributecrop
none the text will be not be cropped using an ellipsis.
customindex - Archive of obsolete content
« xul reference home customindex not in seamonkey 1.x type: integer this value is the index of the toolbar in the list of the custom toolbars.
customizable - Archive of obsolete content
« xul reference home customizable not in seamonkey 1.x type: boolean set this attribute to true on toolbars that can be customized.
cycler - Archive of obsolete content
if the cycler attribute is not set, the cell is a regular text cell.
datepicker.type - Archive of obsolete content
this is the default value so do not specify the type attribute if this kind is desired.
decimalplaces - Archive of obsolete content
note that decimal numbers are stored as floats.
defaultButton - Archive of obsolete content
« xul reference home defaultbutton type: string normally this attribute should not be set, but if it is, it specifies the default button in the dialog.
defaultset - Archive of obsolete content
« xul reference home defaultset not in seamonkey 1.x type: comma-separated list of item ids the default set of displayed items on the toolbar.
disableKeyNavigation - Archive of obsolete content
« xul reference home disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label.
disableautoselect - Archive of obsolete content
if the text does not match any of the items in the list, the menu selection is cleared.
disablechrome - Archive of obsolete content
note: this has no effect if the tabs on top preference is turned off.
disablefastfind - Archive of obsolete content
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).
dlgtype - Archive of obsolete content
using this attribute on a button that is not in a dialog box has no effect.
enablehistory - Archive of obsolete content
« xul reference home note: for seamonkey 2.0 and all versions of thunderbird prior to 3.0 you also need to provide the disablehistory attribute.
events - Archive of obsolete content
if this attribute is not specified, or you set it to the value '*', all events are valid.
first-tab - Archive of obsolete content
this attribute should not be set manually, but is useful in a theme if the first tab should be styled differently.
flex - Archive of obsolete content
ArchiveMozillaXULAttributeflex
the actual value is not relevant unless there are other flexible elements within the same container.
handleCtrlTab - Archive of obsolete content
if this attribute is set to false, these keys do not navigate between tabs.
hidden - Archive of obsolete content
« xul reference home hidden type: boolean if set to true, the element is not displayed.
hideheader - Archive of obsolete content
if you don't set a label for that column either, the header is not displayed at all.
hidespinbuttons - Archive of obsolete content
« xul reference home hidespinbuttons type: boolean if true, the number box does not have arrow buttons next to it to allow the user to adjust the value.
homepage - Archive of obsolete content
it does not have any correlation with the user's browser homepage; instead it is a convenient property to hold a home page.
iconsize - Archive of obsolete content
these can vary from one toolbar to another within a given toolbox, whose iconsize attribute defines the default for all toolbars that don't specify an icon size.
id - Archive of obsolete content
ArchiveMozillaXULAttributeid
var mybutton = document.getelementbyid('foo'); mybutton.setattribute('label','the button was pressed'); } </script> a more abstract version of the above would be a <button id="foo" label="click me" oncommand="setwidgetlabel(this, 'i was pressed')"/> <script> function setwidgetlabel(idname, newcaption){ document.getelementbyid( idname.id ).setattribute('label',newcaption) } </script> not specifying the id attribute for a window or a prefwindow fills the console with the following warning message: warning: empty string passed to getelementbyid() see also name ...
ignoreblurwhilesearching - Archive of obsolete content
« xul reference home ignoreblurwhilesearching new in thunderbird 3requires seamonkey 2.0 type: boolean if true, blur events are ignored while searching, which means that the autocomplete popup will not disappear.
ignorecase - Archive of obsolete content
« xul reference home ignorecase type: boolean set to true to indicate that the case does not matter when making comparisons.
ignoreincolumnpicker - Archive of obsolete content
« xul reference home ignoreincolumnpicker type: boolean if true, the column does not appear in the column picker.
image.onload - Archive of obsolete content
this event will not bubble up the element tree.
isempty - Archive of obsolete content
if not specified, the rule may match regardless of whether a node has children or not.
keycode - Archive of obsolete content
« xul reference home keycode type: string key code for keys that do not have displayable characters, such as the enter key or function keys, use this attribute instead of the key attribute.
label - Archive of obsolete content
<label value="whaw" id="the-big-label" command="the-big-button"/> <button id="the-big-button" label="click me" oncommand="alert(document.getelementbyid('the-big-label').value)"/> <label id="mylabel" value="my label"/> <button label="click me" oncommand="document.getelementbyid('mylabel').setattribute('value','value changed');" /> <checkbox label="my checkbox" id="mycheckbox"/> <button label="another click" oncommand="document.getelementbyid('mycheckbox').setattribute('label','still not checked');"/> <button label="show label of checkbox" oncommand="alert( document.getelementbyid('mycheckbox').getattribute('label') )"/> ...
last-tab - Archive of obsolete content
this attribute should not be set manually, but is useful in a theme if the last tab should be styled differently.
linkedpanel - Archive of obsolete content
if this attribute is not used, the tab will be connected to the panel at the corresponding index in the tabpanels element that the tab is in its tabs container.
listcell.type - Archive of obsolete content
« xul reference home type type: string this attribute is reserved for use by anonymous children of listitem; do not use.
member - Archive of obsolete content
if not specified, the variable specified in the uri attribute in the action body of the template's first rule is used.
menuitem.type - Archive of obsolete content
the checked attribute determines whether the menuitem is checked or not.
minresultsforpopup - Archive of obsolete content
this can be used to display additional items that are not autocomplete results.
negate - Archive of obsolete content
the where clause matches if the condition is false, and does not match if the condition is true.
next - Archive of obsolete content
ArchiveMozillaXULAttributenext
this can be used to create wizards that do not have a linear sequence.
noautofocus - Archive of obsolete content
if true, the focus is not adjusted.
noautohide - Archive of obsolete content
if this attribute is set to true, this will not happen and the tooltip will only hide when the user moves the mouse to another element.
noinitialfocus - Archive of obsolete content
if true, the element will not receive initial focus.
onbookmarkgroup - Archive of obsolete content
« xul reference home onbookmarkgroup not in firefox type: script code this code executes when the user chooses the "bookmark this group of tabs" command.
oninput - Archive of obsolete content
this event is only called when the text displayed would change, thus it is not called when the user presses non-displayable keys.
onnewtab - Archive of obsolete content
« xul reference home onnewtab not in firefox type: script code this script will be called when the new tab button is clicked.
ontextcommand - Archive of obsolete content
« xul reference home 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.
ontextrevert - Archive of obsolete content
« xul reference home 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 uncompleted value.
open - Archive of obsolete content
ArchiveMozillaXULAttributeopen
the open attribute is not present if the menu is closed.
ordinal - Archive of obsolete content
note the default ordinal for elements is 1.
panel.ignorekeys - Archive of obsolete content
if true, the escape key cannot be used to close the panel.
panel.noautohide - Archive of obsolete content
« xul reference home noautohide type: boolean if false, the default value, the panel will be hidden when the user clicks outside the panel or switches focus to another application.
persist - Archive of obsolete content
persistence will not remember the absence of an attribute, so for boolean attributes like checked where absence means false, you will need to explicitly set the attribute to false before the window closes (bug 15232).
popup.position - Archive of obsolete content
note that a context menu will never respect this attribute, always appearing relative to the mouse cursor.
popupalign - Archive of obsolete content
noneno aligntopleftalign to the top left cornertoprightalign to the top right cornerbottomleftalign to the bottom left cornerbottomrightalign to the bottom right cornersyntax<element popupalign="none | topleft | topright | bottomleft | bottomright"/> example<element id="edit-context" popup="editor-popup" popupanchor="topleft" popupalign="bottomright"/> notesthe popupalign attribute can be used to specify which corner of the popup content is tied to the originating point.
popupanchor - Archive of obsolete content
uld be anchored on the element.noneno anchortopleftanchor to the top left cornertoprightanchor to the top right cornerbottomleftanchor to the bottom left cornerbottomrightanchor to the bottom right cornersyntax<element popupanchor="none | topleft | topright | bottomleft | bottomright" /> example<element id="edit-context" popup="editor-popup" popupanchor="topleft" popupalign="bottomright" /> notesthe popupanchor attribute can be used to specify that the popup content should come up anchored to one of the four corners of the content object (e.g., the button popping up the content).
prefpane.src - Archive of obsolete content
if this is not specified, the contents of the prefpane element is used.
readonly - Archive of obsolete content
« xul reference home readonly type: boolean if set to true, then the user cannot change the value of the element.
resizeafter - Archive of obsolete content
grow the elements to the right or below the splitter do not change size (unless they are flexible) when the splitter is dragged, but instead the entire container changes size.
resizer.type - Archive of obsolete content
as some platforms provide this resizing grip automatically, this type of resizer element will be hidden and ensure that the window does not get an extra resizer.
script.type - Archive of obsolete content
note: if the javascript file is in chrome://, setting this attribute to application/javascript will always use the latest available javascript version.
searchlabel - Archive of obsolete content
if searchlabel is not present, fayt falls back to use the label property.
selected - Archive of obsolete content
« xul reference home selected type: boolean indicates whether the element is selected or not.
separator.orient - Archive of obsolete content
note that the values are the reverse of what seems more likely.
setfocus - Archive of obsolete content
if this attribute is false, the focus does not change during navigation.
showcommentcolumn - Archive of obsolete content
if this attribute is not specified, the comment column doesn't appear.
showcaret - Archive of obsolete content
« xul reference home showcaret type: boolean whether or not to cause a typing caret to be visible in the content area.
showimagecolumn - Archive of obsolete content
if this attribute is not specified, the image column doesn't appear.
sizetopopup - Archive of obsolete content
none the width of the popup will not be constrained to the size of the menu.
statedatasource - Archive of obsolete content
if you do not specify this attribute, state information will be stored in the local store (rdf:local-store).
suppressonselect - Archive of obsolete content
« xul reference home suppressonselect type: boolean if this attribute is not specified, a select event is fired whenever an item is selected, either by the user or by calling one of the select methods.
targets - Archive of obsolete content
if this attribute is not specified, or you set it to the value '*', all elements are valid.
template.container - Archive of obsolete content
if not specified, the variable specified in the uri attribute of the content tag in the template's first rule is used.
template - Archive of obsolete content
if this attribute is not specified, there should be a template element directly inside the node.
textbox.crop - Archive of obsolete content
« xul reference home crop type: boolean this attribute is not used and is only provided for compatibility with the menulist element.
textbox.disablehistory - Archive of obsolete content
« xul reference home disablehistory obsolete since gecko 2.0 type: boolean note: 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.
textbox.ignoreBlurWhileSearching - Archive of obsolete content
« xul reference home ignoreblurwhilesearching obsolete since gecko 1.9.1 type: boolean if true, blur events are ignored while searching, which means that the autocomplete popup will not disappear.
textbox.label - Archive of obsolete content
« xul reference home label type: string if present and not empty, this will be exposed to screen readers through the label property.
textbox.minResultsForPopup - Archive of obsolete content
this can be used to display additional items that are not autocomplete results.
textbox.onblur - Archive of obsolete content
note: the behavior of this event has evolved over time.
textbox.onchange - Archive of obsolete content
the event is not sent until the focus is moved to another element.
textbox.onfocus - Archive of obsolete content
note: the behavior of this event has evolved over time.
textbox.showCommentColumn - Archive of obsolete content
if this attribute is not specified, the comment column doesn't appear.
textbox.type - Archive of obsolete content
xbl-specific note beware that if you create an xbl binding for a textbox, you need to use the appropriate extends attribute and changing type attribute on the tree won't have effect.
timeout - Archive of obsolete content
if the user types another character, the timer resets.
toolbar.mode - Archive of obsolete content
« xul reference home mode not in seamonkey 1.x type: one of the values below how the toolbarbuttons on the toolbar are displayed.
toolbarbutton.type - Archive of obsolete content
if this attribute is not present, a normal button is created.
toolbarname - Archive of obsolete content
« xul reference home toolbarname not in seamonkey 1.x type: string the name of the toolbar, which is listed on the show/hide toolbars menu.
tooltiptextnew - Archive of obsolete content
« xul reference home tooltiptextnew not in firefox type: string used to set the text which appears in the tooltip when the user moves the mouse over the new button in the tab row.
treecol.width - Archive of obsolete content
the value should not include a unit as all values are in pixels.
type - Archive of obsolete content
ArchiveMozillaXULAttributetype
see button.type browser.type colorpicker.type datepicker.type editor.type listcell.type listitem.type menuitem.type notification.type prefwindow.type query.type script.type textbox.type toolbarbutton.type treecol.type ...
userAction - Archive of obsolete content
possible values: none the user is not interacting with the textbox.
validate - Archive of obsolete content
« xul reference home validate type: one of the values below this attribute indicates whether to load the image from the cache or not.
wrap - Archive of obsolete content
ArchiveMozillaXULAttributewrap
if this attribute is not specified, word wrapping is enabled.
wraparound - Archive of obsolete content
the minimum and maximum values must both not be infinity.
command - Archive of obsolete content
ArchiveMozillaXULEventscommand
bubbles read only boolean whether the event normally bubbles or not cancelable read only boolean whether the event is cancellable or not?
findbar - Archive of obsolete content
ltnamespace(), 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 its enclosing notificationbox or findbar.
Menus - Archive of obsolete content
spell-no-suggestions the no spelling suggestions item - notable as it is the first item on the context menu.
International characters in XUL JavaScript - Archive of obsolete content
this can not be done in xul files loaded from the web, only in privileged code, e.g.
List of commands - Archive of obsolete content
electcharnext cmd_beginline cmd_endline cmd_selectbeginline cmd_selectendline cmd_wordprevious cmd_wordnext cmd_selectwordprevious cmd_selectwordnext cmd_scrollpageup cmd_scrollpagedown cmd_scrolllineup cmd_scrolllinedown cmd_movepageup cmd_movepagedown cmd_selectpageup cmd_selectpagedown other commands the following list other commands (prefixed by cmd_ or browser:) which have not been categorized here yet (though they are in the alphabetical list below): http://lxr.mozilla.org/seamonkey/sou...baroverlay.xul http://lxr.mozilla.org/seamonkey/sou...t/navigator.js http://lxr.mozilla.org/seamonkey/sou...toroverlay.xul http://lxr.mozilla.org/seamonkey/sou...onaltoolbar.js http://lxr.mozilla.org/seamonkey/sou...rceoverlay.xul http://lxr.mozilla.org/seamonkey/sou...extove...
addTabsProgressListener - Archive of obsolete content
the progress listener should be based on the nsiwebprogresslistener interface with an additional "browser" argument as the first argument of every method, which is the browser (not <tabbrowser> = gbrowser) where the event occurred.
addTab - Archive of obsolete content
ArchiveMozillaXULMethodaddTab
firefox 3.6 note the second form of this method was added in firefox 3.6; it allows you to specify the parameters by name, in any order.
appendGroup - Archive of obsolete content
« xul reference home appendgroup( group ) return type: no return value not in firefox add several new tabs to the end of the existing tabs.
blur - Archive of obsolete content
ArchiveMozillaXULMethodblur
the focus is not automatically placed on any other element.
close - Archive of obsolete content
ArchiveMozillaXULMethodclose
« xul reference home close() return type: no return value closes the notification or findbar and removes it from its enclosing notificationbox or findbar.
collapseToolbar - Archive of obsolete content
« xul reference home collapsetoolbar( toolbar ) not in firefox return type: no return value collapse the given toolbar which should be contained within the toolbox.
ensureElementIsVisible - Archive of obsolete content
« xul reference home 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.
ensureIndexIsVisible - Archive of obsolete content
« xul reference home ensureindexisvisible( index ) return type: no return value if the item at the specified index is not currently visible to the user the displayed items are scrolled so that it is.
ensureSelectedElementIsVisible - Archive of obsolete content
« xul reference home ensureselectedelementisvisible() return type: no return value if the currently selected element in the list box is not currently visible to the user, the list box view is scrolled so that it is.
expandToolbar - Archive of obsolete content
« xul reference home expandtoolbar( toolbar ) not in firefox return type: no return value expand the given toolbar which should be contained in the toolbox.
getBrowserIndexForDocument - Archive of obsolete content
it should not be used to track per-tab data during a session; the use of linkedpanel on the corresponding tab is preferred instead.
getElementsByAttributeNS - Archive of obsolete content
note that this method is only available on xul elements and is not part of the dom.
getIndexOfFirstVisibleRow - Archive of obsolete content
note that this is not the same as the first row -- if the displayed items have been scrolled down, this function will retrieve the index of the first row that the user can see.
getSelectedItem - Archive of obsolete content
the argument index specifies the index in the list of the selected items, not the row number of the item.
goBackGroup - Archive of obsolete content
« xul reference home gobackgroup() not in firefox return type: no return value returns to the previous group of tabs.
goForwardGroup - Archive of obsolete content
« xul reference home goforwardgroup() not in firefox return type: no return value go forward to the next group of tabs.
goTo - Archive of obsolete content
ArchiveMozillaXULMethodgoTo
the onwizardback and onwizardnext code is not called when using this function.
insertItemAt - Archive of obsolete content
note: you cannot insert an item to an index that does not exist, eg: trying to insert an item at the end with element.getrowcount() + 1 example <!-- this example inserts at the selected item or appends, then selects the newly created item --> <script language="javascript"> function insertitemtolist(){ var mylistbox = document.getelementbyid('mylistbox'); // create a date to get some labels and values var somedate = new date(); if(mylistbox.selectedindex == -1){ // no item was selected in list so append to the en...
loadGroup - Archive of obsolete content
« xul reference home loadgroup( group ) not in firefox return type: the first tab loads a group of pages into multiple tabs.
loadURIWithFlags - Archive of obsolete content
load_flags_bypass_history: do not add the url to the session history.
moveTo - Archive of obsolete content
ArchiveMozillaXULMethodmoveTo
« xul reference home moveto( x, y ) return type: no return value moves the popup to a new location defined by screen coordinates (and not client coordinates).
onSearchComplete - Archive of obsolete content
you should not call this method yourself.
onTextEntered - Archive of obsolete content
you should not call this method yourself.
onTextReverted - Archive of obsolete content
you should not call this method yourself.
openSubDialog - Archive of obsolete content
the arguments are similar to the window's opendialog method except that the window name does not need to be supplied.
removeAllTabsBut - Archive of obsolete content
if only one tab page is displayed, this method does nothing.
removeCurrentTab - Archive of obsolete content
if it is the only displayed tab, this method does nothing.
removeTab - Archive of obsolete content
if only one tab is displayed, this method does nothing (unless the preference browser.tabs.closewindowwithlasttab is true, in which case the window containing the tab is closed).
selectItemRange - Archive of obsolete content
this method does nothing for single-selection list boxes.
syncSessions - Archive of obsolete content
« xul reference home syncsessions( autocompleteelement ) obsolete since gecko 26 return type: void copy the sessions from another autocomplete element.
Node - Archive of obsolete content
ArchiveMozillaXULNode
for more information on this interface please see dom-level-2-core short element_node 1 short attribute_node 2 short text_node 3 short cdata_section_node 4 short entity_reference_node 5 short entity_node 6 short processing_instruction_node 7 short comment_node 8 short document_node 9 short document_type_node 10 short document_fragment_node 11 short notation_node 12 methods node appendchild ( node newchild ) node clonenode ( boolean deep ) boolean hasattributes ( ) boolean haschildnodes ( ) node insertbefore ( node newchild , node refchild ) boolean issupported ( string feature , string version ) void normalize ( ) node removechild ( node oldchild ) node replacechild ( node newchild , node oldchild ) ...
MoveResize - Archive of obsolete content
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.
appLocale - Archive of obsolete content
gecko 1.9.1 note this property was removed in gecko 1.9.1.
canAdvance - Archive of obsolete content
if this property is false, the user cannot navigate to the next page.
canRewind - Archive of obsolete content
if this property is false, the user cannot navigate to the previous page.
contextMenu - Archive of obsolete content
note that the value of this property does not reflect the value of the context attribute, which is otherwise identical to the contextmenu attribute.
currentIndex - Archive of obsolete content
you cannot rely on this property to change or determine a tree selection, except for trees with seltype="single".
currentSet - Archive of obsolete content
« xul reference currentset not in seamonkey 1.x type: comma-separated list of strings holds a comma-separated list of the ids of the items currently on the toolbar.
database - Archive of obsolete content
set to null for elements that do not have a datasources attribute.
deck.selectedPanel - Archive of obsolete content
« xul reference do not hide panels; the deck element only understands visible panels.
defaultButton - Archive of obsolete content
« xul reference defaultbutton type: string normally this attribute should not be set, but if it is, it specifies the default button in the dialog.
editingSession - Archive of obsolete content
you would not normally need to use this.
externalToolbars - Archive of obsolete content
« xul reference externaltoolbars type: array of elements an array of external toolbars; that is, toolbar elements that should be considered to be members of this toolbox, even if they are not actually children of the toolbox.
firstOrdinalColumn - Archive of obsolete content
« xul reference firstordinalcolumn type: treecol element a reference to the first treecol element, which or may not be the first column displayed in the tree.
focusedItem - Archive of obsolete content
« xul reference focuseditem type: radio element holds the currently focused item in the radiogroup, which may or may not be the same as the selected item.
hideSeconds - Archive of obsolete content
« xul reference hideseconds type: boolean indicates whether the seconds field is visible or not.
instantApply - Archive of obsolete content
« xul referenceinstantapplytype: booleanyou can set this attribute to true to make the preference apply instantly, even when the global setting is not to use instant apply.
maxWidth - Archive of obsolete content
note: prior to gecko 6.0, you could use this on <input> elements; this was never intended, was a violation of the html specification, and has been fixed.
next - Archive of obsolete content
ArchiveMozillaXULPropertynext
this can be used to create wizards that do not have a linear sequence.
onFirstPage - Archive of obsolete content
« xul reference onfirstpage type: boolean this property is set to true if the user is on the first page, which may or may not be the first index.
pageStep - Archive of obsolete content
this property is different than pageindex, because pages are not necessarily navigated in order.
popup - Archive of obsolete content
ArchiveMozillaXULPropertypopup
note: this property is readonly in thunderbird and seamonkey.
popupOpen - Archive of obsolete content
« xul reference popupopen new in thunderbird 15 requires seamonkey 2.12 type: boolean indicates whether the popup is open or not.
radio.control - Archive of obsolete content
« xul reference control type: radiogroup element returns the enclosing radiogroup that the radio element is contained within, which may or may not be its direct parent.
readOnly - Archive of obsolete content
« xul reference readonly type: boolean if set to true, then the user cannot modify the value of the element.
resource - Archive of obsolete content
if the ref attribute is not specified, the id attribute is used instead.
richlistitem.label - Archive of obsolete content
does not support setting label values.
selected - Archive of obsolete content
« xul reference selected type: boolean this property's value is true if this element is selected, or false if it is not.
selectedItem - Archive of obsolete content
the listbox, richlistbox, radiogroup, etc., not the list item that was selected) when it is changed either via this property, the selectedindex property, or changed by the user.
smoothScroll - Archive of obsolete content
if not set explicitly, it will fall back to the smoothscroll attribute and then to the toolkit.scrollbox.smoothscroll preference.
tag - Archive of obsolete content
ArchiveMozillaXULPropertytag
thus, nested elements will not match because they are directly inside a treeitem.
textValue - Archive of obsolete content
note: setting the value causes an input event to be generated without triggering autocompletion.
toolbarName - Archive of obsolete content
« xul reference toolbarname not in seamonkey 1.x type: string the name of the toolbar.
listcell-iconic - Archive of obsolete content
note that both an image and a label are added when this style is set.
Containment Properties - Archive of obsolete content
note the distinction here.
Using Multiple Queries to Generate More Results - Archive of obsolete content
to do this, we create one query to generate one set of results and a second query to generate another set of results.
Code Samples - Archive of obsolete content
note: on operating systems that use backslash characters, double each backslash character.
Toolbars - Archive of obsolete content
custom toolbar button another example of how to create a toolbar button, complete with a sample extension you can download and try.
Introduction to RDF - Archive of obsolete content
note that the last visited date has a slightly different namespace than the other three.
Introduction to XBL - Archive of obsolete content
note the namespace on the bindings element in the template above.
Stacks and Decks - Archive of obsolete content
note that events such as mouse clicks and keypresses are passed to the element on the top of the stack, that is, the last element in the stack.
XBL Inheritance - Archive of obsolete content
any binding can be extended with another.
XPCOM Examples - Archive of obsolete content
you can also get this component through the rdf service, which is another service that manages rdf datasources.
Using spell checking in XUL - Archive of obsolete content
this method returns true if the word is correctly spelled, or false if it's not.
XUL Parser in Python/source - Archive of obsolete content
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 in files: file = file.strip() print '** ' + file + ' **' data = open(file).read() ...
XUL and RDF - Archive of obsolete content
the second section describes the xul/rdf architecture itself and outlines enhancements to the xul language in order to allow the markup language to reference local data and to indicate how and when it would like to be annotatable with local data.
XUL controls - Archive of obsolete content
menulist reference related elements: menupopup menuitem <menulist editable="true"> an editable menulist is like a standard menulist except that the selected value is displayed in a textbox where it may be modified directly or values not in the popup list may be entered.
box - Archive of obsolete content
ArchiveMozillaXULbox
child elements do not overlap.
broadcasterset - Archive of obsolete content
the broadcasterset and its descendants are not displayed.
caption - Archive of obsolete content
none the text will be not be cropped using an ellipsis.
column - Archive of obsolete content
it is common to use columns only to define width and flexibility for the grid column and not place elements directly inside the column.
columns - Archive of obsolete content
the columns element may be nested inside another columns element.
content - Archive of obsolete content
thus, nested elements will not match because they are directly inside a treeitem.
deck - Archive of obsolete content
ArchiveMozillaXULdeck
returns -1 if no items are selected do not hide panels; the deck element only understands visible panels.
dropmarker - Archive of obsolete content
a dropmarker is not intended to be used as a separate element, but as part of another element.
grid - Archive of obsolete content
ArchiveMozillaXULgrid
note: this page is about grids in mozilla's xul technology.
member - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used within a rule's conditions element to match elements that are containers or are contained within another element.
observes - Archive of obsolete content
the id, ref, and persist attributes are not observed.
popupset - Archive of obsolete content
this element is optional; the given elements need not appear in a popupset container.
preferences - Archive of obsolete content
note: it's not clear which of the following methods and properties are public.
promptBox - Archive of obsolete content
note: this is largely an implementation detail; if you're developing an add-on, you shouldn't need to tinker with this.
rows - Archive of obsolete content
ArchiveMozillaXULrows
the rows element may be nested inside another rows element.
script - Archive of obsolete content
note: if the javascript file is in chrome://, setting this attribute to application/javascript will always use the latest available javascript version.
separator - Archive of obsolete content
note that the values are the reverse of what seems more likely.
spinbuttons - Archive of obsolete content
spin buttons are not used as separate elements, but are used in combination with other elements to create a control that can be increased and decreased.
stack - Archive of obsolete content
ArchiveMozillaXULstack
note that bottom and right attributes, unlike rect, are relative to the bottom and right of the stack.
stringbundle - Archive of obsolete content
for example, the following defines two properties: message.displayerror=an error occured trying to display this message message.namealreadyused=the name %s is already being used by another account.
tabpanels - Archive of obsolete content
the tabpanels element should be placed in a tabbox although it does not have to be a direct child.
textnode - Archive of obsolete content
this element does nothing outside of a template.
titlebar - Archive of obsolete content
ources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width note: the allowevents attribute did not work for title bars prior to firefox 3.
toolbargrippy - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] not in firefox the notch on the side of a toolbar which can be used to collapse and expand it.
treeitem - Archive of obsolete content
the open attribute is not present if the menu is closed.
triple - Archive of obsolete content
if the assertion does not exist, the rule will not match.
How to enable locale switching in a XULRunner application - Archive of obsolete content
defaults/preferences/prefs.js /* don't inherit os locale */pref("intl.locale.matchos", "false");/* choose own fallback locale; later it can be overridden by the user */pref("general.useragent.locale", "en-gb"); note that some distributions of xulrunner or firefox don't honour the "intl.locale.matchos" setting, so in those cases you won't be able to override the os locale [debian iceweasel bug #417961].
Make your xulrunner app match the system locale - Archive of obsolete content
also, this may not be the proper way to do this and it may not work for you in all cases.
Opening a Link in the Default Browser - Archive of obsolete content
extps.loaduri(uritoopen, null); by default, the external protocol service will warn the user about opening the link in another application.
Using Crash Reporting in a XULRunner Application - Archive of obsolete content
to enable crash reporting on the client, set the following items in application.ini: [crash reporter] enabled=true serverurl=https://your.server.url/submit note: because crash reports can contain private data including passwords, in production environments they should only be sent via https.
xulauncher - Archive of obsolete content
-f "$1" ] then echo "\"$1\" is not a file" exit fi # define some variables ############################################################################## wd=/tmp ext=".xul" xulfile=`basename $1` xulname=${xulfile%$ext} xuldir="$wd/$xulname/chrome/$xulname/" xulprefdir="$wd/$xulname/defaults/preferences" xulappini="$wd/$xulname/application.ini" xulmanifest="$wd/$xulname/chrome/chrome.manifest" xulprefs="$wd/$xulname/defaults/p...
calICalendarViewController - Archive of obsolete content
the calidatetime parameters are optional, but aendtime cannot be included without astarttime.
Mozprofile - Archive of obsolete content
if a profile is not specified, one will be created in a temporary directory which will be echoed to the terminal: (mozmill)> mozprofile /tmp/tmp4q1ieu.mozrunner (mozmill)> ls /tmp/tmp4q1ieu.mozrunner user.js to run mozprofile from the command line enter: mozprofile --help for a list of options.
xbDesignMode.js - Archive of obsolete content
/* ***** begin license block ***** * version: mpl 1.1/gpl 2.0/lgpl 2.1 * * the contents of this file are subject to the mozilla public license version * 1.1 (the "license"); you may not use this file except in compliance with * the license.
Format - Archive of obsolete content
meetings mozilla project weekly status meeting - 2006/07/24 1:00p pdt (last meeting notes) firefox 2 (bon echo) status meeting - 2006/07/25 11:00a pdt (last meeting notes) firefox 3 (gran paradiso) status meeting - 2006/07/26 11:00a pdt ...
Mozilla.dev.apps.firefox-2006-10-06 - Archive of obsolete content
discussion regarding suggestions in the search bar not functioning in the october 3rd nightly build of ff 2.0.
2006-11-10 - Archive of obsolete content
important dates: technical submissions: monday 19th feb 2007 technical paper notification: friday 16th march 2007 communication submissions: monday 26th march 2007 communication paper notification: friday 06th april 2007 all camera ready due: monday 16th april 2007 conference dates: monday 07th and tuesday 08th may 2007 notable keynotes representatives from w3c, ibm, university of manchester, uk and oxford brookes university, uk.
2006-10-06 - Archive of obsolete content
sunbird release notes lightning release notes sunbird_0_3_release tag being created lilmatt announced the sunbird 0.3 realse tag being created.
2006-10-06 - Archive of obsolete content
discussion regarding suggestions in the search bar not functioning in the october 3rd nightly build of ff 2.0.
2006-11-17 - Archive of obsolete content
firefox 2.0 javascript popup issue user seeks advice about a line of javascript code that worked in firefox 1.5.0.x, but not in firefox 2.0 balloon help user inquires if anyone can explain how to disable the balloon help in firefox 2.0.
2006-12-01 - Archive of obsolete content
ff2 not responding to click on link concerns regarding ff 2.0 not responding to button or link clicks until the button or link is clicked a second time.
2006-10-20 - Archive of obsolete content
however, detail info of the problem is not clear, no futher suggestion or solution is provided thus far.
2006-10-27 - Archive of obsolete content
jonathan pritchard has clarified that announcement does not mean thunderbird will be changing direction, just certain areas of development that are of interest to the eudora developers will have more attention paid to them.
2006-11-10 - Archive of obsolete content
meetings calendar project weekly status meeting - 2006/11/08 17:00 utc (meeting notes) calendar project weekly qa chat - 2006/11/09 16:30 utc (meeting notes) ...
2006-11-17 - Archive of obsolete content
meetings calendar project weekly status meeting - 2006/11/15 17:00 utc (meeting notes) calendar project weekly qa chat - 2006/11/02 16:30 utc (meeting notes) ...
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.
2006-09-29 - Archive of obsolete content
he has already tried archiving the changed files but unfortunately this does not work with a static build because the .exe files change every time.
2006-10-13 - Archive of obsolete content
summary: mozilla.dev.builds - october 7th to october 13th 2006 cannot build ff 1.5.0.7 on linux x86_64 werner flamme cannot build firefox 1.5.0.7 on his suse linux 10.0 x86_64 box.
2006-09-22 - Archive of obsolete content
summary: mozilla.dev.i18n - feb 2nd - sep 22nd, 2006 announcements testing a dummy greek bon echo nsis installer bug #69230: accelerators should not be affected by keyboard group/level proposal of code changes for l10n in firefox 3 discussions thai language support: how can we add thai as an official localized build?
2006-10-06 - Archive of obsolete content
test resumt will be found here another lightning localization update with some bad news difference has been located between sunbird_0_3_branch (for sunbird 0.3) and mozilla_1_8_branch.
2006-11-10 - Archive of obsolete content
discussions help about firefox 3 a discussion on how to syncronise mozilla_1_8_branch with the trunk, which tag should be used to check-in files on trunk, and when files will be pulled from trunk to create another branch (mozilla_1_9_branch?) for firefox 3.
2006-11-3 - Archive of obsolete content
revisiting mozillatranslator bugs in bugzilla revisiting mozillatranslator bugs in bugzilla dictionary packages there are some dictionaries at http://dictionaries.mozdev.org/installation.html which are not at https://addons.mozilla.org/en/dictionaries.
2006-07-17 - Archive of obsolete content
meetings mozilla project weekly status meeting - 2006/07/24 1:00p pdt (last meeting notes) firefox 2 (bon echo) status meeting - 2006/07/25 11:00a pdt (last meeting notes) firefox 3 (gran paradiso) status meeting - 2006/07/26 11:00a pdt ...
2006-09-22 - Archive of obsolete content
meetings weekly status meeting - 09/25/2006 1pm pdt (last meeting notes) gran paradiso/gecko 1.9 status meeting - 09/27/2006 11am pdt (last meeting notes) gecko 1.9 bug triage meeting - 09/28/2006 3pm pdt ...
2006-10-06 - Archive of obsolete content
meetings weekly status meeting - 10/02/2006 - (last meeting notes) bon echo status meeting - 10/03/2006 - (last meeting notes) ...
2006-11-03 - Archive of obsolete content
bon echo status meeting: october 31st, 2006: (possibly final meeting) get notes here weekly project status meeting monday oct 30 1pm *pst*: get notes here ...
2006-12-01 - Archive of obsolete content
also discussed is the the mozilla_1_8_branch's npotb (not part of the build) checkin policy.
2006-10-20 - Archive of obsolete content
traffic october 14, 2006, 6:53pm - ed notes that, on windows, composer 0.1's reccomended install directory needs to be different than those noted in the release notes.
2006-11-03 - Archive of obsolete content
robert sayre notes that he and dave liebreich have a nice, simple environment set up for browser-based js tests meetings no meetings this week ...
2006-18-24 - Archive of obsolete content
summary: mozilla.dev.platform - november 18th - november 24th, 2006 announcements no announcements this week traffic xulrunner: <browser> not allowing javascript popup windows b notes that when using xul elements <browser/> and <tabbrowser/> the javascript popup windows don't work out of the box and asks what needs to be implement.
2006-09-29 - Archive of obsolete content
he needs help testing it out and wants to know how to make an iframe loads not go into the history.
2006-10-27 - Archive of obsolete content
he recommends that a non-xpcshell environment is needed really badly, but the big issue is that the xpcshell doesn't have an event loop, so nothing asynchronous can be tested.
2006-11-03 - Archive of obsolete content
discussions none meetings community test day - on friday, november 3, 2006 another community test day focusing on security and stability release, and you can help by verifying bugs, and by running the litmus test cases under the ffts or the bfts.
2006-10-06 - Archive of obsolete content
as well as any protocols that you have implemented and are not in the list of protocols nsscriptsecuritymanager::checkloaduri feed: consensus is that it should be allowed and treated as an ordinary link.
2006-10-20 - Archive of obsolete content
joes noticed that mp3 files are no longer allowed to be opened directly from email attachments in trunk builds of thunderbird and seamonkey.
2006-11-03 - Archive of obsolete content
a decision has to be made as to the usefulness of extended validation certificates and weather or not they will make a difference to the reliability of information in certificates.
2006-11-10 - Archive of obsolete content
good ideas a splinter off of the extended validation certificates discussion going over whether or not fraudulent websites may get these certificates and if so how to prevent this from happening.
2006-11-17 - Archive of obsolete content
extended validation certificates a note as to how opera is handling extended validation certificates http://labs.opera.com/news/2006/10/09/ fwd: re: mozilla questions regarding the ev standard gervase markham posted a summary of questions emailed to kelvin yiu about the extended validation certificates.
2006-12-01 - Archive of obsolete content
discussions protocol security daniele rizzo posted a question as to whether or not it is possible to enable/disable the privilege of universalxpconnect in a 'entire' protocol (http://, file://).
2006-09-22 - Archive of obsolete content
caldwell has noted that the main javascript site on mozilla.org is sending people to the wrong newsgroup.
2006-09-29 - Archive of obsolete content
nothing to summarize this week as there was no summary and all questions were left unanswered.
2006-10-06 - Archive of obsolete content
nothing to summarize this week as there was no summary and all questions were left unanswered.
2006-10-13 - Archive of obsolete content
nothing to summarize this week, see faq instead.
2006-11-17 - Archive of obsolete content
mike shaver's response was that resurrecting objects is not possible and that objects in spidermonkey are not reference counted.
JS-Engine FAQ - Archive of obsolete content
domparser is not part of js but part of mozilla browser which makes it available to script in the browser using xpconnect.
2006-09-30 - Archive of obsolete content
summary: mozilla.dev.tech.xpcom - sept 30- oct 5, 2006 announcements build a xpcom component on mac os x benjamin smedberg confirmed that this tutorial http://www.iosart.com/firefox/xpcom/ is misleading as it uses the standalone glue (-dxpcom_glue) for components, which is not recommended.
2006-11-24 - Archive of obsolete content
utorials: non c++ bindings for xpcom tutorials on how to interface with firefox using xpcom on a similar basis to how a developer can with internet explorer through it's com interface tutorals and references related to extension development tutorials on developing extensions which use the third party libraries for firefox references to mozilla api exposed javascript component + xmldocument not accessible a discussion on error: uncaught exception: permission denied to get property xmldocument.textcontent creating xpcom components a good discussion about "components.classes[cid] has no properties" error firefox http explanation about how firefox handles the http aspect meetings none during this week.
2006-10-13 - Archive of obsolete content
sunbird release notes lightning release notes inter-operability test day on tuesday october 17 interoperability testing for sunbird on tuesday.
External resources for plugin creation - Archive of obsolete content
please note that even when using these, it is still a good idea to have an understanding of what is going on under the hood, regardless of the level of abstraction provided.
NPAnyCallbackStruct - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary note: this structure is only used on unix platforms.
NPClass - Archive of obsolete content
hasmethod called by npn_hasmethod() to determine whether or not a specified method exists on a given npobject.
NPNVariable - Archive of obsolete content
note: npnvariable != nppvariable ...
NPN_DestroyStream - Archive of obsolete content
if unsuccessful, the plug-in is not loaded and the function returns an error code.
NPN_Enumerate - Archive of obsolete content
note: the caller must call npn_memfree() on the pointer received through the identifiers parameter of a successful call to npn_enumerate to release the array of string identifiers when it is no longer needed.
NPN_Evaluate - Archive of obsolete content
note: the caller must call npn_releasevariantvalue() to release the returned value when it's no longer needed.
NPN_ForceRedraw - Archive of obsolete content
note: as of firefox 4, this function no longer has any effect when running with separate plugin processes.
NPN_GetProperty - Archive of obsolete content
note: the caller must call npn_releasevariantvalue() to release the returned value when it's no longer needed.
NPN_GetValueForURL - Archive of obsolete content
note: the value may have internal null bytes and may not be null-terminated.
NPN_HasMethod - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary determines whether or not the specified npobject has a particular method.
NPN_HasProperty - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary determines whether or not the specified npobject has a particular property.
NPN_IdentifierIsString - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary determines whether or not an identifier is a string.
NPN_IntFromIdentifier - Archive of obsolete content
note: the behavior of this function is undefined if <tt>identifier</tt> isn't an integer identifier.
NPN_Invoke - Archive of obsolete content
note: early on in the development of the scriptability api this method used to be called npn_call() but was renamed for consistency.
NPN_MemAlloc - Archive of obsolete content
you only need to use npn_memflush in situations where you cannot use npn_memalloc, for example, when calling system methods that allocate memory indirectly.
NPN_MemFree - Archive of obsolete content
npn_memfree does not free memory allocated by any other means.
NPN_ReleaseVariantValue - Archive of obsolete content
returns nothing.
NPN_ReloadPlugins - Archive of obsolete content
normally, if you add or remove any plug-ins, the browser does not see them until you restart gecko.
NPN_SetException - Archive of obsolete content
returns nothing.
NPN_Status - Archive of obsolete content
your message is always displayed, but you have no control over how long it stays in the status line before another message replaces it.
NPN_Write - Archive of obsolete content
note: you should actually handle errors, which this example doesn't do.
NPObject - Archive of obsolete content
warning: do not manipulate the _class and referencecount fields directly; use the functions below to manipulate the object.
NPP - Archive of obsolete content
ndata a private value, owned by the browser, which is used to store data associated with the instance; this value should not be modified by the plug-in.
NPPVariable - Archive of obsolete content
note: nppvariable != npnvariable ...
NPP_DestroyStream - Archive of obsolete content
you should delete any private data allocated in stream->pdata at this time, and should not make any further references to the stream object.
NPP_Write - Archive of obsolete content
the buf parameter is not persistent, so the plug-in must process data immediately or allocate memory and save a copy of it.
NPP_WriteReady - Archive of obsolete content
because it is not processing streaming data, the browser can pass as much data to the instance as necessary in a single npp_write.
NPRegion - Archive of obsolete content
syntax windows: typedef hrgn npregion; mac os x: typedef rgnhandle npregion; note: this may need to be updated for the cocoa event model.
NPSetWindowCallbackStruct - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary note: this structure is only used on unix platforms.
NPUTF8 - Archive of obsolete content
this is not the same thing as an entire utf-8 character, which may be comprised of multiple nputf8 bytes.
NPVariant - Archive of obsolete content
npvarianttype_int32 or npvarianttype_double string npvarianttype_string all other types npvarianttype_object functions npn_releasevariantvalue() npn_getstringidentifier() npn_getstringidentifiers() npn_getintidentifier() npn_identifierisstring() npn_utf8fromidentifier() npn_intfromidentifier() macros plugin developers are not expected to directly manipulate or access the members of the npvariant instance, instead, the function npn_releasevariantvalue(), and the following macros are provided: npvariant_is_void() evaluates to true if v is of type npvarianttype_void.
NP_Initialize - Archive of obsolete content
if unsuccessful, the plug-in is not loaded and the function returns an error code.
NP_Shutdown - Archive of obsolete content
note: if enough memory is available, the browser can keep the plug-in library loaded if it expects to create more instances in the near future.
NPAPI plug-in side API - Archive of obsolete content
npp_destroy npp_destroystream npp_getvalue np_getvalue npp_handleevent np_initialize npp_new npp_newstream npp_print npp_setvalue npp_setwindow np_shutdown npp_streamasfile npp_urlnotify npp_write npp_writeready ...
Why Well-Formed Web RSS Module is Popular - Syndicating Your Comments - Archive of obsolete content
however, rss does not provide sufficient facilities for dealing with them.
How RSS Works - Archive of obsolete content
you will not yet be creating your own rss files, but you will be learning about the different systems that come into play with rss syndication.
Syndicating content with RSS - Archive of obsolete content
(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.
Why use RSS - Archive of obsolete content
you will not yet be creating your own rss files, but you will be learning about reasons to use it.
Atomic RSS - Archive of obsolete content
ArchiveRSSModuleAtom
"getting started" box, if there is no "getting started" article yet written, should be populated with another feature article or tutorial, should one exist.
Content - Archive of obsolete content
"getting started" box, if there is no "getting started" article yet written, should be populated with another feature article or tutorial, should one exist.
Security - Archive of obsolete content
but encryption and decryption, by themselves, do not address another problem: tampering.encryption and decryptionencryption is the process of transforming information so it is unintelligible to anyone but the intended recipient.
Creating a Skin for Firefox - Archive of obsolete content
a skin does not totally change the interface; instead, it just defines how the interface looks.
Using Firebug and jQuery (Screencast) - Archive of obsolete content
note: this screencast is originally from: http://ejohn.org/blog/hacking-digg-w...ug-and-jquery/ this is an adaptation of a presentation that i gave while at mashup camp boston.
-moz-binding - Archive of obsolete content
formal definition initial valuenoneapplies toall elements except generated content or pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <url> | none examples .exampleone { -moz-binding: url(http://www.example.org/xbl/htmlbindings.xml#radiobutton); } specifications not part of any standard.
-moz-text-blink - Archive of obsolete content
note that not blinking the text is one technique to satisfy checkpoint 3.3 of wai-uaag.
-moz-window-shadow - Archive of obsolete content
this property is not standard and from firefox 44 onwards cannot be used on websites anymore.
-ms-content-zoom-chaining - Archive of obsolete content
formal syntax none | chained specifications not part of any specification.
-ms-content-zoom-limit-max - Archive of obsolete content
formal syntax <percentage> specifications not part of any specification.
-ms-content-zoom-limit-min - Archive of obsolete content
formal syntax <percentage> specifications not part of any specification.
-ms-content-zoom-limit - Archive of obsolete content
formal syntax <'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'> specifications not part of any specification.
-ms-content-zoom-snap-points - Archive of obsolete content
} specifications not part of any specification.
-ms-content-zoom-snap-type - Archive of obsolete content
formal syntax none | proximity | mandatory specifications not part of any specification.
-ms-content-zoom-snap - Archive of obsolete content
formal syntax <'-ms-content-zoom-snap-type'> | <'-ms-content-zoom-snap-points'> specifications not part of any specification.
-ms-flow-from - Archive of obsolete content
formal syntax [ none | <custom-ident> ]# specifications not part of any specification.
-ms-flow-into - Archive of obsolete content
formal syntax [ none | <custom-ident> ]# specifications not part of any specification.
-ms-ime-align - Archive of obsolete content
formal syntax auto | after specifications not part of any specification.
-ms-overflow-style - Archive of obsolete content
formal syntax auto | none | scrollbar | -ms-autohiding-scrollbar specifications not part of any specification.
-ms-scroll-limit-x-max - Archive of obsolete content
formal syntax auto | <length> specifications not part of any specification.
-ms-scroll-limit-x-min - Archive of obsolete content
formal syntax <length> specifications not part of any specification.
-ms-scroll-limit-y-max - Archive of obsolete content
formal syntax auto | <length> specifications not part of any specification.
-ms-scroll-limit-y-min - Archive of obsolete content
formal syntax <length> specifications not part of any specification.
-ms-scroll-limit - Archive of obsolete content
formal syntax <'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'> specifications not part of any specification.
-ms-scroll-rails - Archive of obsolete content
formal syntax none | railed specifications not part of any specification.
-ms-scroll-snap-x - Archive of obsolete content
.scroll1 { -ms-scroll-snap-type: proximity; -ms-scroll-snap-points-x: snaplist(100%, 200%, 300%, 400%, 500%); } .scroll2 { -ms-scroll-snap-x: proximity snaplist(100%, 200%, 300%, 400%, 500%); } specifications not part of any specification.
-ms-scroll-snap-y - Archive of obsolete content
.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.
-ms-scrollbar-3dlight-color - Archive of obsolete content
*/ } </style> </head> <body> <textarea class="blue3dlight">the top and left edges of the thumb and button-face elements in the scroll bar for this element will be blue.</textarea> </body> </html> specifications not part of any specification.
-ms-scrollbar-arrow-color - Archive of obsolete content
</div> </body> the following image shows the result: specifications not part of any specification.
-ms-scrollbar-darkshadow-color - Archive of obsolete content
es.msdn.microsoft.com/workshop/samples/author/dhtml/refs/scrollbarcolor.htm <!doctype html> <html> <head> <title>scrollbar-darkshadow-color</title> <style> .blueshadow { scrollbar-darkshadow-color: blue; } </style> </head> <body> <textarea class="blueshadow">the gutter elements in the scroll bar for this element will be blue.</textarea> </body> </html> specifications not part of any specification.
-ms-scrollbar-face-color - Archive of obsolete content
</div> </body> this image shows the result: specifications not part of any specification.
-ms-scrollbar-highlight-color - Archive of obsolete content
</div> </body> this image shows the result: specifications not part of any specification.
-ms-scrollbar-shadow-color - Archive of obsolete content
<!doctype html> <html> <head> <title>scrollbar-shadow-color</title> <style> .blueshadow { scrollbar-shadow-color: blue; } </style> </head> <body> <textarea class="blueshadow">the gutter elements in the scroll bar for this element will be blue.</textarea> </body> </html> specifications not part of any specification.
-ms-wrap-margin - Archive of obsolete content
formal syntax <length> specifications not part of any specification.
-moz-windows-compositor - Archive of obsolete content
note: since firefox 58, this media feature is no longer available to web content — it is only available internally (e.g.
:-moz-system-metric(images-in-menus) - 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.
:-moz-system-metric(mac-graphite-theme) - 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
gin-right margin-top opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-browse example html <label>select image: <input type="file"></label> css input[type="file"]::-ms-browse { color: red; background-color: yellow; } result output example specifications not part of any specification.
::-ms-check - Archive of obsolete content
screenshotlive sample specifications not part of any specification.
::-ms-clear - Archive of obsolete content
*/ /* the cross can be hidden by setting the display attribute as "none" */ } result the following screenshot shows what the feature will look like: specifications not part of any specification.
::-ms-expand - Archive of obsolete content
-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-clear specifications not part of any specification.
::-ms-fill-lower - Archive of obsolete content
lues block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width specifications not part of any specification.
::-ms-fill-upper - Archive of obsolete content
e) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-fill-upper specifications not part of any specification.
::-ms-reveal - Archive of obsolete content
ck, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-reveal specifications not part of any specification.
::-ms-thumb - Archive of obsolete content
, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-thumb specifications not part of any specification.
::-ms-ticks-after - Archive of obsolete content
these ticks are not shown by default.
::-ms-ticks-before - Archive of obsolete content
these ticks are not shown by default.
::-ms-value - Archive of obsolete content
s-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-value example input::-ms-value { color: lime; font-style: italic; } to disable the default styling: select::-ms-value { background-color: transparent; color: inherit; } specifications not part of any specification.
-moz-os-version - Archive of obsolete content
note: since firefox 58, this media feature is no longer available to web content — it is only available internally (e.g.
-moz-scrollbar-end-backward - Archive of obsolete content
note: since firefox 58, this media feature is no longer available to web content — it is only available internally (e.g.
-moz-scrollbar-end-forward - Archive of obsolete content
note: since firefox 58, this media feature is no longer available to web content — it is only available internally (e.g.
-moz-scrollbar-start-backward - Archive of obsolete content
note: since firefox 58, this media feature is no longer available to web content — it is only available internally (e.g.
-moz-scrollbar-start-forward - Archive of obsolete content
note: since firefox 58, this media feature is no longer available to web content — it is only available internally (e.g.
-moz-scrollbar-thumb-proportional - Archive of obsolete content
note: since firefox 58, this media feature is no longer available to web content — it is only available internally (e.g.
-moz-windows-accent-color-in-titlebar - Archive of obsolete content
note: since firefox 58, this media feature is no longer available to web content — it is only available internally (e.g.
-moz-windows-classic - Archive of obsolete content
note: since firefox 58, this media feature is no longer available to web content — it is only available internally (e.g.
-moz-windows-default-theme - Archive of obsolete content
note: since firefox 58, this media feature is no longer available to web content — it is only available internally (e.g.
-moz-windows-theme - Archive of obsolete content
note: since firefox 58, this media feature is no longer available to web content — it is only available internally (e.g.
CSS - Archive of obsolete content
ArchiveWebCSS
if the word does not meet the required minimum number of characters in the word, before the hyphen, or after the hyphen, then the word is not hyphenated.-ms-hyphenate-limit-linesthe -ms-hyphenate-limit-lines css property is a microsoft extension specifying the maximum number of consecutive lines in an element that may be ended with a hyphenated word.-ms-hyphenate-limit-zonethe -ms-hyphenate-limit-zone css property is...
Descendants and Filters - Archive of obsolete content
« previousnext » accessing descendants in many cases, the node that you're interested in is not the direct child of the top xml element.
Using JavaScript Generators in Firefox - Archive of obsolete content
warning: this technique works only in firefox, not ie, chrome, safari, etc.
Iterator - Archive of obsolete content
not part of any current standards document ...
Array.observe() - Archive of obsolete content
index assignment changes which do not change the length of the array may be reported as "update" changes.
Function.arity - Archive of obsolete content
specifications not part of any standard.
Date.getVarDate() - Archive of obsolete content
not supported in windows 8.x store apps.
Debug.setNonUserCodeExceptions - Archive of obsolete content
not supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards.
Error.description - Archive of obsolete content
do not use!
Error.number - Archive of obsolete content
do not use!
ScriptEngineBuildVersion - Archive of obsolete content
do not use!
ScriptEngineMajorVersion - Archive of obsolete content
do not use!
ScriptEngineMinorVersion - Archive of obsolete content
do not use!
Microsoft JavaScript extensions - Archive of obsolete content
warning: these apis will only work in microsoft applications, and are not on a standards track.
New in JavaScript 1.1 - Archive of obsolete content
isnan() now works on every platform (not only unix anymore) parsefloat() and parseint() now return nan on all platforms, if the first character of the specified string cannot be converted to a number; in previous releases, it returned nan on solaris and irix and zero on all other platforms.
New in JavaScript 1.4 - Archive of obsolete content
new features in javascript 1.4 exception handling (throw and try...catch) in operator instanceof operator changed functionality in javascript 1.4 eval() changes (cannot be called indirectly and no longer a method of object) arguments not a property of functions deprecated function.arity in favor of function.length changes to liveconnect ...
New in JavaScript 1.5 - Archive of obsolete content
when non-capturing parentheses are used, matched subexpressions are not available as back-references.
New in JavaScript 1.6 - Archive of obsolete content
array.prototype.indexof() array.prototype.lastindexof() array.prototype.every() array.prototype.filter() array.prototype.foreach() array.prototype.map() array.prototype.some() array generics string generics for each...in changed functionality in javascript 1.6 a bug in which arguments[n] cannot be set if n is greater than the number of formal or actual parameters has been fixed.
New in JavaScript 1.8.5 - Archive of obsolete content
other standardization work various non-standard syntaxes for defining getters and setters have been removed; ecmascript 5 defined syntax has not been changed.
Number.toInteger() - Archive of obsolete content
examples using tointeger number.tointeger(0.1); // 0 number.tointeger(1); // 1 number.tointeger(math.pi); // 3 number.tointeger(null); // 0 specifications not part of any standard.
Object.prototype.__count__ - Archive of obsolete content
syntax obj.__count__ examples { 1: 1 }.__count__ // 1 [].__count__ // 0 [1].__count__ // 1 [1, /* hole */, 2, 3].__count__ // 3 specifications not part of any standard.
Object.prototype.eval() - Archive of obsolete content
specifications not part of any standard.
Object.prototype.__parent__ - Archive of obsolete content
specifications not part of any standard.
JSException - Archive of obsolete content
the getwrappedexception method was not available.
JavaClass - Archive of obsolete content
backward compatibility javascript 1.3 and earlier you must create a wrapper around an instance of java.lang.class before you pass it as a parameter to a java method -- javaclass objects are not automatically converted to instances of java.lang.class.
JavaPackage - Archive of obsolete content
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.
Packages - Archive of obsolete content
use standard java dot notation to access the classes, methods, and fields in these packages.
Server-Side JavaScript - Archive of obsolete content
server-side javascript is another way in which, as this article quotes eich, "mozilla wants to 'get people thinking about javascript as a more general-purpose language' and show them that 'it really is a platform for writing full applications.'" many vendors today are embedding mozilla rhino or mozilla spidermonkey into web server environments.
Standards-Compliant Authoring Tools - Archive of obsolete content
newer versions of microsoft frontpage™ have improved, however be sure not to rely on frontpage-specific extensions for critical website content or functionality.
XForms API Reference - Archive of obsolete content
note the word beginning :-) naming convention the xforms interfaces has the following naming convention: nsixforms...element interfaces implemented by the c++ part of a control nsixformsns...element interfaces extending xforms specification interfaces nsixforms...uielement interfaces implemented by the js part of a control nsixforms...accessors interface exposing states about the bound instance node for a given control frozen interfaces nsixformsmodelelement the model interface experimental interfaces nsixformsdelegate the delegate interface for xforms:custom_controls nsixformsaccessors the accessors interface for xforms:c...
RFE to the Custom Controls - Archive of obsolete content
note: xul is a feature of mozilla only and custom control authors should be aware their controls won't work on other browser platforms.
RFE to the Custom Controls Interfaces - Archive of obsolete content
this means that the bound node is not allowed to contain element nodes.
XForms Alert Element - Archive of obsolete content
introduction this message will be shown when the form control cannot properly bind to instance data or when the instance data value is invalid or out of the specified range of selectable values (see the spec).
XForms Message Element - Archive of obsolete content
representations it may be represented in the following ways: modal window - if level attribute value is modal modeless window - if level attribute value is modeless tooltip window - if level attribute value is ephemeral note: message element doesn't define a default presentation.
XForms Select Element - Archive of obsolete content
note, some representations of the select element do not support visual grouping.
XForms Select1 Element - Archive of obsolete content
note, some representations of the select1 element do not support visual grouping.
Using XForms and PHP - Archive of obsolete content
it is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called.
Window: devicelight event - Archive of obsolete content
note: this event has been disabled by default in firefox 62, behind the device.sensors.ambientlight.enabled preference (bug 1462308).
Parsing microformats in JavaScript - Archive of obsolete content
note: this doesn't return the html as a string, but an object with a few functions you can call to retrieve the html and do other tasks.
Styling Abbreviations and Acronyms - Archive of obsolete content
note: this reprinted article was originally part of the devedge site.
Examples - Game development
gorescript another retro style first person shooter.
Publishing games - Game development
game promotion developing and finishing the game is not enough.
Explaining basic 3D theory - Game development
during output merging some processing is also applied to ignore information that is not needed — for example the parameters of objects that are outside of the screen or behind other objects, and thus not visible, are not calculated.
Square tilemaps implementation: Static maps - Game development
note: when writing this article, we assumed previous reader knowledge of canvas basics such as how get a 2d canvas context, load images, etc., which is all explained in the canvas api tutorial, as well as the basic information included in our tilemaps introduction article.
WebRTC data channels - Game development
note: we will continue to add content here soon; there are some organizational issues to sort out.
asm.js - Game development
it does not allow objects, strings, closures, and basically anything that requires heap allocation.
Tools for game development - Game development
note that we are aiming to cover emscripten in its own section of mdn.
Build the brick field - Game development
note that the brick objects will also be used for collision detection purposes later.
Create the Canvas and draw on it - Game development
we're not limited to rectangles — here's a piece of code for printing out a green circle.
Finishing up - Game development
drawlives(); improving rendering with requestanimationframe() now let's work on something that is not connected to the game mechanics, but to the way it is being rendered.
Move the ball - Game development
making it move you won't notice the ball being repainted constantly at the moment, as it's not moving.
Bounce off the walls - Game development
bouncing off the world boundaries the easiest way to get our ball bouncing off the walls is to tell the framework that we want to treat the boundaries of the <canvas> element as walls and not let the ball move past them.
Build the brick field - Game development
kinfo.offset.top; newbrick = game.add.sprite(brickx, bricky, 'brick'); game.physics.enable(newbrick, phaser.physics.arcade); newbrick.body.immovable = true; newbrick.anchor.set(0.5); bricks.add(newbrick); } } } if you reload index.html at this point, you should see the bricks printed on screen, at an even distance from one another.
Collision detection - Game development
luckily enough we can use the physics engine to check collisions not only between single objects (like the ball and the paddle), but also between an object and the group.
Initialize the framework - Game development
it usually uses webgl if available in the browser, falling back to canvas 2d if not.
Move the ball - Game development
we have our blue ball printed on screen, but it's doing nothing — it would be cool to make it move somehow.
Physics - Game development
add the physics.startsystem() method at the beginning of the create function (make it the first line inside the function), as shown below: game.physics.startsystem(phaser.physics.arcade); next, we need to enable our ball for the physics system — phaser object physics is not enabled by default.
Scaling - Game development
update your existing preload() function as follows: function preload() { game.scale.scalemode = phaser.scalemanager.show_all; game.scale.pagealignhorizontally = true; game.scale.pagealignvertically = true; } scalemode has a few different options available for how the canvas can be scaled: no_scale — nothing is scaled.
404 - MDN Web Docs Glossary: Definitions of Web-related terms
a 404 is a standard response code meaning that the server cannot find the requested resource.
ALPN - MDN Web Docs Glossary: Definitions of Web-related terms
important protocol identifiers: protocol identification sequence http/1.1 0x68 0x74 0x74 0x70 0x2f 0x31 0x2e 0x31 ("http/1.1") http/2 0x68 0x32 ("h2") http/2 over cleartext tcp 0x68 0x32 0x63 ("h2c") specifications specification status notes rfc 7301 ietf rfc initial definition.
API - MDN Web Docs Glossary: Definitions of Web-related terms
for example: the getusermedia api can be used to grab audio and video from a user's webcam, which can then be used in any way the developer likes, for example, recording video and audio, broadcasting it to another user in a conference call, or capturing image stills from the video.
ARIA - MDN Web Docs Glossary: Definitions of Web-related terms
for example, you could add the attribute role="alert" to a <p> tag to notify a sight-challenged user that the information is important and time-sensitive (which you might otherwise convey through text color).
Algorithm - MDN Web Docs Glossary: Definitions of Web-related terms
computer scientists compare the efficiency of algorithms through the concept of "algorithmic complexity" or "big o" notation.
Alignment subject - MDN Web Docs Glossary: Definitions of Web-related terms
note, this only has an effect on multi-line flex containers.
Base64 - MDN Web Docs Glossary: Definitions of Web-related terms
note that btoa() expects to be passed binary data, and will throw an exception if the given string contains any characters whose utf-16 representation occupies more than one byte.
Block (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
for example, <p> is by default a block-level element, whereas <a> is an inline element — you can put several links next to one another in your html source and they will sit on the same line as one another in the rendered output.
Block - MDN Web Docs Glossary: Definitions of Web-related terms
for example, <p> is by default a block-level element, whereas <a> is an inline element — you can put several links next to one another in your html source and they will sit on the same line as one another in the rendered output.
Boolean - MDN Web Docs Glossary: Definitions of Web-related terms
below is some javascript pseudocode (it's not truly executable code) demonstrating this concept.
CMS - MDN Web Docs Glossary: Definitions of Web-related terms
a cms (content management system) is software that allows users to publish, organize, change, or remove various kinds of content, not only text but also embedded images, video, audio, and interactive code.
CORS-safelisted response header - MDN Web Docs Glossary: Definitions of Web-related terms
a cors-safelisted response header is an http header which has been safelisted so that it will not be filtered when responses are processed by cors, since they're considered safe (as the headers listed in access-control-expose-headers).
CORS - MDN Web Docs Glossary: Definitions of Web-related terms
access-control-allow-credentials indicates whether or not the response to the request can be exposed when the credentials flag is true.
CRUD - MDN Web Docs Glossary: Definitions of Web-related terms
crud typically refers to operations performed in a database or datastore, but it can also apply to higher level functions of an application such as soft deletes where data is not actually deleted but marked as deleted via a status.
CSRF - MDN Web Docs Glossary: Definitions of Web-related terms
this can be done, for example, by including malicious parameters in a url behind a link that purports to go somewhere else: <img src="https://www.example.com/index.php?action=delete&id=123"> for users who have modification permissions on https://www.example.com, the <img> element executes action on https://www.example.com without their noticing, even if the element is not at https://www.example.com.
CSS pixel - MDN Web Docs Glossary: Definitions of Web-related terms
the css pixel—denoted in css with the suffix px—is a unit of length which roughly corresponds to the width or height of a single dot that can be comfortably seen by the human eye without strain, but is otherwise as small as possible.
Canvas - MDN Web Docs Glossary: Definitions of Web-related terms
it is a low level, procedural model that updates a bitmap and does not have a built-in scene graph.
Chrome - MDN Web Docs Glossary: Definitions of Web-related terms
this is not to be confused with the google chrome browser.
Ciphertext - MDN Web Docs Glossary: Definitions of Web-related terms
in cryptography, a ciphertext is a scrambled message that conveys information but is not legible unless decrypted with the right cipher and the right secret (usually a key), reproducing the original cleartext.
Compile - MDN Web Docs Glossary: Definitions of Web-related terms
compiling is the process of transforming a computer program written in a given language into an equivalent program of another language.
Constant - MDN Web Docs Glossary: Definitions of Web-related terms
a constant is a value that the programmer cannot change, for example numbers (1, 2, 42).
Continuous Media - MDN Web Docs Glossary: Definitions of Web-related terms
continuous media, therefore, identifies a context where the content is not broken up, it flows continuously.
Cryptographic hash function - MDN Web Docs Glossary: Definitions of Web-related terms
to be used for cryptography, a hash function must have these qualities: quick to compute (because they are generated frequently) not invertible (each digest could come from a very large number of messages, and only brute-force can generate a message that leads to a given digest) tamper-resistant (any change to a message leads to a different digest) collision-resistant (it should be impossible to find two different messages that produce the same digest) cryptographic hash functions such as md5 and sha-1 are considered broke...
DOM (Document Object Model) - MDN Web Docs Glossary: Definitions of Web-related terms
dom was not originally specified—it came about when browsers began implementing javascript.
Domain - MDN Web Docs Glossary: Definitions of Web-related terms
many owners choose to have a subdomain "www" to point to their world_wide_web resource, but that's not required (and has even fallen somewhat out of favor).
Empty element - MDN Web Docs Glossary: Definitions of Web-related terms
an empty element is an element from html, svg, or mathml that cannot have any child nodes (i.e., nested elements or text nodes).
Encapsulation - MDN Web Docs Glossary: Definitions of Web-related terms
because of this, a user of that class only needs to know its interface (that is, the data and functions exposed outside the class), not the hidden implementation.
Entity - MDN Web Docs Glossary: Definitions of Web-related terms
character entity note & &amp; interpreted as the beginning of an entity or character reference.
Expando - MDN Web Docs Glossary: Definitions of Web-related terms
expando properties are properties added to dom nodes with javascript, where those properties are not part of the object's dom specification: window.document.foo = 5; // foo is an expando the term may also be applied to properties added to objects without respecting the object's original intent, such as non-numeric named properties added to an array.
FTP - MDN Web Docs Glossary: Definitions of Web-related terms
ftp (file transfer protocol) was the standard protocol for many years for transferring files from one host to another over the internet.
Favicon - MDN Web Docs Glossary: Definitions of Web-related terms
note, however, that most modern browsers replaced the favicon from the address bar by an image indicating whether or not the website is using https.
Fetch metadata request header - MDN Web Docs Glossary: Definitions of Web-related terms
these header names are prefixed with sec- and thus they are forbidden header names so headers can not be modified from javascript.
First CPU idle - MDN Web Docs Glossary: Definitions of Web-related terms
generally, it occurs when most, but not necessarily all visible ui elements are interactive, and the user interface responds, on average, to most user input within 50ms.
First input delay - MDN Web Docs Glossary: Definitions of Web-related terms
scrolling and zooming are not included in this metric.
First interactive - MDN Web Docs Glossary: Definitions of Web-related terms
minimally interactive is defined as when some, but not necessarily all, ui elements on the page have loaded and are interactive, and, on average, respond to user input in a reasonable amount of time.
Flex Container - MDN Web Docs Glossary: Definitions of Web-related terms
these values create a flex formatting context for the element, which is similar to a block formatting context in that floats will not intrude into the container, and the margins on the container will not collapse with those of the items.
Forbidden response header name - MDN Web Docs Glossary: Definitions of Web-related terms
a forbidden response header name is an http header name (either `set-cookie` or `set-cookie2`) that cannot be modified programmatically.
Garbage collection - MDN Web Docs Glossary: Definitions of Web-related terms
in other words, garbage collection is the process of removing any objects which are not being used by any other objects.
General header - MDN Web Docs Glossary: Definitions of Web-related terms
however, they are not entity headers.
Global object - MDN Web Docs Glossary: Definitions of Web-related terms
(in node.js this is not the case.) the global object's interface depends on the execution context in which the script is running.
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.
Grid Areas - MDN Web Docs Glossary: Definitions of Web-related terms
grid areas must be rectangular in nature; it is not possible to create, for example, a t- or l-shaped grid area.
Grid Cell - MDN Web Docs Glossary: Definitions of Web-related terms
if you do not place items using one of the grid placement methods, direct children of the grid container will be placed one into each individual grid cell by the auto-placement algorithm.
Grid Lines - MDN Web Docs Glossary: Definitions of Web-related terms
lines are also created in the implicit grid when implicit tracks are created to hold content positioned outside of the explicit grid, however these lines cannot be addressed by a number.
HTML - MDN Web Docs Glossary: Definitions of Web-related terms
there are a few empty or void tags that cannot enclose any text, for instance <img>.
HTTP/2 - MDN Web Docs Glossary: Definitions of Web-related terms
http/2 does not modify the application semantics of http in any way.
HTTP header - MDN Web Docs Glossary: Definitions of Web-related terms
a basic request with one header: get /example.http http/1.1 host: example.com redirects have mandatory headers (location): 302 found location: /newpage.html a typical set of headers: 304 not modified access-control-allow-origin: * age: 2318192 cache-control: public, max-age=315360000 connection: keep-alive date: mon, 18 jul 2016 16:06:00 gmt server: apache vary: accept-encoding via: 1.1 3dc30c7222755f86e824b93feb8b5b8c.cloudfront.net (cloudfront) x-amz-cf-id: tol0fem6ui4fgldrkjx0vao5hpkkgzulyn2twd2gawltr7vlnjtvzw== x-backend-server: developer6.webapp.scl3.mozilla.com x-cache: hit fro...
High-level programming language - MDN Web Docs Glossary: Definitions of Web-related terms
it is designed to be easily understood by humans and for this reason they must be translated by another software.
Hotlink - MDN Web Docs Glossary: Definitions of Web-related terms
a hotlink (also known as an inline link) is an object (typically an image) directly linked to from another site.
ICE - MDN Web Docs Glossary: Definitions of Web-related terms
this protocol lets two peers find and establish a connection with one another even though they may both be using network address translator (nat) to share a global ip address with other devices on their respective local networks.
Identifier - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, identifiers are case-sensitive and can contain unicode letters, $, _, and digits (0-9), but may not start with a digit.
Immutable - MDN Web Docs Glossary: Definitions of Web-related terms
an immutable object is one whose content cannot be changed.
JavaScript - MDN Web Docs Glossary: Definitions of Web-related terms
javascript should not be confused with the java programming language.
LGPL - MDN Web Docs Glossary: Definitions of Web-related terms
while any derivative work using a gpl-licensed program must be released under the same terms (free to use, share, study, and modify), the lgpl only requires the lgpl-licensed component of the derivative program to continue using the lgpl, not the whole program.
Local scope - MDN Web Docs Glossary: Definitions of Web-related terms
local scope is a characteristic of variables that makes them local (i.e., the variable name is only bound to its value within a scope which is not the global scope).
MVC - MDN Web Docs Glossary: Definitions of Web-related terms
if the state of this data changes, then the model will usually notify the view (so the display can change as needed) and sometimes the controller (if different logic is needed to control the updated view).
Media (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
typically, this is a screen—but it may also be a printer, a speech synthesizer, braille display, or another type of device.
Method - MDN Web Docs Glossary: Definitions of Web-related terms
note: in javascript functions themselves are objects, so, in that context, a method is actually an object reference to a function.
Mixin - MDN Web Docs Glossary: Definitions of Web-related terms
a mixin is a class or interface in which some or all of its methods and/or properties are unimplemented, requiring that another class or interface provide the missing implementations.
Native - MDN Web Docs Glossary: Definitions of Web-related terms
on the other hand, a web app that runs inside a browser is not native — it is run in the web browser, which sits on top of the native environment, not the native environment itself.
Navigation directive - MDN Web Docs Glossary: Definitions of Web-related terms
navigate-to restricts the urls to which a document can initiate navigation by any means, including <form> (if form-action is not specified), <a>, window.location, window.open, etc.
Network throttling - MDN Web Docs Glossary: Definitions of Web-related terms
it’s important not to overlook network conditions users experience on mobile.
Node - MDN Web Docs Glossary: Definitions of Web-related terms
another use of the word is when talking about node.js ...
Null - MDN Web Docs Glossary: Definitions of Web-related terms
but in certain cases, null is not as "primitive" as it first seems!
Operator - MDN Web Docs Glossary: Definitions of Web-related terms
for example, in javascript the addition operator ("+") adds numbers together and concatenates strings, whereas the "not" operator ("!") negates an expression — for example making a true statement return false.
POP3 - MDN Web Docs Glossary: Definitions of Web-related terms
pop3 does not support folders, unlike the more recent imap4, which is harder to implement because of its more complex structure.
Page load time - MDN Web Docs Glossary: Definitions of Web-related terms
the development environment, where page load time is measured, is likely an optimal experience, not reflective of your users' reality.
Page prediction - MDN Web Docs Glossary: Definitions of Web-related terms
however, page prediction may also download content a user does not seek.
Parser - MDN Web Docs Glossary: Definitions of Web-related terms
more generally, it's a piece of software that parses text and transforms its content to another representation.
Plaintext - MDN Web Docs Glossary: Definitions of Web-related terms
it is frequently used interchangeably with the term cleartext, which more loosely refers to any information, such as a text document, image, etc., that has not been encrypted and can be read by a human or computer without additional processing.
Promise - MDN Web Docs Glossary: Definitions of Web-related terms
a promise is an object that's returned by a function that has not yet completed its work.
Prototype-based programming - MDN Web Docs Glossary: Definitions of Web-related terms
prototype-based programming is a style of object-oriented programming in which classes are not explicitly defined, but rather derived by adding properties and methods to an instance of another class or, less frequently, adding them to an empty object.
Proxy server - MDN Web Docs Glossary: Definitions of Web-related terms
a proxy intercepts requests and serves back responses; it may forward the requests, or not (for example in the case of a cache), and it may modify it (for example changing its headers, at the boundary between two networks).
Public-key cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
however, they are typically much slower than symmetric algorithms and the size of message they can encrypt is proportional to the size of the key, so they do not scale well for long messages.
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.
RGB - MDN Web Docs Glossary: Definitions of Web-related terms
in css they can be represented as a single 24-bit integer in hexadecimal notation (for example, #add8e6 is light blue), or in functional notation as three separate 8-bit integers (for example, rgb(46, 139, 87) is sea green).
RTP (Real-time Transport Protocol) and SRTP (Secure RTP) - MDN Web Docs Glossary: Definitions of Web-related terms
the real-time transport protocol (rtp) is a network protocol which described how to transmit various media (audio, video) from one endpoint to another in a real-time fashion.
Regular expression - MDN Web Docs Glossary: Definitions of Web-related terms
on the web, javascript provides another regex implementation through the regexp object.
Ruby - MDN Web Docs Glossary: Definitions of Web-related terms
ruby is also a method for annotating east asian text in html documents to provide pronunciation information; see the <ruby> element.
SGML - MDN Web Docs Glossary: Definitions of Web-related terms
it is worth noting that since its fifth edition, html is no longer sgml-based and has its own parsing rules.
SQL Injection - MDN Web Docs Glossary: Definitions of Web-related terms
password=' anything 'or'1'='1 ' the password is not 'anything', hence password=anything results in false, but '1'='1' is a true statement and hence returns a true value.
SVN - MDN Web Docs Glossary: Definitions of Web-related terms
although svn can also handle binary files, we do not recommend that you use it for such files.
Same-origin policy - MDN Web Docs Glossary: Definitions of Web-related terms
the same-origin policy is a critical security mechanism that restricts how a document or script loaded from one origin can interact with a resource from another origin.
Screen reader - MDN Web Docs Glossary: Definitions of Web-related terms
there are some browser extension screen readers, but most screen readers operate system-wide for all user applications, not just the browser.
Script-supporting element - MDN Web Docs Glossary: Definitions of Web-related terms
these elements may be important, but do not affect the displayed page unless the page's scripts explicitly cause them to do so.
Search engine - MDN Web Docs Glossary: Definitions of Web-related terms
a search engine conducts the following processes: web crawling: searching web sites by navigating hyperlinks on web pages, both within a site, and from one site to another.
Shim - MDN Web Docs Glossary: Definitions of Web-related terms
this differs from a polyfill, which implements a new api that is not supported by the stock browser as shipped.
Signature (functions) - MDN Web Docs Glossary: Definitions of Web-related terms
the method accepts one parameter, which is called value and is not further defined.
Site - MDN Web Docs Glossary: Definitions of Web-related terms
examples of the same site https://developer.mozilla.org/docs/ https://support.mozilla.org/ same site because the registrable domain of mozilla.org is the same http://example.com:8080 https://example.com same site because scheme and port are not relevant examples of different site https://developer.mozilla.org/docs/ https://example.com not same site because the registrable domain of the two urls differs specifications specification status comment url living standard initial definition ...
Speed index - MDN Web Docs Glossary: Definitions of Web-related terms
the overall score, the above the fold metric, is a sum of the individual 10 times per second intervals of the percent of the screen that is not-visually complete.
Static typing - MDN Web Docs Glossary: Definitions of Web-related terms
in most of these languages, types must be expressly indicated by the programmer; in other cases (such as ocaml), type inference allows the programmer to not indicate their variable types.
Syntax - MDN Web Docs Glossary: Definitions of Web-related terms
this does not mean the two langauges share similarities with syntax.
Synthetic monitoring - MDN Web Docs Glossary: Definitions of Web-related terms
the traffic measured is not of your actual users, but rather synthetically generated traffic collecting data on page performance.
Transport Layer Security (TLS) - MDN Web Docs Glossary: Definitions of Web-related terms
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.
Texel - MDN Web Docs Glossary: Definitions of Web-related terms
it is not to be confused with pixel which is the unit of screen space.
Time to interactive - MDN Web Docs Glossary: Definitions of Web-related terms
although available in some performance monitoring tools, tti is not a part of any official web specification at the time of writing.
Type conversion - MDN Web Docs Glossary: Definitions of Web-related terms
type conversion (or typecasting) means transfer of data from one data type to another.
UTF-8 - MDN Web Docs Glossary: Definitions of Web-related terms
since non-ascii characters require more than one byte for storage, they run the risk of being corrupted if the bytes are separated and not recombined.
Vendor Prefix - MDN Web Docs Glossary: Definitions of Web-related terms
if an entire interface is experimental, then the interface's name is prefixed (but not the properties or methods within).
VoIP - MDN Web Docs Glossary: Definitions of Web-related terms
usually, telephone calls over the internet do not incur further charges beyond what the user is paying for internet access, much in the same way that the user doesn't pay for sending individual emails over the internet.
WebIDL - MDN Web Docs Glossary: Definitions of Web-related terms
webidl is used in nearly every api specification for the web, and due to its standard format and syntax, the programmers who create web browsers can more easily ensure that their browsers are compatible with one another, regardless of how they choose to write the code to implement the api.
Web performance - MDN Web Docs Glossary: Definitions of Web-related terms
it is the frames per second and times the main thread is not available for user interactions.
World Wide Web - MDN Web Docs Glossary: Definitions of Web-related terms
the web is not the same as the internet: the web is one of many applications built on top of the internet.
Application Context - MDN Web Docs Glossary: Definitions of Web-related terms
please note that the start url is not necessarily the value of the start_url member: the user or user agent could have changed it when the application was added to home-screen or otherwise bookmarked.
buffer - MDN Web Docs Glossary: Definitions of Web-related terms
a buffer is a storage in physical memory used to temporarily store data while it is being transferred from one place to another.
Character set - MDN Web Docs Glossary: Definitions of Web-related terms
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.
non-normative - MDN Web Docs Glossary: Definitions of Web-related terms
software specifications often contains information marked as non-normative or informative, which means that those are provided there for the purpose of helping the readers to understand the specification better or to show an example or a best practice, and not needed to be followed as a rule.
Property (JavaScript) - MDN Web Docs Glossary: Definitions of Web-related terms
note that when we say that "a property holds an object", that is shorthand for "a property holds an object reference".
RTL (Right to Left) - MDN Web Docs Glossary: Definitions of Web-related terms
arabic (ar) is another common language written rtl.
Speculative parsing - MDN Web Docs Glossary: Definitions of Web-related terms
note that writing balanced tags may cause other tags to be inferred in a way that makes the write unbalanced.
User agent - MDN Web Docs Glossary: Definitions of Web-related terms
besides a browser, a user agent could be a bot scraping webpages, a download manager, or another app accessing the web.
Viewport - MDN Web Docs Glossary: Definitions of Web-related terms
content outside the viewport is not visible onscreen until scrolled into view.
About Scriptable Interfaces - Interfaces
status of this document this is just a starter document, it should not be considered complete.
Test your skills: HTML accessibility - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
A cool-looking box - Learn web development
note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page.
Test your skills: The Cascade - Learn web development
note: you can try out solutions in the interactive editors below, however, it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
Test your skills: The Box Model - Learn web development
note: you can try out solutions in the interactive editors below, however, it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
Test your skills: Selectors - Learn web development
note: you can try out solutions in the interactive editors below, however, it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
Test your skills: values and units - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
Test your skills: Writing Modes and Logical Properties - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
Test your skills: floats - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
Test your skills: Multicol - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
Test your skills: position - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
Test your skills: Media Queries and Responsive Design - Learn web development
note: due to the need to test your design in multiple screen sizes we do not have an interactive editor for this task.
CSS first steps - Learn web development
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
Styling text - Learn web development
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin, codepen or glitch.
Test your skills: Basic controls - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
Test your skills: Form structure - Learn web development
note: you can try out the solution in the interactive editor below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
Test your skills: HTML5 controls - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
Test your skills: Other controls - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
Test your skills: Styling basics - Learn web development
note: you can try out solutions by editing the starting point file 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.
Test your skills: Advanced HTML text - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
Test your skills: HTML text basics - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
Test your skills: Multimedia and embedding - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
Assessment: Structuring planet data - Learn web development
note: alternatively, you could use a site like jsbin or glitch to do your assessment.
HTML Tables - Learn web development
LearnHTMLTables
note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
How to contribute to the Learning Area on MDN - Learn web development
it may see periodical improvements or updates, and may eventually even be cleaned up (and de-archived) for better uxp focus, but for now, it's a historical snapshot for reference, not a living website.
HTML performance features - Learn web development
complications can occur when, for example, the file size of a <video> embed is too large, or when a webpage is not optimized for mobile devices.
Server-side website programming first steps - Learn web development
note: this topic deals with server-side frameworks, and how to use them to create websites.
Tools and testing - Learn web development
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.
Web APIs: Mozilla-specific documents
this includes notes about any firefox-only features, or about any experiments or other deviations from the specification that may exist in mozilla code.
CSUN Firefox Materials
the two companies anticipate that in 2007, firefox will support topnotch screen reader accessibility on unix and linux.
Information for Governments and Other Organizations Evaluating Mozilla
mozilla's w3c user agent guidelines evaluation report w3c's wai is advancing another important set of accessibility standards called uaag.
Accessibility and Mozilla
the uaag is not the basis for any government accessibility regulations at this time.multiprocess on windowsa high-level overview of the ideas behind the a11y+e10s design is available on the wiki.software accessibility: where are we today?the accessibility of computer software has seen drastic improvements over the past two decades.
Frequently Asked Questions for Lightweight themes
the theme you upload may not exceed 300 kb for the header or the footer image.
Obsolete
creating a skin for firefox uuid contents.rdf install.rdf theme changes in firefox 2 theme changes in firefox 3 theme changes in firefox 3.5 theme changes in firefox 4 building a theme common theme issues and their solutions making sure your theme works with rtl locales creating a skin for seamonkey 2 dom inspector inspectorwidget force rtl yet another theme tutorial ...
Add-ons
you are not required to list your add-on on amo, but your add-on must be signed by mozilla else users will not be able to install it.
Creating MozSearch plugins
fpcj1aaeejwvqqlpabxmh5bjjqi0gi9dtaagdbbccavlkgmq7ykczxpcqxquzhaeccj4xgml493ug21zd%2badaxh0wlm4a9mzpxjkjiiawtar5pqmalacabquulttbgccagcnnzgabbgamj5thwgvjlaaaaabjru5erkjggg%3d%3d</image> <url type="text/html" method="get" template="http://developer.mozilla.org/en/docs/special:search?search={searchterms}"/> <searchform>http://developer.mozilla.org/en/docs/special:search</searchform> </searchplugin> notice in this case that instead of using <param> to define parameters to the search engine, they're simply embedded inside the template url.
Debugging Chrome
i'm not sure which is needed.
Debugging Frame Reflow
row 0268a594 r=0 a=uc,uc c=uc,20 cnt=870 value 20 is not a whole pixel cell 0268a6c0 r=0 a=uc,uc c=uc,15 cnt=871 block 0268a764 r=0 a=uc,uc c=uc,uc cnt=872 block 0268a764 d=0,0 me=0 cell 0268a6c0 d=0,0 me=0 row 0268a594 d=uc,20 value 20 is not a whole pixel rowg 0268a02c d=uc,695 value 695 is not a whole pixel while unaligned values at the entrance of a frame refl...
Debugging OpenGL
note: you can download debug builds from mozilla taskcluster — click an appropriate platform's debug build on the left, e.g.
Gmake vs. Pymake
note that typing "python build/pymake/make.py -f client.mk" does not trigger a relative configure.
Makefiles - Best practices and suggestions
directory dependencies do not use directories as a dependency for generated targets, ever.
OS TARGET
the following list is not complete as any platform could have its own os_target.
Windows SDK versions
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.
Getting documentation updated
it may see periodical improvements or updates, and may eventually even be cleaned up (and de-archived) for better uxp focus, but for now, it's a historical snapshot for reference, not a living website.
Interface development guide
commenting idl for better documentation a guide explaining how to properly comment your interface's idl in order to ensure that not only can others understand your interface, but to ensure that the documentation here on mdc is as accurate as possible.
Working with Mozilla source code
the firefox codebase: css guidelines this document contains guidelines defining how css inside the firefox codebase should be written, it is notably relevant for firefox front-end engineers.
Index
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.
Communicating with frame scripts
script function handlemessagefromchrome(message) { var payload = message.data.details; // "some more details" } addmessagelistener("my-addon@me.org:message-from-chrome", handlemessagefromchrome); 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.
Message manager
note that none of this requires multiprocess firefox: everything described here will work with single-process firefox, so the same code will work on both variants.
Multiprocess Firefox
limitations of frame scripts practices that will not work inside frame scripts, and what to do instead.
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.
HTMLIFrameElement.getManifest()
examples var browser = document.queryselector('iframe'); browser.addeventlistener('mozbrowserloadend',function() { var request = browser.getmanifest().then(function(json) { console.log(json); }); }); specification not part of any specification.
HTMLIframeElement.removeNextPaintListener()
examples var browser = document.queryselector('iframe'); function onnextpaint() { console.log("paint has occured"); } browser.addnextpaintlistener(onnextpaint); browser.removenextpaintlistener(onnextpaint); specification not part of any specification.
HTMLIFrameElement.zoom()
MozillaGeckoChromeAPIBrowser APIzoom
examples var browser = document.queryselector('iframe'); var zoomfactor = 1; zoomin.addeventlistener('touchend',function() { zoomfactor += 0.1; browser.zoom(zoomfactor); }); zoomout.addeventlistener('touchend',function() { zoomfactor -= 0.1; browser.zoom(zoomfactor); }); specification not part of any specification.
Chrome-only API reference
MozillaGeckoChromeAPI
note: most of the apis exposed to the web in general are also usable in chrome code: see web apis for a list of these.
CSS -moz-bool-pref() @supports function
</div> css @supports -moz-bool-pref("test") { #pref-test { background: green; } } @supports not -moz-bool-pref("test") { #pref-test { background: red; } } result ...
Chrome-only Events reference
mozbeforepaintgecko 2.0 adds a new method for performing javascript controlled animations that synchronize not only with one another, but also with css transitions and smil animations being performed within the same window.mozscrolledareachangedthe mozscrolledareachanged event is fired when the document view has been scrolled or resized.
Roll your own browser: An embedding how-to
you should not need to, and should not, use embedding/config.
Gecko versions and application versions
note that after gecko 2.0, both firefox and thunderbird versions are from then on the same as the gecko version number, at gecko 5.0.
Gecko
documentation chrome this page contains information specific to browser chrome (not google chrome) code running in gecko.
Hacking with Bonsai
they are doing a not-so-fun job, so treat them with respect.
How to get a process dump with Windows Task Manager
creating the dump file ensure that firefox is not already running.
AddonType
if undefined the type will not appear in the ui.
InstallListener
installlisteners are notified of an addoninstall's progress.
TypeListener
typelisteners can be registered with addtypelistener() and will then receive notification as addontype are registered and unregistered.
UpdateInfo
updateinfourl string a url containing simple release notes for the update.
API-provided widgets
if you're in an add-on, you should not set this property, and should instead include the shortcut as part of the tooltiptext you pass in yourself.
DownloadLastDir.jsm
however, when private browsing mode is enabled, the last download directory path is instead maintained in memory, and the preference is not changed.
DownloadSource
referrer read only string referrer uri of the download source, or null if no referrer should be sent or the download source is not http.
Geometry.jsm
note: although this module is usable from mobile, and is present in firefox 4, it's currently not used in firefox 4 and attempting to use it may produce unreliable results there.
Http.jsm
another example of how this can be used can be found here.
Timer.jsm
the timer.jsm javascript code module contains pure-javascript implementations of settimeout, cleartimeout, setinterval, and clearinterval that are compatible with the dom window functions, but that can be used by code that does not have access to a dom window (for example, javascript code modules or content frame scripts).
Using workers in JavaScript code modules
note: as of gecko 8.0, the nsiworkerfactory interface has been removed starting in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), you can use workers in javascript code modules (jsms).
WebChannel.jsm
note that in addition to the permission manager check, the request must be made over https.
Encodings for localization files
this is tricky to hook up in the build process, so here it goes: file encoding notes toolkit/installer/windows/charset.mk ascii the win_installer_charset variable must be set to an encoding which matches toolkit/installer/windows/install.it charset= parameter.
Localizing with Pontoon
note that for our purposes here, we'll be using firefox affiliates website to demo pontoon's functionality and workflow.
Patching a Localization
if you do not have these tools, take a few steps back, grab a cookie (because, let's face it, you deserve it for all of your work), and visit the l10n prerequisites page.
Localization at Mozilla
localization (l10n) is the process of translating software user interfaces from one language to another and adapting it to suit a foreign culture.
Test
if not, please consider installing some mathml fonts.
MathML Torture Test
></mrow><mi>&#x1ee1d;</mi></msup></mrow><mo>=</mo><mn>1</mn></math></td> <td><math dir="rtl" display="block" xmlns="http://www.w3.org/1998/math/mathml"><mrow><munder><mo lspace="0em" rspace="0em" mathcolor="red">lim</mo><mrow><mi>&#x1ee1d;</mi><mo stretchy="false">←</mo><mo>+</mo><mn>∞</mn></mrow></munder><mfrac><msqrt><mrow><mn>٢</mn><mi>π</mi><mi>&#x1ee1d;</mi></mrow></msqrt><menclose notation="madruwb"><mi>&#x1ee1d;</mi></menclose></mfrac><msup><mrow><mo>(</mo><mfrac><mi>&#x1ee1d;</mi><mi>e</mi></mfrac><mo>)</mo></mrow><mi>&#x1ee1d;</mi></msup></mrow><mo>=</mo><mn>1</mn></math></td> <td><math display="block" xmlns="http://www.w3.org/1998/math/mathml"><mrow><munder><mo lspace="0em" rspace="0em">&#x1eef1;</mo><mrow><mi>n</mi><mo stretchy="false">→</mo><mo>+</mo><mn>∞</mn></...
Mozilla external string guide
the mozilla codebase used to have a notion of "external" strings, which were the string classes visible to code outside of the mozilla codebase (extensions, xulrunner applications, and embedders).
Mozilla Style System
they all have names beginning with nsstyle*, and they should not be confused with the css structs (nscss*), which hold specified values.
Build Metrics
due to the way the build system works, compiler warnings are not consistently detected.
dtrace
note: the power profiling overview is worth reading at this point if you haven't already.
turbostat
note: the power profiling overview is worth reading at this point if you haven't already.
accessibility.tabfocus
note: on mac os x, if this preference is not set, the full keyboard access setting in system preferences > keyboard is honored.
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.
javascript.options.showInConsole
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.
javascript.options.strict
example : <html> <head> <title>sample</title> </head> <body> <label id="name">enter you first name</label> <p id ="sample"></p> <script> "use strict" name1= "john" ; // this will cause and an error as variable not declared .
nglayout.debug.disable xul fastload
the preference nglayout.debug.disable_xul_fastload controls whether or not xul fastload is used.
ui.SpellCheckerUnderline
ui.spellcheckerunderline holds the colour which is used to underline words not recognized by the spellchecker.
ui.SpellCheckerUnderlineStyle
ui.spellcheckerunderlinestyle holds the style which is used to underline words not recognized by the spellchecker.
Preferences
this api is not available for add-ons, but if you're working on a gecko application, this api is the preferred way to access preferences.
Patches and pushes
note that if your team selects a local version of an already default plugin (e.g., wikipedia), the xml filename should include the locale code (e.g., wikipedia-es).
Research and prep
your selections for default rss readers and content handlers should follow these guidelines: be translated in your language (because it makes the application unusable if it's not in your language provide for the intended user experience (e.g., minimal to no advertisements within the user experience) no more than three (if possible) choices.
Productization guide
another example: when the user clicks on a mailto: link, we suggest a couple of possible handlers chosen from the applications installed on their computer.
L20n Javascript API
this array (with defaultlocale appended to it if it is not already present) will be used to negotiate the fallback chain for the user.
Leak Monitor
it will pop-up an alert when a window is closed and javascript still links to that window (for example, an observer that is not cleared when the window closes).
Creating a Cookie Log
run firefox by typing "./firefox-bin" and pressing return (note that firefox will launch behind windows for other applications).
NSPR build instructions
these two options can actually be used independently, but it's not recommended.
NSPR release procedure
note: for nss, the script equivalent to nspr's repackage.sh is /u/robobld/bin/sbsinit/nss/push/buildbindist.sh in the "svbuild" source tree.
Process Forking in NSPR
nspr does not override the fork function and so, when fork is called from the nspr thread the results are different on the various platforms.
Floating Point Number to String Conversion
they use ieee double-precision (not ieee double-extended) arithmetic.
Hash Tables
warning: the nspr hash table library functions are not thread safe.
IPC Semaphores
note: see also named shared memory ipc semaphore functions ipc semaphore functions pr_opensemaphore pr_waitsemaphore pr_postsemaphore pr_closesemaphore pr_deletesemaphore ...
I/O Types
prfiledesc priomethods prfileprivate prdescidentity note that the nspr documentation follows the unix convention of using the termfiles to refer to many kinds of i/o objects.
Linked Lists
the macros are not thread safe.
Memory Management Operations
(note that the argument type size_t is replaced by pruint32.) memory allocated by pr_malloc(), pr_calloc(), or pr_realloc() must be freed by pr_free().
NSPR LOG FILE
if nspr_log_file is not in the environment, then log output is written to stdout or stderr, depending on the platform.
NSPR Types
since the types (long long versus struct longlong) are not type compatible, nspr defines macros to manipulate 64-bit numeric fields.
PLHashComparator
it returns a nonzero value if the two values are equal, and 0 if the two values are not equal.
PLHashEntry
these fields are for use by the hash table library functions and the user should not tamper with them.
PL_CompareStrings
if the two strings are not equal, it returns 0.
PL_HashTableLookup
this means that one cannot tell whether a null return value means the entry does not exist or the value of the entry is null.
PL_strcpy
description if the string specified by src is longer than the buffer specified by dest, the buffer will not be null-terminated.
PL_strdup
notes the memory allocated by pl_strdup should be freed with pl_strfree.
PL_strlen
returns the length of a specified string (not including the trailing '\0') syntax pruint32 pl_strlen(const char *str); parameter the function has these parameter: str size in bytes of item to be allocated.
PRBool
syntax #include <prtypes.h> typedef enum { pr_false = 0, pr_true = 1 } prbool; description wherever possible, do not use prbool in mozilla c++ code.
PRExplodedTime
note that it starts from 1 as opposed to 0.
PRHostEnt
note winsock.h defines h_addrtype and h_length as a 16-bit field, whereas other platforms treat it as a 32-bit field.
PRLock
functions that operate on locks do not have timeouts and are not interruptible.
PRLogModuleLevel
syntax #include <prlog.h> typedef enum prlogmodulelevel { pr_log_none = 0, pr_log_always = 1, pr_log_error = 2, pr_log_warning = 3, pr_log_debug = 4, pr_log_notice = pr_log_debug, pr_log_warn = pr_log_warning, pr_log_min = pr_log_debug, pr_log_max = pr_log_debug } prlogmodulelevel; ...
PRSize
a type for representing the size of an object (not the size of a pointer).
PRThreadPrivateDTOR
if the data associated with the index is not null, nspr passes a reference to the data to the destructor function when the thread terminates.
PRThreadType
this arrangement implies that a system thread should not have volatile data that needs to be safely stored away.
PRUint64
notes note: prior to gecko 12.0, pruint64 was actually treated as a signed 64-bit integer by xpconnect.
PR_Access
if the requested access is not permitted, pr_failure.
PR_Available
pr_available does not work with pipes on win32 platforms.
PR_Available64
pr_available does not work with pipes on win32 platforms.
PR_CALLBACK
syntax #include <prtypes.h>type pr_callbackimplementation description functions that are implemented in an application (or shared library) that are intended to be called from another shared library (such as nspr) must be declared with the pr_callback attribute.
PR_CExitMonitor
this may indicate that the address parameter is invalid or that the calling thread is not in the monitor.
PR_Cleanup
if the calling thread of this function is not the primordial thread, pr_failure.
PR_ClearInterrupt
for example, the target thread may reach the agreed-on control point without providing an opportunity for the runtime to notify the thread of the interrupt request.
PR_Close
if the file descriptor is not closed successfully, pr_failure.
PR_CloseDir
note that after a pr_closedir call, any prdirentry object returned by a previous pr_readdir call on the same prdir object becomes invalid.
PR_CloseFileMap
if the memory region is not successfully unmapped, pr_failure.
PR_Connect
if the socket is not bound, it will be bound to an arbitrary local address.
PR_ConnectContinue
if pr_connectcontinue() returns pr_failure, call pr_geterror(): - pr_in_progress_error: the nonblocking connect is still in progress and has not completed yet.
PR_CreatePipe
if the pipe is not successfully created, pr_failure.
PR_DELETE
returns nothing.
PR_Delete
if the file is not deleted, pr_failure.
PR_DestroyLock
locks do not provide self-referential protection against deletion.
PR_EXTERN
warning: some platforms do not allow the use of the underscore character (_) as the first character of an exported symbol.
PR_EnterMonitor
if the entry count is greater than zero and the calling thread is not recognized as the holder of the lock, the thread is blocked until the entry count reaches zero.
PR_ExitMonitor
if unsuccessful (the calling thread has not entered the monitor), pr_failure.
PR_ExplodeTime
returns nothing; the buffer pointed to by exploded is filled with the exploded time.
PR_FindSymbol
the runtime does nothing to ensure the continued validity of the symbol.
PR_Free
returns nothing.
PR_FreeLibraryName
returns nothing.
PR_GMTParameters
note: since this function requires gmt as input, its primary use is as "filler" for cases in which you need a do-nothing callback.
PR_GetConnectStatus
if pr_geterror returns pr_in_progress_error, the nonblocking connection is still in progress and has not completed yet.other errors indicate that the connection has failed.
PR_GetCurrentThread
note: this is the only safe way to establish the identity of a thread.
PR_GetDefaultIOMethods
you may not modify the default i/o methods table directly.
PR_GetFileInfo
if the file information is not successfully obtained, pr_failure.
PR_GetFileInfo64
if the file information is not successfully obtained, pr_failure.
PR_GetIdentitiesLayer
if not successful, null.
PR_GetInheritedFileMap
note: this function is not implemented.
PR_GetLibraryPath
if sufficient storage cannot be allocated to contain the copy, the function returns null.
PR_GetOSError
for portability, clients should not create dependencies on the values of os-specific error codes.
PR_GetSpecialFD
description type prspecialfd is defined as follows: typedef enum prspecialfd{ pr_standardinput, pr_standardoutput, pr_standarderror } prspecialfd; #define pr_stdin pr_getspecialfd(pr_standardinput) #define pr_stdout pr_getspecialfd(pr_standardoutput) #define pr_stderr pr_getspecialfd(pr_standarderror) file descriptors returned by pr_getspecialfd are owned by the runtime and should not be closed by the caller.
PR_GetUniqueIdentity
if the function cannot allocate enough dynamic memory, it fails and returns the value pr_invalid_io_layer with the error code pr_out_of_memory_error.
PR_IMPLEMENT
warning: some platforms do not allow the use of the underscore character (_) as the first character of an exported symbol.
PR_INSERT_AFTER
inserts an element after another element in a circular list.
PR_INSERT_BEFORE
inserts an element before another element in a circular list.
PR_Initialize
pr_initialize does not return to its caller until all user threads have terminated.
PR_Initialized
if pr_init has not already been called, pr_false.
PR_IntervalToMicroseconds
description conversion may cause overflow, which is not reported.
PR_IntervalToMilliseconds
description conversion may cause overflow, which is not reported.
PR_IntervalToSeconds
description conversion may cause overflow, which is not reported.
PR_LOG_TEST
possible values are: pr_log_none = 0 pr_log_always = 1 pr_log_error = 2 pr_log_warning = 3 pr_log_debug = 4 pr_log_notice = pr_log_debug pr_log_warn = pr_log_warning pr_log_min = pr_log_debug pr_log_max = pr_log_debug returns pr_true when logging is enabled for the given module and level, otherwise pr_false.
PR_LogFlush
returns nothing description this function flushes the log buffer to external media.
PR_LogPrint
returns nothing description this function unconditionally writes a message to the log using the specified format string.
PR_NEXT_LINK
the following element is not removed from the list.
PR_NewLock
if unsuccessful (for example, the lock cannot be created because of resource constraints), null.
PR NewProcessAttr
the new prprocessattr structure is initialized with these default attributes: the standard i/o streams (standard input, standard output, and standard error) are not redirected.
PR_NewThreadPrivateIndex
if a destructor function is registered with a new index, it will be called at one of two times, as long as the private data is not null: when replacement private data is set with pr_setthreadprivate when a thread exits the index maintains independent data values for each binding thread.
PR_OpenDir
if the directory cannot be opened, the function returns null.
PR_PREV_LINK
the preceding element is not removed from the list.
PR_ProcessAttrSetInheritableFileMap
note: this function is not implemented.
PR_QueueJob
if pr_false, the job is not joinable.
PR_QueueJob_Accept
if pr_false, the job is not joinable.
PR_QueueJob_Connect
if pr_false, the job is not joinable.
PR_QueueJob_Read
if pr_false, the job is not joinable.
PR_QueueJob_Timer
if pr_false, the job is not joinable.
PR_QueueJob_Write
if pr_false, the job is not joinable.
PR_RecvFrom
description pr_recvfrom receives up to a specified number of bytes from socket, which may or may not be connected.
PR_RmDir
if the directory is not empty, pr_rmdir fails and pr_geterror returns the error code pr_directory_not_empty_error.
PR_SetError
description nspr does not validate the value of the error number or os error number being specified.
PR_SetIPv6Enable
this function was removed in nspr 4.0 and does not exist any more.
PR_SetLogFile
ordinarily, a user application need not use this function, as nspr initializes logging at nspr startup.
PR_ShutdownThreadPool
notifies all threads in a thread pool to terminate.
PR_Sleep
if ticks is not pr_interval_no_wait, pr_sleep uses an existing lock, but has to create a new condition for this purpose.
PR_TicksPerSecond
this value is platform-dependent and does not change after nspr is initialized.
PR_Unlock
if unsuccessful (for example, if the caller does not own the lock), pr_failure.
PR_Unmap
if the memory region is not successfully unmapped, pr_failure.
PR_VersionCheck
if the versions are not compatible, pr_false.
PR_Write
note that if pr_write returns -1, some data (less than amount bytes) may have been written before an error occurred.
Random Number Generator
random number generator function pr_getrandomnoise - produces a random value for use as a seed value for another random number generator.
Thread Pools
note: this api is a preliminary version in nspr 4.0 and is subject to change.
NSPR release process
upload a source tar file to https://ftp.mozilla.org/pub/mozilla....nspr/releases/ write the release notes.
Deprecated SSL functions
the deprecated functions are not supported by the new ssl shared libraries.
Build instructions for JSS 4.3.x
note, on windows platforms it is best to have java_home set to a directory path that doest not have spaces.
NSS Config Options
future key words (not yet implemented): enable: turn on ciphersuites by default.
NSS Sample Code Sample_2_Initialization of NSS
getpassword(input, output, "enter new password: ", checkpassword); if (p1) port_free(p1); p1 = getpassword(input, output, "re-enter password: ", checkpassword); if (p0 && p1 && !port_strcmp(p0, p1)) { break; } pr_fprintf(pr_stderr, "passwords do not match.
NSS Sample Code Utilities_1
haracters long with one or more\n"); 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.
NSS Sample Code sample5
* * there is no attempt to link the public & private key together * * this example does not do any padding.
NSS Sample Code sample6
*/ if (slot == null) { fprintf(stderr, "unable to find security device (err %d)\n", pr_geterror()); return; } keyid[0] = id; keyiditem.type = sibuffer; keyiditem.data = (void *)keyid; keyiditem.len = sizeof(keyid[0]); /* note: keysize must be 0 for fixed key-length algorithms like des.
Initialize NSS database - sample 2
getpassword(input, output, "enter new password: ", checkpassword); if (p1) port_free(p1); p1 = getpassword(input, output, "re-enter password: ", checkpassword); if (p0 && p1 && !port_strcmp(p0, p1)) { break; } pr_fprintf(pr_stderr, "passwords do not match.
NSS Third-Party Code
note that not all code that can be compiled into the nss libraries necessarily is.
Installation guide
nspr: libnspr4.so libplds4.so libplc4.so nss: (note the use of * for libfreebl -- some platforms have multiple ones) libfreebl*3.so libfreebl*3.chk libsoftokn3.so libsoftokn3.chk libnss3.so libsmime3.so libssl3.so libnssckbi.so ...
Migration to HG
however, below is a brief summary that shows how to checkout the source code and build both nspr and nss: mkdir workarea cd workarea hg clone https://hg.mozilla.org/projects/nspr hg clone https://hg.mozilla.org/projects/nss cd nss # set use_64=1 on 64 bit architectures # set build_opt=1 to get an optimized build make nss_build_all note that the jss project has been given a private copy of the former mozilla/security/coreconf directory, allowing it to remain stable, and only update its build system as necessary.
FC_CloseAllSessions
the nss cryptographic module currently doesn't call the surrender callback function notify.
FC_SeedRandom
note that fc_seedrandom() doesn't provide the initial seed material for the random number generator.
NSPR functions
the ssl library in nss implements the ssl protocol as an nspr i/o layer, which sits on top of another nspr i/o layer that represents tcp.
NSS tools : vfychain
possible types are "donotuse", "forbidfetching", "ignoredefaultsrc", "requireinfo" and "failifnoinfo".
troubleshoot.html
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.
NSS tools : vfychain
possible types are "donotuse", "forbidfetching", "ignoredefaultsrc", "requireinfo" and "failifnoinfo".
Network Security Services
nss api guidelines explains how the libraries and code are organized, and guidelines for developing code (naming conventions, error handling, thread safety, etc.) nss technical notes links to nss technical notes, which provide latest information about new nss features and supplementary documentation for advanced topics in programming with nss.
Necko Interfaces Overview
http) maps uri string to nsiuri instance via newuri method creates nsichannel instance from nsiuri instance via newchannel method nsistreamlistener : nsirequestobserver implemented by the consumer of a nsichannel instance passed to nsichannel::asyncopen method nsirequestobserver::onstartrequest - notifies start of async download nsistreamlistener::ondataavailable - notifies presence of downloaded data nsirequestobserver::onstoprequest - notifies completion of async download, possibly w/ error nsiloadgroup : nsirequest attribute of a nsirequest channel impl adds itself to its load group during invocation of asyncopen channel impl removes itself from its load group when download complet...
Personal Security Manager (PSM)
notes: psm always builds with firefox now, so there aren't separate build instructions.
Pork Tool Development
notes the #static channel on irc.mozilla.org is for discussion of pork, dehydra, and other static analysis tools.
Pork Tools
then nuke the declaration // nsresult rv; // move outparam to lhs var = getter(); // detect ns_ensure_success immediately following // and change it to an equivalent ns_ensure_true ns_ensure_true(var, ns_error_failure); // case 2 var = getter(); // case 3, eliminate rv2 decl given that it's not used elsewhere var = getter(); ns_ensure_true(var, ns_error_failure) } outparamdel also support rewriting getters such that they return already_addrefed<nsifoo>.
Pork
note: pork is not presently used at mozilla.
Rhino community
note that rhino has its own product category.
Rhino Debugger
note that this debugger will not work with javascript scripts run in the mozilla browser since rhino is not the engine used in such environments.
Rhino FAQ
rhino is a library for java use, and not for general web browsers.
Rhino requirements and limitations
gnments: javaobj.fieldandmethod = 5; var field = javaobj.fieldandmethod; javaobj.fieldandmethod = 7; // now, field == 7 you can work around this by forcing the field value to be converted to a javascript type when you take its value: javaobj.fieldandmethod = 5; var field = javaobj.fieldandmethod + 0; // force conversion now javaobj.fieldandmethod = 7; // now, field == 5 jsobject rhino does not support the netscape.javascript.jsobject class.
SpiderMonkey compartments
an object in one compartment cannot touch an object in another compartment, except through a cross-compartment wrapper.
Getting SpiderMonkey source code
getting older spidermonkey sources from cvs note: you will need to explicitly fetch the javascript shell sources even if you currently build another mozilla project, as there are files specific to the shell that are not normally found in a mozilla source tree.
Bytecodes
bytecode listing all opcodes are annotated with a [-popcount, +pushcount] to represent the overall stack-effects their execution.
INT_FITS_IN_JSVAL
warning: the type of the argument i must be jsint, but the c/c++ compiler does not enforce type safety here.
JS::CloneFunctionObject
if the class of funobj is not function, then js::clonefunctionobject returns funobj itself.
JS::CompileOffThread
if maybecx is not specified, the resources will be freed, but no script will be returned.
JS::CurrentGlobalOrNull
note that js_getglobalobject() and context globals are becoming obsolete.
JS::DeflateStringToUTF8Buffer
does not write the null terminator.
JS::Evaluate
on success, if rval is not null, *rval receives the result value.
JS::GetDeflatedUTF8StringLength
the returned length does not include the null-terminator.
JS::Handle
second, if the caller does not pass a rooted value a compile error will be generated, which is quicker and easier to fix than when relying on a separate rooting analysis.
JS::OrdinaryToPrimitive
most users should not call this -- use js::tonumber, js::toboolean, or js::tostring instead.
JS::ToBoolean
it implements the toboolean operation described in ecma 262 §7.1.2.this function can not fail and the return value is always the boolean conversion of the argument.
JS::ToPrimitive
do not pass any other type.
JSBool
these values must not be used as jsvals.
JSConstDoubleSpec
jsprop_permanent: property cannot be deleted.
JSExtendedClass
if non-null, an object of this class may serve as a wrapper for another object.
JSFUN_BOUND_METHOD
future versions of the javascript engine may not support or recognize this macro.
JSFUN_GLOBAL_PARENT
this macro is not provided in any stable spidermonkey releases.
JSFreeOp
description various finalization api takes not jscontext * but rather either jsfreeop structure or its library-private counterpart freeop.
JSFunctionSpec
if the function does not wrap a native js call, set this value to null.
JSID_IS_INT
int_fits_in_jsid tests whether a specified integer fits in jsid, it means the integer value is not negative.
JSIteratorOp
keysonly jsbool if true, the iterator should yield keys only, not [key, value] pairs.
JSNewEnumerateOp
(spidermonkey, noting the jsclass_new_enumerate flag, will cast that function pointer back to type jsnewenumerateop before calling it.) the behavior depends on the value of enum_op: jsenumerate_init a new, opaque iterator state should be allocated and stored in *statep.
JSObjectOp
jsobjectop is the type of several jsapi callbacks that map an object to another object, or null if an error or exception occurred.
JSPropertySpec
this value should be zero if you are not using tinyids (i.e.
JSRuntime
earlier versions allowed using js_clearcontextthread and other functions to move a jscontext from one thread to another.
JSString
you should not rely on the structure of jsstring, because it is subject to change; instead, treat jsstring objects as opaque.
JSTraceOp
it must not change state of the object or corresponding native structures.
JSVAL_IS_NULL
(note: jsval_is_object(jsval_null) is also true.) example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if statement to see if it contains a null value.
JSVAL_LOCK
if locking is successful, or v already cannot be garbage collected because it is not an object, string, or double value, jsval_lock evaluates to true.
JSVAL_TO_DOUBLE
this function is not type-safe: if v is an integer, string, null, or anything else, the behavior is undefined.
JSVAL_TO_STRING
this function is not type-safe: if v is not a string, the behavior is undefined.
JSVAL_UNLOCK
if unlocking is successful, or v not affected by garbage collection because it is not an object, string, or double value, jsval_unlock evaluates to true.
JS_AddArgumentFormatter
(at the moment, js_addargumentformatter fails only if there is no memory available to record the registration.) js_addargumentformatter does not copy format, it points at the string storage allocated by the caller, which is typically a string constant.
JS_BindCallable
if callable is not callable, will throw and return nullptr.
JS_CheckAccess
jsacc_write when bitwise-ored with one of the above values, check for permission to write the property, not read it.
JS_ClearNewbornRoots
description the last gc thing of each type (object, string, double, external string types) created on a given context is kept alive until another thing of the same type is created, using a newborn root in the context.
JS_ClearNonGlobalObject
properties belonging to objects on obj's prototype chain are not affected.
JS_ClearScope
properties belonging to objects on obj's prototype chain are not affected.
JS_CloneFunctionObject
if the class of funobj is not function, then js_clonefunctionobject returns funobj itself.
JS_CompileUTF8FileHandle
js_compileutf8filehandle does not close the file handle.
JS_ConvertValue
converting to jstype_function works like js_valuetofunction, but better: the result is a function object that has not been stripped of its lexical scope.
JS_DeepFreezeObject
this will not recurse through non-extensible objects, on the assumption that those are already deep-frozen.
JS_DefineElement
while you can assign a setproperty method to a property and set flags to jsprop_readonly, the setter method will not be called on this property.
JS_DefineFunctions
syntax bool js_definefunctions(jscontext *cx, js::handle<jsobject*> obj, const jsfunctionspec *fs, propertydefinitionbehavior behavior = defineallproperties); in spidermonkey versions prior to spidermonkey 24, fs was not const.
JS_DefineOwnProperty
it is not possible to change a non-configurable property).
JS_DefineProperties
in spidermonkey versions prior to spidermonkey 24, the last argument to js_definepropeties was not const.
JS_DeleteElement
if an object references an element belonging to a prototype, the element reference is removed from the object, but the prototype's element is not deleted.
JS_DestroyScript
the script must not be currently executing (in any context, at any level of the stack) and must not be used again afterwards.
JS_DoubleIsInt32
we should definitely fix this (bug 744965), but as apparently it "works" in practice, it's not a pressing concern now.
JS_EncodeString
note that for non-ascii strings, if js_cstringsareutf8 is false, these functions can return a corrupted copy of the contents of the string.
JS_EnterCompartment
this article covers features introduced in spidermonkey 24 note: the preferred way of changing a context's current compartment is using jsautocompartment.
JS_EnumerateStandardClasses
description the global object's class's enumerate op should call js_enumeratestandardclasses(cx, obj), to define eagerly during for...in loops any classes not yet resolved lazily.
JS_EvaluateScript
on success, if rval is not null, *rval receives the result value.
JS_FileEscapedString
if quote is not 0, it must be a single or double quote character that will quote the output.
JS_FlattenString
note: the input and output of js_flattenstring() are the same actual gc-thing so only one needs to be rooted.
JS_FlushCaches
the operation might be delayed if the cache cannot be flushed currently because native code is currently executing.
JS_FreezeObject
this means that other code cannot delete, add or change any properties on the object.
JS_GetArrayPrototype
note: this expression might have different values over time if the global array property is modified, but this method returns only the original value.
JS_GetClass
newer versions have removed the context argument, so that the same signature is used regardless whether or not the build is thread-safe.
JS_GetContextThread
if the context is not currently associated with any thread, the return value is 0.
JS_GetElement
if not, it sets *vp to undefined and returns true (to indicate no error occurred).
JS_GetFunctionCallback
note: this method is only available if moz_trace_jscalls was defined at compile time using --enable-trace-jscalls.
JS_GetFunctionFlags
once a function is created, its flags cannot be modified.
JS_GetFunctionName
the return value is either the name of a function, or the string "anonymous", which indicates that the function was not assigned a name when created.
JS_GetFunctionPrototype
note: this expression might have different values over time if the global function property is modified, but this method returns only the original value.
JS_GetGCParameter
this does not affect generational gc, see jsgc_max_nursery_bytes jsgc_unused_chunks / "unusedchunks" number of cached empty gc chunks.
JS_GetGlobalForScopeChain
note that js_getglobalobject() and context globals are becoming obsolete.
JS_GetGlobalObject
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!
JS_GetLocaleCallbacks
callback functions struct jslocalecallbacks { jslocaletouppercase localetouppercase; jslocaletolowercase localetolowercase; jslocalecompare localecompare; // not used #if expose_intl_api jslocaletounicode localetounicode; }; typedef bool (* jslocaletouppercase)(jscontext *cx, js::handlestring src, js::mutablehandlevalue rval); typedef bool (* jslocaletolowercase)(jscontext *cx, js::handlestring src, js::mutablehandlevalue rval); typedef bool (* jslocalecompare)(jscontext *cx, js::handlestring src1, js::handlestring src2, j...
JS_GetObjectPrototype
note: this expression might have different values over time if the global object property is modified, but this method returns only the original value.
JS_GetOwnPropertyDescriptor
if desc->obj is null, then this property was not found on the prototype chain.
JS_GetPendingException
description if an exception has been thrown in the context cx, and it has not yet been caught or cleared, js_getpendingexception stores the exception object in *vp and returns true.
JS_GetPrivate
if the object is not of the expected jsclass, the result of js_getprivate would probably be null or a pointer to some unexpected type of data.
JS_GetPropertyDefault
def js::handlevalue default value if the property is not found.
JS_GetPropertyDescriptor
if desc->obj is null, then this property was not found on the prototype chain.
JS_GetStringCharAt
index should not be greater than or equal to the length of str.
JS_HasArrayLength
this function differs from js_getarraylength in the treatment of errors and unusual cases, like when an object's length is negative or not a number.
JS_HasElement
if not, it sets *foundp to false and returns true (to indicate no error occurred).
JS_HasOwnProperty
on success, js_hasownproperty stores true in this variable if obj has an own property with the given name, and false if not.
JS_HasProperty
on success, js_hasproperty stores true in this variable if obj has a property with the given name, and false if not.
JS_Init
it is currently not possible to initialize spidermonkey multiple times (that is, calling js_init, jsapi methods, then js_shutdown in that order, then doing so again).
JS_InitStandardClasses
as a side effect, js_initstandardclasses establishes obj as the global object for cx, if one is not already established.
JS_IsConstructing_PossiblyWithGivenThisObject
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 embedding does not need to use this query unless the embedding uses js_constructobject(), js_initclass() and jsclass_construct_prototype as described above.
JS_IsExternalString
this article covers features introduced in spidermonkey 17 determines whether or not the specified jsstring is an external string (that is, a string created by calling js_newexternalstring rather than js_newexternalstringwithclosure).
JS_IsIdentifier
on success, *isidentifier receives whether str is an identifier or not.
JS_IsRunning
indicates whether or not a script or function is currently executing in a given context.
JS_IsStopIteration
this article covers features introduced in spidermonkey 31 determine whether the value is a stopiteration exception or not.
JS_LeaveCompartment
this article covers features introduced in spidermonkey 24 note: the preferred way of changing a context's current compartment is using jsautocompartment.
JS_LeaveLocalRootScope
that is, they are not transferred to the enclosing local root scope.
JS_LooselyEqual
comparing jsvals directly in c++, as in v1 == v2, does not produce a meaningful result, since it is possible for two distinct jsstrings or jsdoubles to represent the same string or number.
JS_MapGCRoots
the map function cannot call js_gc, js_maybegc, js_beginrequest, or any js api entry point that acquires locks, without double-tripping or deadlocking on the gc lock.
JS_New
if ctor is not an object that can be used as a constructor, a typeerror is raised.
JS_NewArrayObject
this must not be negative.
JS_NewRegExpObject
they do not or in any regexp constructor properties.
JS_NewRuntime
notes ordinarily, js_newruntime should be the first jsapi call in an application, and js_destroyruntime and js_shutdown should be the last ones.
JS_NewScriptObject
(the name "js_newscriptobject" suggests that the script object is freshly allocated; this was the case in older versions of the api, but now the script object is allocated along with the jsscript itself.) (some temporary scripts used internally by spidermonkey do not have script objects allocated for them; such scripts are not accessible via jsapi.) see also the jsapi user guide contains example code using compiled scripts.
JS_ParseJSON
various json extensions like trailing commas, unquoted property names, more generous number parsing, and so on are not supported.
JS_RemoveExternalStringFinalizer
description remove finalizer from the global gc finalizers table, returning its type code if found, -1 if not found.
JS_RemoveRootRT
do not pass a pointer to a js double, string, or object -- you must pass a pointer to a pointer or a pointer to a jsval that's a gc thing.
JS_ReportErrorNumber
the error reporter is not called yet, because the script still has an opportunity to catch and handle the exception.
JS_ReportPendingException
note that certain jsapi functions automatically do this for uncaught exceptions; see "automatic handling of uncaught exceptions" in the jsapi user guide.
JS_SET_TRACING_DETAILS
when printer is not null, the arg and index arguments are available to the callback as the debugprinterarg and debugprintindex fields of trc.
JS_SameValue
samevalue slightly differs from strict equality (===) in that +0 and -0 are not the same and in that nan is the same as nan.
JS_SaveExceptionState
this function returns null if the engine was not built with support for exceptions.
JS_SaveFrameChain
js_saveframechain deals with cx not having any code running on it.
JS_SetDefaultLocale
note that the internationalization api encourages clients to specify their own locales.
JS_SetProperty
otherwise, if the lookup found a read-only property or obj non-extensible, nothing happens, but this is not an error.
JS_SetScriptStackQuota
these structures also consume heap space, so js_setthreadstacklimit does not bound their size.
JS_SetThreadStackLimit
in a js_threadsafe build, after passing a jscontext from one thread to another, call js_setthreadstacklimit(cx, 0) after calling js_setcontextthread.
JS_StrictlyEqual
comparing jsvals directly in c++, as in v1 == v2, does not produce a meaningful result, since it is possible for two distinct jsstrings or jsdoubles to represent the same string or number.
JS_ValueToECMAInt32
this second conversion cannot fail.
JS_ValueToId
if v is not a string, it is converted to a string as if by calling js_valuetostring.
JS_ValueToNumber
if the string is not a numeric string, *dp is set to nan.
JS_ValueToString
otherwise the result is a decimal representation of the number, possibly using exponential notation.
PRIVATE_TO_JSVAL
private data is not garbage collected.
jschar
a string may contain unmatched surrogates, which are not valid utf-16.
jsint
uintn; // following types are still provides in js/public/legacyinttypes.h, // but should not use them.
JSDBGAPI
hpoint js_clearwatchpoint js_clearwatchpointsforobject js_clearallwatchpoints inspecting the stack js_pctolinenumber js_linenumbertopc js_getfunctionscript js_getfunctionnative js_getfunctionfastnative js_getscriptprincipals typedef jsstackframe js_frameiterator js_getframescript js_getframepc js_getscriptedcaller js_stackframeprincipals js_evalframeprincipals js_getframeannotation js_setframeannotation js_getframeprincipalarray js_isnativeframe js_getframeobject js_getframescopechain js_getframecallobject js_getframethis js_getframefunction js_getframefunctionobject js_isconstructorframe js_isdebuggerframe js_getframereturnvalue js_setframereturnvalue js_getframecalleeobject js_getscriptfilename js_getscriptbaselinenumber js_getscriptlineextent ...
SpiderMonkey 52
these release notes are incomplete.
SpiderMonkey: The Mozilla JavaScript runtime
spidermonkey internals: gc separate internals article on the gc spidermonkey internals: hacking tips collection of helpful tips & tools for hacking on the engine related topics javascript foss projects using or based on spidermonkey releases spidermonkey release notes current and past versions: 52, 45, 38, 31, 24, 17 community mailing list spidermonkey questions on stack overflow report a bug ...
TPS History Lists
ect with a host property to delete all history in a certain time period, use an object with begin and end properties, which should have integer values that express time since the present in hours (see date above) for example: var history_to_delete = [ { uri: "http://www.cnn.com/" }, { begin: -24, end: -1 }, { host: "www.google.com" } ]; history lists and phase actions history lists cannot be modified, they can only be added, deleted, and verified, using the following functions: history.add history.delete history.verify history.verifynot ...
TPS Password Lists
password lists and phase actions following are the functions that can be used in phase actions related to passwords: passwords.add passwords.delete passwords.modify passwords.verify passwords.verifynot ...
Pinning violation reports
if a site makes use of key pinning, and your browser sees a certificate chain for that site which does not match the pin, firefox will reject the connection and display an error page.
Browser security
rmine if a crash is exploitable, find crashes which are exploitable, and to fix exploitable crashes.handling mozilla security bugsthis document describes how the new security organizational structure will work, and how security-related mozilla bug reports will be handled.pinning violation reportsif a site makes use of key pinning, and your browser sees a certificate chain for that site which does not match the pin, firefox will reject the connection and display an error page.
Gecko events
event_hypertext_changed focus has changed from one hypertext object to another, or focus moved from a non-hypertext object to a hypertext object, or focus moved from a hypertext object to a non-hypertext object.
XUL Accessibility
role="grouping" id="control" /> get tooltiptext attribute value if the aria role is used and it allows to have accessible value then aria-valuetext or aria-valuenow are used if the element is xlink then value is generated from link location actions if the element is xlink then jump action is exposed if the element has registered click event handler then click action is exposed xul elements notification used to display an informative message.
DocShell
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.
Feed content access API
nsifeedresultlistener implemented by the program that wants to parse an rss or atom feed to receive notification when parsing is complete.
FUEL
objects extiapplication objects extiapplication exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage fueliapplication objects fueliannotations fueliapplication fuelibookmark fuelibookmarkfolder fuelibookmarkroots fuelibrowsertab fueliwindow xpcom although the fuel application object is preloaded into xul scripts, it is not preloaded into javascript xpcom code.
SMILE
objects extiapplication objects exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage smileiapplication objects smileibookmarkroots smileiwindow smileibrowsertab smileiapplication xpcom although the extiapplication object is preloaded into xul scripts, it is not preloaded into javascript xpcom code.
STEEL
objects extiapplication objects extiapplication exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage steeliapplication objects steeliapplication xpcom although the steel steeliapplication object is preloaded into xul scripts, it is not preloaded into javascript xpcom code.
extISessionStorage
returns a default value if the item does not exist.
Generic factory
it seems to me that we can cut down on code size (all those queryinterface, addref, release implementations) if we just use the following class for all of the simple factories: // idea: why not create a generic factory facility so we can avoid // duplication of so much nsifactory code?
XPCOM Glue without mozalloc
since these routines didn't exist prior to xulrunner 2.0, xpcom components that link against the frozen linkage dependent glue will not be compatible with xulrunner applications prior to 2.0.
How To Pass an XPCOM Object to a New Window
getservice(components.interfaces.nsiwindowwatcher); var win = ww.openwindow(null, "chrome://myextension/content/debug.xul", "debug history", "chrome,centerscreen,resizable", myobject); note in this example that myobject is passed to the openwindow() method; you can pass any xpcom object (or any other value, for that matter) in this way.
Components.Constructor
another important benefit is that it precomputes some of the computation it does, so using a function returned from components.constructor() to create xpcom objects is faster than creating the object from base principles, as demonstrated below.
Components.Exception
these exception objects may be thrown when implementing xpcom interfaces in javascript, and they can provide better diagnostics in the error console if not caught than simply throwing an nsresult's value will.
Components.ID
the exception to this is the case where a component is written in javascript and needs to register itself with the component manager using its own nsid - an id that is not already registered and thus does not appear in components.classes.
Components.classesByID
components.classesbyid is exactly like components.classes except that the elements are indexed by the canonical form of their cid, and does not only represent the component classes that have been registered with the component manager using a contractid, but also those registered using a plain cid.
Components.interfacesByID
each object represents one of the xpcom interfaces -- that some component or another might or might not implement.
Components.lastResult
break; case 5: // do something with 5 here break; case 6: // do something with 6 here break; default: // this was a success code we did not expect.
Components.returnCode
note that components.returncode is currently non-functional due to bug 287107.
Components.utils.createObjectIn
note that this function is now mostly obsolete when you are using sandbox, because you can create an object in a different compartment using new.
Components.utils.getGlobalForObject
var global = components.utils.getglobalforobject(obj); parameters obj an object whose corresponding global object is to be retrieved; non-optional, must be object-valued example var obj = {}; function foo() { } var global = this; var g1 = components.utils.getglobalforobject(foo); var g2 = components.utils.getglobalforobject(obj); // g1 === global, g2 === global, g1 === g2 // in a script in another window var global2 = this; function bar() { } var obj2 = {}; // then, assuming bar refers to the function defined in that other window: var o1 = components.utils.getglobalforobject(bar); var o2 = components.utils.getglobalforobject(obj2); // o1 === global2, o2 === global2 ...
Components.utils.schedulePreciseGC
note: garbage collection is a very expensive operation and should only be forced when it is known to be absolutely necessary.
PyXPCOM
note: the links to part ii and iii of this series are broken and i cannot find them on the ibm site.
Using components
omponents.interfaces; if we want to get a hold of a component, we then do something like: var rc = cc["@mozilla.org/registry;1"]; var rs = rc.getservice(ci.nsiregistry); see also: xpcshell -- how to get a command line interface to javascript more info as was already stated, it is common to start addon scripts like: var cc = components.classes; var ci = components.interfaces; there is also another way to start, which is exactly equivalent to the above.
nsIRegistry
js> rs.flush() // this is not enough...
HOWTO
"component returned failure code: 0x80040111 (ns_error_not_available) [nsixpccomponents_utils.import]" nsresult: "0x80040111 (ns_error_not_available)" location: "js frame :: file.js :: <top_level> :: line 12" data: no] solution 1 var loader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getservice(components.interfaces.mozijssubscriptloader); loader.loadsubscript("chrome://myall/content/file.jsm"); see: http://mxr.mozilla.org/com...
Profiling XPCShell
notes you need a trunk build from after 2007-05-28.
XPCShell Reference
these arguments are only passed to “scriptfile” and not the scripts designated by –f options.
XPCshell Test Manifest Expressions
note that it currently seems like neither this list nor the one on the official docs is exhaustive, so if you need something and it's not here, best check the source code!
nsDirectoryService
ailed(rv)) return rv; nscomptr<nsiproperties> directory; rv = svcmgr->getservicebycontractid("@mozilla.org/file/directory_service;1", ns_get_iid(nsiproperties), getter_addrefs(directory)); if (ns_failed(rv)) return rv; rv = directory->get(ns_os_temp_dir, ns_get_iid(nsifile), aresult); return rv; } note that ns_os_temp_dir is defined in nsdirectoryservicedefs.h along with a number of other directory service keys.
NS_ShutdownXPCOM
calling this method triggers the "xpcom-shutdown" notification to be dispatched to observers.
NS_OVERRIDE
a compiler with static-checking enabled will issue the following error: test.cpp:8: error: ns_override function b::getfoo(nsifoo**) does not override a base class method with the same name and signature.
Append
otherwise, adata need not be null terminated.
Assign
otherwise, adata need not be null terminated.
BeginReading
const char_type* beginreading() const; remarks the resulting character array is not necessarily null-terminated.
Insert
otherwise, adata need not be null terminated.
Length
« xpcom api reference summary the length function returns the number of storage units in the string's internal buffer (not including the null-terminator if present).
Replace
otherwise, adata need not be null terminated.
Append
otherwise, adata need not be null terminated.
Assign
otherwise, adata need not be null terminated.
BeginReading
const char_type* beginreading() const; remarks the resulting character array is not necessarily null-terminated.
Insert
otherwise, adata need not be null terminated.
Length
« xpcom api reference summary the length function returns the number of storage units in the string's internal buffer (not including the null-terminator if present).
Replace
otherwise, adata need not be null terminated.
nsAutoRef
nsautoref has a role similar to nsautoptr and nsrefptr but does not require that the handle is a pointer to an object that was created with new or has addref() and release() methods.
nsAutoRefTraits
addref(t*) is necessary for nscountedref<t> but not for nsautoref<t>.
nsCOMPtr
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.
nsCStringEncoding
the conversion may result in loss and/or corruption of information if the strings do not strictly contain ascii data.
nsCountedRef
nscountedref has a role similar to nsrefptr but does not require that the handle is a pointer to an object that has addref() and release() methods.
nsEmbedCString
otherwise, adata need not be null terminated.
nsEmbedString
otherwise, adata need not be null terminated.
Alloc
note: prior to gecko 13.0, this function returned nsnull if memory allocation failed.
Free
this may be nsnull, in which case nothing happens.
GetGlobalMemoryService
static nsimemory* getglobalmemoryservice(); return values this function returns nsnull if the global memory manager does not exist or could not be initialized.
nsMemory
the static methods defined on this class are not frozen.
XPCOM glue classes
it is similar to nscomptr, but does not require that the type be an xpcom interface.
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.
IJSDebugger
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.
amIWebInstallInfo
note: prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5), this was an nsidomwindowinternal.
imgIContainerObserver
notes the arequest parameter was added to this method in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9).
jsdIStackFrame
once a jsdistackframe has been invalidated all method and property accesses will throw a ns_error_not_available exception.
mozIRepresentativeColorCallback
if success is false, color is not provided.
mozIStorageFunction
note this callback is executed on the thread that the statement or trigger is executing on.
mozIStorageStatementCallback
the mozistoragestatementcallback interface represents a callback handler that the storage api calls with result, error, and completion notifications while handling asynchronous database queries.
mozITXTToHTMLConv
scanhtml() scans the specified user-edited html, adding additional formatting that the user may not have known to do.
mozIVisitInfoCallback
notes this method was replaced by the separate handleresult() and handleerror() methods in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5).
nsIAboutModule
hide_from_aboutabout (1 << 2) a flag that indicates whether this about: uri doesn't want to be listed in about:about, especially if it's not useful without a query string.
nsIAccelerometerUpdate
xpcom/system/nsiaccelerometer.idlnot scriptable replaced by nsidevicemotionupdate 1.0 66 introduced gecko 2.0 obsolete gecko 6.0 inherits from: nsiaccelerometer last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) this method is only used in content tabs to receive nsiacceleration data from the chrome process.
ExtendSelection
void extendselection(); exceptions thrown ns_error_not_implemented always.
GetAccessibleRelated
exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree.ns_error_not_implemented indicates that the given relation type is unsupported see also nsiaccessible.getrelations() nsiaccessible.relationscount nsiaccessible.getrelation() ...
GetChildAtPoint
remarks if the point is in the current accessible but not in a child, the current accessible will be returned.
GetKeyBindings
exceptions thrown ns_error_invalid_arg the given index doesn't correspond to default action (not zero).
GetRelation
remark currently we do not support multiple relations so the zero index may be valid only.
IndexInParent
« nsiaccessible page summary the 0-based index of this accessible in its parent's list of children, or -1 if this accessible does not have a parent.
TakeFocus
it is the callers responsibility to determine whether this node is focusable.acctakefocus on a node that is not normally focusable (such as a table), will still set focus on that node, although normally that will not be visually indicated in most style sheets.
nsIAccessibleHyperText
note: renamed from links in gecko 1.9 methods getlink() retrieves the nsiaccessiblehyperlink object at the given link index.
nsIAccessibleProvider
constants common use constants constant value description noaccessible 0 do not create an accessible for this object this is useful if an ancestor binding already implements nsiaccessibleprovider, but no accessible is desired for the inheriting binding.
nsIAccessibleTreeCache
accessible/public/nsiaccessibletreecache.idlnot scriptable please add a summary to this article.
nsIAccessibleValue
return value true if the value is within the range of minimumvalue - maximumvalue, false if it is not.
nsIApplicationCacheNamespace
the data attribute is not used.
nsIApplicationCacheService
note: this method should propagate the entry to other application caches with the same opportunistic namespace; however, this is not currently implemented.
nsIAuthPrompt
note: if a username is specified, the username should be escaped.
nsIAuthPromptProvider
exceptions thrown ns_error_not_available if no prompt is allowed or available for the given reason.
nsIAutoCompleteInput
popupopen boolean indicates whether or not the popup view is already open.
nsIAutoCompleteItem
comment wstring an extra comment that will be displayed next to the value but that will not be part of the value itself.
nsIAutoCompleteListener
this method does not seem to have ever been implemented.
nsIBinaryInputStream
warning: this method is available from javascript; however javascript does not support 64-bit integers.
nsIBlocklistService
ring appversion, [optional] in astring toolkitversion); unsigned long getpluginblockliststate(in nsiplugintag plugin, [optional] in astring appversion, [optional] in astring toolkitversion); boolean isaddonblocklisted(in jsval addon, [optional] in astring appversion, [optional] in astring toolkitversion); constants constant value description state_not_blocked 0 state_softblocked 1 state_blocked 2 state_outdated 3 methods getaddonblockliststate() determine the blocklist state of an add-on.
nsIBrowserBoxObject
note: please consider using nsicontainerboxobject instead.
nsICacheEntryInfo
methods isstreambased() this method finds out whether or not the cache entry is stream based.
nsICacheListener
void oncacheentrydoomed( in nsresult status ); parameters status the status is ns_ok when the entry was doomed, or ns_error_not_available when there is no such entry.
nsIChromeRegistry
nsiuri convertchromeurl(in nsiuri achromeurl); boolean wrappersenabled(in nsiuri auri); violates the xpcom interface guidelines constants constant value description none 0 partial 1 full 2 methods canonify() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) note: this method is obsolete; use convertchromeurl() instead.
nsICommandLineRunner
on windows the character set is utf-8, not the native codepage.
nsIContentPrefCallback2
it is not called for other methods.
nsIContentViewManager
note: the rectangle is specified using an anchor point, then four distances to indicate how far in each direction to expand the rectangle.
nsICookieConsent
policy the policy for the given uri, or nsicookie::policy_unknown if one cannot be found.
nsICookieManager
if the cookie cannot be found, no exception is thrown.
nsICookiePromptService
hostname the host that wants to set the cookie, not the domain; this is part of the cookie.
nsICookieStorage
modules/plugin/base/public/nsicookiestorage.idlnot scriptable please add a summary to this article.
nsIDNSRequest
the listener will passed to asyncresolve will be notified immediately with a status code of ns_error_abort.
nsIDOMEventGroup
inherits from: nsisupports last changed in gecko 1.7 method overview boolean issameeventgroup(in nsidomeventgroup other); methods issameeventgroup() reports whether or not another event group is the same as this one.
nsIDOMFile
note that in gecko, this interface currently inherits from nsisupports, but in the file api specification, it should be a blob.
nsIDOMFileList
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.
nsIDOMGeoPositionError
gecko 1.9.2 note the message attribute was removed in gecko 1.9.2 (firefox 3.6).
nsIDOMGeoPositionErrorCallback
the nsidomgeopositionerrorcallback interface is used to represent an object that receives callback notifications when geolocation errors occur.
nsIDOMGlobalPropertyInitializer
an alternative way to expose an object to the web content is to add the property in response to the content-document-global-created notification.
nsIDOMNode
constants constant value description element_node 1 attribute_node 2 text_node 3 cdata_section_node 4 entity_reference_node 5 entity_node 6 processing_instruction_node 7 comment_node 8 document_node 9 document_type_node 10 document_fragment_node 11 notation_node 12 methods appendchild() nsidomnode appendchild( in nsidomnode newchild ); parameters newchild return value clonenode() nsidomnode clonenode( in boolean deep ); parameters deep return value hasattributes() boolean hasattributes(); parameters none.
nsIDOMStorage2
if the key does not already exist, a new key is added, associated with the specified value.
nsIDOMStorageManager
usage is checked against the domain of the page that set the key (the owner domain), not the domain of the storage object.
nsIDOMWindow2
not accessible from scripts.
nsIDOMXPathEvaluator
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.
nsIDOMXULControlElement
66 introduced gecko 1.0 inherits from: nsidomxulelement last changed in gecko 1.0 attributes attribute type description disabled boolean indicates whether the element is disabled or not.
nsIDOMXULLabeledControlElement
note: the access key is copied to any associated label element.
nsIDataSignatureVerifier
return value true if the signature matches the data, false if not.
nsIDebug
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.
nsIDeviceMotionData
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 nsidevicemotiondata prior to gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3).
nsIDeviceMotionListener
xpcom/system/nsidevicemotion.idlscriptable this interface can be implemented by clients that want to be notified orientation or acceleration changes on supported devices.
nsIDictionary
66 introduced gecko 1.0 obsolete 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.
nsIDirectoryService
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.
nsIDirectoryServiceProvider2
if you are implementing this from js, you would be using components.returncode, but sadly this does not currently work (see bug 287107).
nsIDocumentLoader
it is also responsible for sending nsiwebprogresslistener notifications.
nsIDownloadManagerUI
the ui need not be visible to call this function, nor will the ui be made visible.
nsIDragSession
last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void getdata( in nsitransferable atransferable, in unsigned long aitemindex ); boolean isdataflavorsupported( in string adataflavor ); attributes attribute type description candrop boolean set the current state of the drag, whether it can be dropped or not.
nsIEditorBoxObject
note: please consider using nsicontainerboxobject instead.
nsIEditorMailSupport
if the selection is not collapsed, the selection is deleted and the insertion takes place at the resulting collapsed selection.
nsIEditorObserver
editor/idl/nsieditorobserver.idlscriptable used by applications wishing to be notified when the editor has completed a user action.
nsIEnumerator
} iter.next(); } while( components.lastresult == 0 ); } catch(e) {} search for e-mail from "warren harris" dated 04/21/1999 time 16:11:03 for some notes on the subject.
nsIEventListenerService
note: some events, especially 'load', may actually have a shorter event target chain than what this methods returns.
nsIException
this is the location that caused the error, which may or may not be a source file location.
ExtensionManager (Toolkit)
note: this api is obsolete starting in gecko 2.0, and has been replaced by the new add-on manager.
nsIExternalHelperAppService
.getservice(components.interfaces.nsiexternalhelperappservice); method overview boolean applydecodingforextension(in autf8string aextension, in acstring aencodingtype); nsistreamlistener docontent(in acstring amimecontenttype, in nsirequest arequest, in nsiinterfacerequestor awindowcontext, in boolean aforcesave); methods applydecodingforextension() determines whether or not data whose filename has the specified extension should be decoded from the specified encoding type before being saved or delivered to helper applications.
nsIFTPEventSink
it can be used as a notification callback on an ftp channel.
nsIFeedResult
warning: this method is not implemented at this time.
nsIFormHistory2
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.
nsIFrameMessageManager
an alternative method to listen for death of frame script is to use message-manager-disconnect observer: observer notifications :: message manager.
nsIHttpUpgradeListener
note: to begin a protocol upgrade, call nsihttpchannelinternal.httpupgrade().
nsIIDNService
isace() determines whether or not the specified hostname is ace encoded.
nsIIFrameBoxObject
note: please consider using nsicontainerboxobject instead.
nsIINIParserWriter
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.
nsIInProcessContentFrameMessageManager
content/base/public/nsiframemessagemanager.idlnot scriptable ???
nsIJetpack
note: multiple callbacks may be registered for the same message; they will all be triggered.
nsILoginManagerIEMigrationHelper
note: in some cases, multiple logins may be created from a single input when the format is ambiguous.
nsIMarkupDocumentViewer
note: this attribute was added late in the gecko 2.0 development cycle and was implemented by the nsimarkupdocumentviewer_mozilla_2_0_branch interface; it was merged into this interface in gecko 7.0.
nsIMessageWakeupService
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).
nsIMicrosummaryObserver
void onerror( in nsimicrosummary microsummary ); parameters microsummary the microsumary which could not be updated.
nsIMsgAccountManagerExtension
note: the account manager relies on a very strong naming scheme to load and unload a panel.
nsIMsgFilterCustomAction
otherwise, be careful * that the action does correct notifications to maintain counts, and correct * manipulations of both imap and local non-database storage of message * metadata.
nsIMsgFilterList
condition ) savetodefaultfile() void nsimsgfilterlist::savetodefaultfile ( ) applyfilterstohdr() void nsimsgfilterlist::applyfilterstohdr ( in nsmsgfiltertypetype filtertype, in nsimsgdbhdr msghdr, in nsimsgfolder folder, in nsimsgdatabase db, in string headers, in unsigned long headersize, in nsimsgfilterhitnotify listener, in nsimsgwindow msgwindow, in nsilocalfile amessagefile ) writeinattr() void nsimsgfilterlist::writeintattr ( in nsmsgfilterfileattribvalue attrib, in long value, in nsioutputstream stream ) writestrattr() void nsimsgfilterlist::writestrattr ( in nsmsgfilterfileattribvalue attrib, ...
nsIMsgProtocolInfo
long getdefaultserverport( in boolean issecure ); parameters issecure whether or not the connection will be secure.
nsIMsgSearchCustomTerm
* recommended form: extensionname@example.com#termname * commas and quotes are not allowed, the id must not * parse to an integer, and names of standard search * attributes in searchattribentrytable in nsmsgsearchterm.cpp * are not allowed.
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!
nsINavHistoryFullVisitResultNode
1.0 66 introduced gecko 1.9 inherits from: nsinavhistoryvisitresultnode last changed in gecko 1.9 (firefox 3) the information returned in this interface is not commonly used, hence its separation into a separate query type for efficiency.
nsINavHistoryQueryResultNode
1.0 66 introduced gecko 1.8 inherits from: nsinavhistorycontainerresultnode last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) note: if you request that places not be expanded in the options that generated the node, the node will report that it has no children and will never try to populate itself.
nsIProcessScriptLoader
it's possible that the child process for this chromemessagesender is not yet available at the time of the loadprocessscript() call, and if you pass false in this situation, your process script won't be loaded.
nsIPrompt
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) note: this interface is identical to nsipromptservice but without the parent nsidomwindow parameter.
nsIProtocolProxyCallback
this is a failure code if the request could not be satisfied, in which case the value of astatus indicates the reason for the failure and aproxyinfo will be null.
nsIProtocolProxyFilter
this can be just be aproxy if the filter chooses not to modify the proxy.
nsIPushSubscription
a subscription expires if its service worker exceeds the quota, or if the desktop-notification permission for its origin is revoked.
nsISSLSocketControl
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void proxystartssl(); void starttls(); attributes attribute type description forcehandshake boolean obsolete since gecko 1.9 notificationcallbacks nsiinterfacerequestor methods proxystartssl() starts an ssl proxy connection.
nsIScriptError2
you may pass null if it's not applicable.
nsIScriptableUnescapeHTML
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.
nsIScrollable
scrollbar_always 3 scrollbars always visible, even when scrolling is not possible.
nsISearchEngine
must not be null.
nsISecurityCheckedComponent
note that if wrapper creation is prevented, the properties and methods will not be defined on the javascript object, whereas if wrapper creation succeeds but methods/properties are prevented, the properties and methods will be visible, not not usable.
nsISelection3
note that the parameters are case-insensitive.
nsISelectionImageService
layout/base/nsiselectionimageservice.idlnot scriptable please add a summary to this article.
nsISelectionPrivate
"none" means a table element is not selected.
nsIStackFrame
this is the location that caused the error, which may or may not be a source file location.
nsISupportsArray
deleteelementat() void deleteelementat( in unsigned long aindex ); parameters aindex deletelastelement() void deletelastelement( in nsisupports aelement ); parameters aelement violates the xpcom interface guidelines elementat() nsisupports elementat( in unsigned long aindex ); parameters aindex return value enumeratebackwards() [notxpcom, noscript] boolean enumeratebackwards( in nsisupportsarrayenumfunc afunc, in voidptr adata ); parameters afunc adata return value enumerateforwards() [notxpcom, noscript] boolean enumerateforwards( in nsisupportsarrayenumfunc afunc, in voidptr adata ); parameters afunc adata return value violates the xpcom interface guidelines equals() boolean equals( [const] in n...
nsITXTToHTMLConv
methods preformathtml() specifies whether or not to wrap the resulting html in an <pre> block.
nsITaggingService
tags from atags which are not set for the given uri are ignored.
nsITaskbarPreviewButton
this is not the same as visible, which indicates whether or not the button should be displayed at all.
nsIThreadManager
if the calling thread does not already have a nsithread associated with it, one is created and associate with the current prthread.
nsIToolkit
widget/public/nsitoolkit.idlnot scriptable this interface is used to initialize a message pump.
nsIURIFixupInfo
the input is an invalid uri and fixup_flag_allow_keyword_lookup is not passed).
nsIURLFormatter
if the preference value cannot be retrieved, a fatal error is reported and the "about:blank" url is returned.
nsIUpdateItem
note: add-ons can specify a targetapplication id of toolkit@mozilla.org in their install manifest for compatibility with all apps using a specific release of the toolkit.
nsIUpdateManager
this update is not in the history list.
nsIUploadChannel
netwerk/base/public/nsiuploadchannel.idlscriptable a channel may optionally implement this interface if it supports the notion of uploading a data stream.
nsIUploadChannel2
acontenttype this value will replace any existing content-type header on the http request, regardless of whether or not its empty.
nsIWebBrowserChrome3
isapptab whether or not the link is in an application tab.
nsIWebBrowserFindInFrames
once the search is done, this will be set to be the last frame searched, whether or not a result was found.
nsIWebappsSupport
return value true if the web application is installed, false if it's not installed.
nsIWifiListener
netwerk/wifi/nsiwifilistener.idlscriptable this interface is implemented by clients interested in receiving notifications when the list of available wifi access points changes.
nsIWinAccessNode
accessible/public/msaa/nsiwinaccessnode.idlnot scriptable please add a summary to this article.
nsIWinTaskbar
warning: this api has undergone changes that are not yet documented.
nsIWindowCreator
the application, either mozilla or an embedding app, must provide an implementation of the window watcher component and notify the windowwatcher during application initialization.
nsIWorkerScope
amessageport optional specifies the message port onto which to post the message; if not specified, the default port is used.
nsIXULBuilderListener
content/xul/templates/public/nsixulbuilderlistener.idlscriptable this object is a listener that will be notified when a template builder rebuilds its content.
nsIZipEntry
the possible values and their meanings are defined in the zip file specification at zip application note support.
nsMsgPriorityValue
defined in comm-central/ mailnews/ base/ public/ mailnewstypes2.idl typedef long nsmsgpriorityvalue; [scriptable, uuid(94c0d8d8-2045-11d3-8a8f-0060b0fc04d2)] interface nsmsgpriority { const nsmsgpriorityvalue notset = 0; const nsmsgpriorityvalue none = 1; const nsmsgpriorityvalue lowest = 2; const nsmsgpriorityvalue low = 3; const nsmsgpriorityvalue normal = 4; const nsmsgpriorityvalue high = 5; const nsmsgpriorityvalue highest = 6; // the default for a priority picker const nsmsgpriorityvalue default = 4; }; ...
nsMsgSearchTerm
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl use this to specify the value of a search term [ptr] native nsmsgsearchterm(nsmsgsearchterm); // please note the !
NS_ADDREF
do not use when the pointer might be null; use ns_if_addref in those cases.
NS ENSURE TRUE
syntax ns_ensure_true( expr, return-value ); usage nsresult mozmyclass::mozstringmucking() { char *foo = new char[123]; ns_ensure_true(foo, ns_error_out_of_memory); // this is equivalent to doing: if (!foo) return ns_error_out_of_memory; // thou shalt not return ns_error_failure..
NS_ERROR
this macro is meant for critical errors; like assertions, ns_errors should not be reachable.
NS_IF_ADDREF
does nothing for a null pointer.
NS_RELEASE
do not use when the pointer might be null; use ns_if_release in those cases.
NS_CStringAppendData
otherwise, adata need not be null-terminated.
NS_CStringContainerInit
the nscstringcontainer structure has private members that should not be accessed directly.
NS_CStringCopy
« xpcom api reference summary the ns_cstringcopy function copies the value from one nsacstring instance to another.
NS_CStringInsertData
otherwise, adata need not be null terminated.
NS_CStringSetData
otherwise, adata need not be null-terminated.
NS_CStringSetDataRange
otherwise, adata need not be null terminated.
NS_StringContainerFinish
return values this function does not return a value.
NS_StringContainerInit
its members may not be accessed directly.
NS_StringCopy
removed by bug 1332639 « xpcom api reference summary the ns_stringcopy function copies the value from one nsastring instance to another.
NS_StringCutData
note: gcc requires the -fshort-wchar option to compile this example since prunichar is an unsigned short.
NS_StringGetData
aterminated [out] this optional result parameter indicates whether or not adata is null-terminated.
NS_StringSetData
otherwise, adata need not be null terminated.
NS_StringSetDataRange
otherwise, adata need not be null terminated.
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!
nsMsgViewSortType
last changed in gecko 1.9 (firefox 3) constants name value description bynone 0x11 not sorted bydate 0x12 bysubject 0x13 byauthor 0x14 byid 0x15 bythread 0x16 bypriority 0x17 bystatus 0x18 bysize 0x19 byflagged 0x1a byunread 0x1b byrecipient 0x1c bylocation 0x1d bytags 0x1e byjunkstatus 0x1f byattachments 0x20 byaccount 0x21 bycustom 0x22 byreceived 0x23 ...
The Thread Manager
nsithreadobserver provides the ability to monitor a thread, to receive notifications when events are dispatched to it and when they're finished being processed.
Status, Recent Changes, and Plans
recent changes to this document removed the statement that == and != between an nscomptr and a raw pointer or literal 0 does not work on some compilers since it is no longer true.
Using nsCOMPtr
you'll have to turn to the xpcom newsgroup or another experienced nscomptr user, or find the answer by experimentation.
Working with out parameters
} the gettransferdata method takes three parameters, aflavor, adata, and adatalen, and returns nothing.
Account Provisioner
debugging the account provisioner dialog logs most if not all of its activities, which is useful for debugging.
DB Views (message lists)
view flags and types the view flags (external reference) are not exclusive.
Events
msgcreatedbview onactivecreatedview onactivemessagesloaded the active messages in the folder have been loaded oncreatedview a folder view has been created, but not yet shown.
Mail client architecture overview
events - as data changes throughout the mail application, the event system notifies key components such as datasources and the url system of these changes.
Mailbox
this may seem like a lot of infrastructure just to read messages from a flat file, but it allows us to do it asynchronously, and to have reading local messages fit into the same kind of mechanisms that reading nntp and imap messages do - running urls, getting onstart/stoprunningurl notifications when the url starts/stops, etc.
Thunderbird API documentation
these pages have been moved from mozilla.org, and may or may not be relevant.
Building a Thunderbird extension 5: XUL
if you have trouble with one zip manager (like 7zip) try another (like winrar).
Finding the code for a feature
here is my (edited) response: nsimsgtagservice is used to store the list of valid tags, so it is not the correct way to tag messages.
Add Option to Context Menu
note: if our extension supports more mozilla applications (for example mozilla firefox and mozilla thunderbird) we need also specify application flag.
Filter Incoming Mail
by example, setting it to lower case subject = subject.tolocalelowercase(); // then we rebuild a subject objet by rencoding the string // and assign it to the message headers and we're done amsghdr.subject = mimeconvert.encodemimepartiistr_utf8(subject, false, "utf-8", 0, 72); } } }; function init() { var notificationservice = components.classes["@mozilla.org/messenger/msgnotificationservice;1"] .getservice(components.interfaces.nsimsgfoldernotificationservice); notificationservice.addlistener(newmaillistener, notificationservice.msgadded); } addeventlistener("load", init, true); have a look to nsimsgdbhdr to get the full list of properties to be modified.
Folders and message lists
like selectmessage, this function will attempt to scroll the view so the entire selection is visible (which may not be possible for large selections).
Using MAPI with Thunderbird's Windows 7 developer builds
(be sure to copy - not move - these files.) in the uninstall sub-directory of the bin directory, run these two commands: helper.exe /setasdefaultappglobal helper.exe /setasdefaultappuser create an elevated shell and register the mapi proxy.dll as a com server.
XPI
note: starting in gecko 2.0, xpi files are no longer unpacked when extensions are installed.
Type conversion
note that the following table does not contain environment dependent types (ctypes.long, etc.).
ctypes.open
see: http://stackoverflow.com/questions/19382201/how-to-load-dll-from-sdk-addon-data-folder it is important to note that custom native files cannot be loaded through chrome:// or resource:// uris.
ABI
these are declared as stdcall on windows, but do not have mangled names like those used by stdcall_abi above.
CType
note: ctypes.void_t.size is undefined.
Plugin Roadmap for Firefox - Plugins
in order to improve security and performance, mozilla will maintain a list of sites which cannot use any plugins.
3D view - Firefox Developer Tools
if you do not see the 3d button in the page inspector, it is possible that your graphics driver needs to be updated.
The Web Developer Menu - Firefox Developer Tools
on os x and linux, it's under the "tools" menu: on windows 7, it's under the "firefox" menu: you'll see that the menu is split into three sections: the first section lists tools that are hosted in the toolbox, which is a dedicated window for developer tools the second section lists integrated tools that are not hosted in the toolbox, as well as any tools installed as add-ons (you'll see in the windows screenshot above that i've installed the firefox os simulator) the third section, "get more tools", is a link to more web development add-ons for firefox ...
Access debugging in add-ons - Firefox Developer Tools
window.addeventlistener("debugger:editorunloaded") relevant files: chrome://browser/content/devtools/debugger-controller.js chrome://browser/content/devtools/debugger-toolbar.js chrome://browser/content/devtools/debugger-view.js chrome://browser/content/devtools/debugger-panes.js unfortunately there is not yet any api to evaluate watches/expressions within the debugged scope, or highlight elements on the page that are referenced as variables in the debugged scope.
Highlight and inspect DOM nodes - Firefox Developer Tools
when you are working with dom notes in the debugger, you can easily highlight the node on the page or view it in the page inspector.
Search - Firefox Developer Tools
this feature may not seem terribly useful when searching a file with a handful of functions in it but when you are searching through a file with dozens of functions, it comes in handy.
Set a breakpoint - Firefox Developer Tools
note: there is also a new option in the context menu for the actual code in the source pane — hide inline preview/show inline preview — which allows you to turn the inline variables on/off.
Use watchpoints - Firefox Developer Tools
in a large, complex codebase, it's not always easy to know where in the code a given property is accessed.
Debugger keyboard shortcuts - Firefox Developer Tools
note: before firefox 66, the combination ctrl + shift + s on windows and linux or cmd + opt + s on macos would open/close the debugger.
Set a logpoint - Firefox Developer Tools
note that you can use logpoints with source-mapped code, as well as with your unmapped source files.
Set an XHR breakpoint - Firefox Developer Tools
note: if you enter a key word instead of a url, code execution will pause on any call to a url that contains that keyword.
UI Tour - Firefox Developer Tools
note: if you click step over (f10) after changing the selected line in the source pane, the debugger executes until reaching the line following the newly-selected line (disregarding whatever line the debugger originally stopped at).
Using the Debugger map scopes feature - Firefox Developer Tools
notice that your breakpoint is set here in the original code as it was in the corresponding line in the "bundle.js" file.
Measure a portion of the page - Firefox Developer Tools
when you stop holding the mouse down, the rectangle that was displayed on screen when you released the button will stay there until you click again, allowing you time to take screenshots, note the information down, etc.
Basic operations - Firefox Developer Tools
opening the memory tool before firefox 50, the memory tool is not enabled by default.
Performance Analysis - Firefox Developer Tools
(alternatively, if you have only just opened the network monitor, so it's not yet populated with the list of requests, you'll get a stopwatch icon in the main window.) the network monitor then loads the site twice: once with an empty browser cache, and once with a primed browser cache.
Throttling - Firefox Developer Tools
the characteristics emulated are: download speed upload speed minimum latency the table below lists the numbers associated with each network type, but please do not rely on this feature for exact performance measurements; it's intended to give an approximate idea of the user experience in different conditions.
Select an element - Firefox Developer Tools
this lets you see the rules for the element in the css pane, but conveniently select another element in the page.
Animation inspector (Firefox 41 and 42) - Firefox Developer Tools
note that the animation inspector's ui was revamped in firefox 43.
Animation inspector example: CSS transitions - Firefox Developer Tools
html content <div class="channel"> <img src="https://udn.realityripple.com/samples/e6/a96484b5c3.png" class="icon"/> <span class="note">firefox developer edition</span> </div> css content .channel { padding: 2em; margin: 0.5em; box-shadow: 1px 1px 5px #808080; margin: 1.5em; } .channel > * { vertical-align: middle; line-height: normal; } .icon { width: 50px; height: 50px; filter: grayscale(100%); transition: transform 750ms ease-in, filter 750ms ease-in-out; } .note { margin-left: 1em; font: 1.5em "open sans",arial,sans-serif; overflow: hidden; white-space: nowrap; display: inline-block; opacity: 0; width: 0; transition: opacity 500ms 150ms, width 500ms 150ms; } .icon#sele...
Page inspector keyboard shortcuts - Firefox Developer Tools
+ f clear search box content (only when the search box is focused, and content has been entered) esc esc esc step forward through properties and values tab tab tab step backward through properties and values shift + tab shift + tab shift + tab start editing property or value (rules view only, when a property or value is selected, but not already being edited) enter or space return or space enter or space cycle up and down through auto-complete suggestions (rules view only, when a property or value is being edited) up arrow , down arrow up arrow , down arrow up arrow , down arrow choose current auto-complete suggestion (rules view only, when a property or value is being edited) enter or tab ...
Paint Flashing Tool - Firefox Developer Tools
layers are painted independently and then composited, so a change in the appearance of one layer does not trigger a repaint in any other layers, and when only the relation of two layers changes (in an animation, for example) no repaints are required at all.
How to - Firefox Developer Tools
if you do this, you'll lose any loaded profiles that you have not saved.
Debugging Firefox Desktop - Firefox Developer Tools
to use a different port, pass the desired port number: /path/to/firefox --start-debugger-server 1234 note: in windows, the start-debugger-server call will only have one dash: firefox.exe -start-debugger-server 1234 note: by default, and for security reasons, the devtools.debugger.force-local option is set.
Style Editor - Firefox Developer Tools
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.
Tips - Firefox Developer Tools
if you include it, the screenshot will be of the whole page, not just the section visible in the browser windows.
Validators - Firefox Developer Tools
sidebar tabs are not available at this time.
Split console - Firefox Developer Tools
while you're in another tool in the toolbox, just press esc or select the "show split console" command in the toolbar menu.
Web Console UI Tour - Firefox Developer Tools
note: you can clear the contents of the console by entering the keyboard command ctrl + shift + l (windows, macos, and linux) or cmd + k on macos.
Web Console - Firefox Developer Tools
helper commands commands you can use that are not part of javascript.
Working with iframes - Firefox Developer Tools
if you select an entry in the list, all the tools in the toolbox - the inspector, the console, the debugger and so on - will now target only that iframe, and will essentially behave as if the rest of the page does not exist.
ANGLE_instanced_arrays.vertexAttribDivisorANGLE() - Web APIs
note: when using webgl2, this method is available as gl.vertexattribdivisor() by default.
ANGLE_instanced_arrays - Web APIs
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.
AbortController.AbortController() - Web APIs
}).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror.
AbortController.abort() - Web APIs
}).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror.
AbortController.signal - Web APIs
}).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror.
AbortController - Web APIs
}).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with a domexception named aborterror.
AbortSignal: abort event - Web APIs
later on we check whether or not it the signal has been aborted using the onabort property, and send an appropriate log to the console.
AbortSignal.onabort - Web APIs
later on we check whether or not it the signal has been aborted using the onabort property, and send an appropriate log to the console.
AbsoluteOrientationSensor - Web APIs
this is not something that would ever be shown to a user.
AbstractWorker - Web APIs
the abstractworker interface of the web workers api is an abstract interface that defines properties and methods that are common to all types of worker, including not only the basic worker, but also serviceworker and sharedworker.
Accelerometer.Accelerometer() - Web APIs
this is not something that would ever be shown to a user.
Accelerometer.x - Web APIs
WebAPIAccelerometerx
this is not something that would ever be shown to a user.
Accelerometer.y - Web APIs
WebAPIAccelerometery
this is not something that would ever be shown to a user.
Accelerometer.z - Web APIs
WebAPIAccelerometerz
this is not something that would ever be shown to a user.
Accelerometer - Web APIs
this is not something that would ever be shown to a user.
AddressErrors.addressLine - Web APIs
if the paymentaddress object's addressline property was determined to be valid, this property is not included in the addresserrors dictionary.
AddressErrors.country - Web APIs
if the paymentaddress object's country property was determined to be valid, this property is not included in the dictionary.
AesCbcParams - Web APIs
however, it need not be secret (for example, it may be transmitted unencrypted along with the ciphertext).
AmbientLightSensor.AmbientLightSensor() - Web APIs
this is not something that would ever be shown to a user.
AmbientLightSensor.illuminance - Web APIs
this is not something that would ever be shown to a user.
AmbientLightSensor - Web APIs
this is not something that would ever be shown to a user.
AnalyserNode.fftSize - Web APIs
note: if its value is not a power of 2, or it is outside the specified range, a domexception with the name indexsizeerror is thrown.
AnalyserNode.maxDecibels - Web APIs
note: if a value less than or equal to analysernode.mindecibels is set, an indexsizeerror exception is thrown.
AnalyserNode.minDecibels - Web APIs
note: if a value greater than analysernode.maxdecibels is set, an index_size_err exception is thrown.
Animation.oncancel - Web APIs
the cancel event can be triggered manually with animation.cancel() when the animation enters the "idle" play state from another state, such as when the animation is removed from an element before it finishes playing creating a new animation that is initially idle does not trigger a cancel event on the new animation.
Animation.ready - Web APIs
WebAPIAnimationready
you'll typically use a construct similar to this when using the ready promise: animation.ready.then(function() { // do whatever needs to be done when // the animation is ready to run }); example in the following example, the state of the animation will be running when the current ready promise is resolved because the animation does not leave the pending play state in between the calls to pause and play and hence the current ready promise does not change.
AnimationPlaybackEvent.timelineTime - Web APIs
this will be unresolved if the animation was not associated with a timeline at the time the event was generated or if the associated timeline was inactive.
AnimationTimeline - Web APIs
this interface exists to define timeline features (inherited by documenttimeline and future timeline types) and is not itself directly used by developers.
AudioBufferSourceNode.detune - Web APIs
syntax var source = audioctx.createbuffersource(); source.detune.value = 100; // value in cents note: though the audioparam returned is read-only, the value it represents is not.
AudioBufferSourceNode.playbackRate - Web APIs
when set to another value, the audiobuffersourcenode resamples the audio before sending it to the output.
AudioBufferSourceNode - Web APIs
the most recent call replaces the previous one, if the audiobuffersourcenode has not already reached the end of the buffer.
AudioContext.baseLatency - Web APIs
note: you can request a certain latency during construction time with the latencyhint option, but the browser may ignore the option.
AudioContext.suspend() - Web APIs
the suspend() method of the audiocontext interface suspends the progression of time in the audio context, temporarily halting audio hardware access and reducing cpu/battery usage in the process — this is useful if you want an application to power down the audio hardware when it will not be using an audio context for a while.
AudioContext - Web APIs
audiocontext.createmediastreamdestination() creates a mediastreamaudiodestinationnode associated with a mediastream representing an audio stream which may be stored in a local file or sent to another computer.
AudioContextOptions.sampleRate - Web APIs
if the samplerate property is not included in the options, or the options are not specified when creating the audio context, the new context's output device's preferred sample rate is used by default.
AudioDestinationNode.maxChannelCount - Web APIs
if maxchannelcount is 0, like in offlineaudiocontext, the channel count cannot be changed.
AudioNode.channelInterpretation - Web APIs
this fallback is therefore not future proof as the behavior of the browsers for a specific number of channels may change in the future.
AudioParam - Web APIs
when this list is not empty, changes using the audioparam.value attributes are ignored.
AudioScheduledSourceNode: ended event - Web APIs
bubbles no cancelable no interface event event handler property audioscheduledsourcenode.onended usage notes this event occurs when a audioscheduledsourcenode has stopped playing, either because it's reached a predetermined stop time, the full duration of the audio has been performed, or because the entire buffer has been played.
AudioScheduledSourceNode - Web APIs
unless stated otherwise, nodes based upon audioscheduledsourcenode output silence when not playing (that is, before start() is called and after stop() is called).
AudioTrack.language - Web APIs
syntax var audiotracklanguage = audiotrack.language; value a domstring specifying the bcp 47 (rfc 5646) format language tag of the primary language used in the audio track, or an empty string ("") if the language is not specified or known, or if the track doesn't contain speech.
AudioTrack.sourceBuffer - Web APIs
the read-only audiotrack property sourcebuffer returns the sourcebuffer that created the track, or null if the track was not created by a sourcebuffer or the sourcebuffer has been removed from the mediasource.sourcebuffers attribute of its parent media source.
AudioTrackList.length - Web APIs
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.
AudioTrackList.onchange - Web APIs
note: you can also add a handler for the change event using addeventlistener().
AudioTrackList.onremovetrack - Web APIs
note: you can also add a handler for the removetrack event using addeventlistener().
AudioTrackList - Web APIs
usage notes in addition to being able to obtain direct access to the audio tracks present on a media element, audiotracklist lets you set event handlers on the addtrack and removetrack events, so that you can detect when tracks are added to or removed from the media element's stream.
BaseAudioContext.createAnalyser() - Web APIs
note: for more on using this node, see the analysernode page.
BaseAudioContext.createBufferSource() - Web APIs
note: you can also run the code live, or view the source.
BaseAudioContext.createChannelMerger() - Web APIs
syntax baseaudiocontext.createchannelmerger(numberofinputs); parameters numberofinputs the number of channels in the input audio streams, which the output stream will contain; the default is 6 if this parameter is not specified.
BaseAudioContext.createChannelSplitter() - Web APIs
syntax baseaudiocontext.createchannelsplitter(numberofoutputs); parameters numberofoutputs the number of channels in the input audio stream that you want to output separately; the default is 6 if this parameter is not specified.
BaseAudioContext.createDelay() - Web APIs
must be less than 180 seconds, and defaults to 1 second if not specified.
BaseAudioContext.createGain() - Web APIs
evices.getusermedia) { navigator.mediadevices.getusermedia ( // constraints - only audio needed for this app { audio: true }, // success callback function(stream) { source = audioctx.createmediastreamsource(stream); }, // error callback function(err) { console.log('the following gum error occured: ' + err); } ); } else { console.log('getusermedia not supported on your browser!'); } source.connect(gainnode); gainnode.connect(audioctx.destination); ...
BaseAudioContext.createWaveShaper() - Web APIs
note: sigmoid functions are commonly used for distortion curves because of their natural properties.
BaseAudioContext.destination - Web APIs
example note: for a full example implementation, see one of our web audio demos on the mdn github repo, like voice-change-o-matic.
BaseAudioContext.listener - Web APIs
example note: for a full web audio spatialization example, see our panner-node demo.
BatteryManager.level - Web APIs
a value of 1.0 is also returned if the implementation isn't able to determine the battery charge level or if the system is not battery-powered.
BatteryManager - Web APIs
properties batterymanager.charging read only a boolean value indicating whether or not the battery is currently being charged.
Using the Beacon API - Web APIs
beacon requests use http post and do not require a response.
BeforeInstallPromptEvent.prompt() - Web APIs
example var istoosoon = true; window.addeventlistener("beforeinstallprompt", function(e) { if (istoosoon) { e.preventdefault(); // prevents prompt display // prompt later instead: settimeout(function() { istoosoon = false; e.prompt(); // throws if called more than once or default not prevented }, 10000); } // the event was re-dispatched in response to our request // ...
BiquadFilterNode.Q - Web APIs
syntax var audioctx = new audiocontext(); var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.q.value = 100; note: though the audioparam returned is read-only, the value it represents is not.
BiquadFilterNode.detune - Web APIs
syntax var audioctx = new audiocontext(); var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.detune.value = 100; note: though the audioparam returned is read-only, the value it represents is not.
BiquadFilterNode.frequency - Web APIs
syntax var audioctx = new audiocontext(); var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.frequency.value = 3000; note: though the audioparam returned is read-only, the value it represents is not.
BiquadFilterNode.gain - Web APIs
syntax var audioctx = new audiocontext(); var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.gain.value = 25; note: though the audioparam returned is read-only, the value it represents is not.
BiquadFilterNode.getFrequencyResponse() - Web APIs
return value undefined exceptions invalidaccesserror the three arrays provided are not all of the same length.
Blob.arrayBuffer() - Web APIs
WebAPIBlobarrayBuffer
usage notes while similar to the filereader.readasarraybuffer() method, arraybuffer() returns a promise rather than being an event-based api, as is the case with the filereader interface's method.
Blob.stream() - Web APIs
WebAPIBlobstream
usage notes with stream() and the returned readablestream, you gain several interesting capabilities: call getreader() on the returned stream to get an object to use to read the data from the blob using methods such as the readablestreamdefaultreader interface's read() method.
Blob.text() - Web APIs
WebAPIBlobtext
usage notes the filereader method readastext() is an older method that performs a similar function.
Blob.type - Web APIs
WebAPIBlobtype
syntax var mimetype = blob.type value a domstring containing the file's mime type, or an empty string if the type could not be determined.
BlobBuilder - Web APIs
note: the blobbuilder interface has been deprecated in favor of the newly introduced blob constructor.
BlobEvent.timecode - Web APIs
note that the timecode in the first produced blobevent does not need to be zero.
BluetoothRemoteGATTCharacteristic.value - Web APIs
this value gets updated when the value of the characteristic is read or updated via a notification or indication.
isPrimary - Web APIs
if it is not a primary service, it is a secondary service.
Body.arrayBuffer() - Web APIs
WebAPIBodyarrayBuffer
note that before playing full audio file will be downloaded.
Body.blob() - Web APIs
WebAPIBodyblob
note: if the response has a response.type of "opaque", the resulting blob will have a blob.size of 0 and a blob.type of empty string "", which renders it useless for methods like url.createobjecturl.
Body.bodyUsed - Web APIs
WebAPIBodybodyUsed
notice that we log response.bodyused to the console once before the response.blob() call and once after.
Body.formData() - Web APIs
WebAPIBodyformData
note: this is mainly relevant to service workers.
Body - Web APIs
WebAPIBody
you'll notice that since we are requesting an image, we need to run body.blob() (response implements body) to give the response its correct mime type.
BroadcastChannel.name - Web APIs
note: this feature is available in web workers.
BroadcastChannel.onmessage - Web APIs
note: this feature is available in web workers.
BroadcastChannel.postMessage() - Web APIs
note: this feature is available in web workers.
CDATASection - Web APIs
]]> for example: <foo>here is a cdata section: <![cdata[ < > & ]]> with all kinds of unescaped text.</foo> the only sequence which is not allowed within a cdata section is the closing sequence of a cdata section itself, ]]>: <![cdata[ ]]> will cause an error ]]> note that cdata sections should not be used within html; they only work in xml.
CSS.supports() - Web APIs
WebAPICSSsupports
the css.supports() method returns a boolean value indicating if the browser supports a given css feature, or not.
CSS - Web APIs
WebAPICSS
css.registerproperty() registers custom properties, allowing for property type checking, default values, and properties that do or do not inherit their value.
CSSImageValue - Web APIs
the cssimagevalue object represents an <image> that involves an url, such as url() or image(), but not linear-gradient() or element() .
CSSNumericValue.equals() - Web APIs
some of the following examples illustrate what happens when they are not.
CSSNumericValue.max() - Web APIs
some of the following examples illustrate what happens when they are not.
CSSNumericValue.min() - Web APIs
some of the following examples illustrate what happens when they are not.
CSSNumericValue - Web APIs
cssnumericvalue.to converts value into another one with the specified unit.
CSSOMString - Web APIs
cssomstring is used to denote string data in cssom specifications and can refer to either domstring or usvstring.
CSSPrimitiveValue.getCounterValue() - Web APIs
this is not css_counter).
CSSPrimitiveValue.getRGBColorValue() - Web APIs
this is not css_rgbcolor).
CSSPrimitiveValue.getRectValue() - Web APIs
this is not css_rect).
CSSPrimitiveValue.primitiveType - Web APIs
css_unknown the value is not a recognized css2 value.
CSSStyleDeclaration.cssText - Web APIs
not to be confused with stylesheet style-rule cssrule.csstext.
CSSStyleDeclaration.getPropertyCSSValue() - Web APIs
note that it returns null if the property name is a shorthand property.
CSSStyleDeclaration.getPropertyValue() - Web APIs
if not set, returns the empty string.
CSSStyleDeclaration.parentRule - Web APIs
syntax var rule = styles.parentrule; value the css rule that contains this declaration block or null if this cssstyledeclaration is not attached to a cssrule.
CSSStyleDeclaration.removeProperty() - Web APIs
note that multi-word property names are hyphenated and not camel-cased.
CSSStyleRule.style - Web APIs
syntax styleobj = cssrule.style example function stilo() { alert(document.stylesheets[0].cssrules[0].style.csstext); } // displays "background-color: gray;" notes the declaration block is that part of the style rule that appears within the braces and that actually provides the style definitions (for the selector, the part that comes before the braces).
CSSStyleSheet.cssRules - Web APIs
examples individual rules within the stylesheet can then be accessed by index: let rulelist = document.stylesheets[0].cssrules; for (let i=0; i < rulelist.length; i++) { processrule(rulelist[i]); } rules can also be accessed using for...of: let rulelist = document.stylesheets[0].cssrules; for (let rule of rulelist) { processrule(rule); } however, because cssrule is not a proper array, you can't use foreach().
CSSStyleSheet.removeRule() - Web APIs
note: this is a legacy method which has been replaced by the standard method deleterule().
CSSValueList.item() - Web APIs
WebAPICSSValueListitem
return value a cssvalue object at the index position in the cssvaluelist, or null if that is not a valid index.
CacheStorage.delete() - Web APIs
if not, we delete it using delete().
CacheStorage.keys() - Web APIs
WebAPICacheStoragekeys
if not, we delete it using cachestorage.delete().
CacheStorage.open() - Web APIs
WebAPICacheStorageopen
note: if the specified cache does not exist, a new cache is created with that cachename and a promise that resolves to this new cache object is returned.
CanvasGradient.addColorStop() - Web APIs
a syntax_err is raised if the value cannot be parsed as a css <color> value.
CanvasGradient - Web APIs
if the offset is not between 0 and 1, inclusive, an index_size_err is raised; if the color can't be parsed as a css <color>, a syntax_err is raised.
CanvasImageSource - Web APIs
it’s not an interface and there are no objects implementing it.
CanvasPattern.setTransform() - Web APIs
as.getcontext('2d'); var svg1 = document.getelementbyid('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...
CanvasRenderingContext2D.addHitRegion() - Web APIs
if not provided, the current path is used.
CanvasRenderingContext2D.beginPath() - Web APIs
note: to create a new sub-path, i.e., one matching the current canvas state, you can use canvasrenderingcontext2d.moveto().
CanvasRenderingContext2D.clearRect() - Web APIs
note: be aware that clearrect() may cause unintended side effects if you're not using paths properly.
CanvasRenderingContext2D.clip() - Web APIs
note: be aware that the clipping region is only constructed from shapes added to the path.
CanvasRenderingContext2D.createImageData() - Web APIs
the image itself is not copied.
CanvasRenderingContext2D.createPattern() - Web APIs
possible values are: "repeat" (both directions) "repeat-x" (horizontal only) "repeat-y" (vertical only) "no-repeat" (neither direction) if repetition is specified as an empty string ("") or null (but not undefined), a value of "repeat" will be used.
CanvasRenderingContext2D.direction - Web APIs
note that "hi!" in ltr becomes "!hi" in rtl.
CanvasRenderingContext2D.drawFocusIfNeeded() - Web APIs
syntax void ctx.drawfocusifneeded(element); void ctx.drawfocusifneeded(path, element); parameters element the element to check whether it is focused or not.
CanvasRenderingContext2D.fillText() - Web APIs
if not specified, there is no limit to the width of the text.
CanvasRenderingContext2D.getTransform() - Web APIs
the transformation matrix is described by: [acebdf001]\left[ \begin{array}{ccc} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{array} \right] note: the returned object is not live, so updating it will not affect the current transformation matrix, and updating the current transformation matrix will not affect an already returned dommatrix.
CanvasRenderingContext2D.globalAlpha - Web APIs
values outside that range, including infinity and nan, will not be set, and globalalpha will retain its previous value.
CanvasRenderingContext2D.imageSmoothingQuality - Web APIs
note: for this property to have an effect, imagesmoothingenabled must be true.
CanvasRenderingContext2D.isPointInPath() - Web APIs
the canvasrenderingcontext2d.ispointinpath() method of the canvas 2d api reports whether or not the specified point is contained in the current path.
CanvasRenderingContext2D.isPointInStroke() - Web APIs
the canvasrenderingcontext2d.ispointinstroke() method of the canvas 2d api reports whether or not the specified point is inside the area contained by the stroking of a path.
CanvasRenderingContext2D.lineCap - Web APIs
note: lines can be drawn with the stroke(), strokerect(), and stroketext() methods.
CanvasRenderingContext2D.lineDashOffset - Web APIs
the canvasrenderingcontext2d.linedashoffset property of the canvas 2d api sets the line dash offset, or "phase." note: lines are drawn by calling the stroke() method.
CanvasRenderingContext2D.lineJoin - Web APIs
note: lines can be drawn with the stroke(), strokerect(), and stroketext() methods.
CanvasRenderingContext2D.lineTo() - Web APIs
like other methods that modify the current path, this method does not directly render anything.
CanvasRenderingContext2D.lineWidth - Web APIs
note: lines can be drawn with the stroke(), strokerect(), and stroketext() methods.
CanvasRenderingContext2D.restore() - Web APIs
if there is no saved state, this method does nothing.
CanvasRenderingContext2D.rotate() - Web APIs
note that the center of rotation is the top-left corner of the canvas, and not a location relative to any shape.
CanvasRenderingContext2D.setLineDash() - Web APIs
note: to return to using solid lines, set the line dash list to an empty array.
CanvasRenderingContext2D.setTransform() - Web APIs
note: see also the transform() method; instead of overriding the current transform matrix, it multiplies it with a given one.
CanvasRenderingContext2D.shadowColor - Web APIs
note: shadows are only drawn if the shadowcolor property is set to a non-transparent value.
CanvasRenderingContext2D.shadowOffsetX - Web APIs
note: shadows are only drawn if the shadowcolor property is set to a non-transparent value.
CanvasRenderingContext2D.shadowOffsetY - Web APIs
note: shadows are only drawn if the shadowcolor property is set to a non-transparent value.
CanvasRenderingContext2D.strokeText() - Web APIs
if not specified, there is no limit to the width of the text.
CanvasRenderingContext2D.textAlign - Web APIs
note that the direction property is manually specified as "ltr", although this is also the default for english-language text.
CanvasRenderingContext2D.transform() - Web APIs
note: see also the settransform() method, which resets the current transform to the identity matrix and then invokes transform().
Advanced animations - Web APIs
var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var ball = { x: 100, y: 100, radius: 25, color: 'blue', draw: function() { ctx.beginpath(); ctx.arc(this.x, this.y, this.radius, 0, math.pi * 2, true); ctx.closepath(); ctx.fillstyle = this.color; ctx.fill(); } }; ball.draw(); nothing special here, the ball is actually a simple circle and gets drawn with the help of the arc() method.
Basic animations - Web APIs
note that the width and height specified here must match the values of the canvasxzsize and canvasysize variables in the javascript code.
Compositing example - Web APIs
pure black or white does not result in pure black or white.', 'subtracts the bottom layer from the top layer or the other way round to always get a positive value.', 'like difference, but with lower contrast.', 'preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer.', 'preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.', 'preserves the luma of the ...
Compositing and clipping - Web APIs
globalcompositeoperation we can not only draw new shapes behind existing shapes but we can also use it to mask off certain areas, clear sections from the canvas (not limited to rectangles like the clearrect() method does) and more.
Drawing text - Web APIs
function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); var text = ctx.measuretext('foo'); // textmetrics object text.width; // 16; } gecko-specific notes in gecko (the rendering engine of firefox, firefox os and other mozilla based applications), some prefixed apis were implemented in earlier versions to draw text on a canvas.
ChannelMergerNode() - Web APIs
if not specified, the default value used is 6.
ChannelMergerNode - Web APIs
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.
ChannelSplitterNode.ChannelSplitterNode() - Web APIs
if not specified, the default value used is 6.
ChannelSplitterNode - Web APIs
older implementations, as per earlier versions of the spec use 2 (not used in the default count mode).
Client.type - Web APIs
WebAPIClienttype
a document) function sendmessage(message) { return new promise(function(resolve, reject) { // note that this is the serviceworker.postmessage version navigator.serviceworker.controller.postmessage(message); window.serviceworker.onmessage = function(e) { resolve(e.data); }; }); } // controlling service worker self.addeventlistener("message", function(e) { // e.source is a client object e.source.postmessage("hello!
Client.url - Web APIs
WebAPIClienturl
example self.addeventlistener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: 'window' }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status c...
Clients.claim() - Web APIs
WebAPIClientsclaim
example the following example uses claim() inside service worker's "activate" event listener so that clients loaded in the same scope do not need to be reloaded before their fetches will go through this service worker.
Clients.matchAll() - Web APIs
WebAPIClientsmatchAll
if options are not included, the method returns only the service worker clients controlled by the service worker.
Clipboard.readText() - Web APIs
returns an empty string if the clipboard is empty, does not contain text, or does not include a textual representation among the datatransfer objects representing the clipboard's contents.
CloseEvent() - Web APIs
closeeventinit optional is a closeeventinit dictionary, having the following fields: "wasclean", optional and defaulting to false, of type long, indicates if the connection has been closed cleanly or not.
CompositionEvent.CompositionEvent() - Web APIs
note: the compositioneventinit dictionary inherits from the uieventinit dictionary, so can also accept members defined on there.
console.count() - Web APIs
WebAPIConsolecount
note: this feature is available in web workers.
console.debug() - Web APIs
WebAPIConsoledebug
note: this feature is available in web workers.
Console.dir() - Web APIs
WebAPIConsoledir
note: this feature is available in web workers.
Console.dirxml() - Web APIs
WebAPIConsoledirxml
if it is not possible to display as an element the javascript object view is shown instead.
Console.groupCollapsed() - Web APIs
note: this feature is available in web workers.
Console.groupEnd() - Web APIs
WebAPIConsolegroupEnd
note: this feature is available in web workers.
Console.info() - Web APIs
WebAPIConsoleinfo
note: this feature is available in web workers.
Console.profile() - Web APIs
WebAPIConsoleprofile
note: this feature is available in web workers.
Console.time() - Web APIs
WebAPIConsoletime
note: this feature is available in web workers.
Console.timeStamp() - Web APIs
WebAPIConsoletimeStamp
note: this feature is available in web workers.
console.trace() - Web APIs
WebAPIConsoletrace
note: this feature is available in web workers.
Console.warn() - Web APIs
WebAPIConsolewarn
note: this feature is available in web workers.note: in chrome and firefox, warnings have a small exclamation point icon next to them in the web console log.
ConstantSourceNode() - Web APIs
let audiocontext = new audiocontext(); let myconstantsource = new constantsourcenode(audiocontext, { offset: 0.5 }); note: the new constantsourcenode created by the constructor has a channelcount of 2.
ConstantSourceNode.offset - Web APIs
while the audioparam named offset is read-only, the value property within is not.
ConstantSourceNode - Web APIs
in addition, it can be used like a constructible audioparam by automating the value of its offset or by connecting another node to it; see controlling multiple parameters with constantsourcenode.
ConstrainBoolean - Web APIs
ideal a boolean value indicating the ideal, but not required, value the property should ideally have.
ConstrainDOMString - Web APIs
if possible, one of the listed values will be used, but if it's not possible, the user agent will use the closest possible match.
ContentIndex.delete() - Web APIs
it does not delete anything from the cache.
ContentIndexEvent - Web APIs
it is not fired when the contentindex.delete method is called.
CredentialsContainer.preventSilentAccess() - Web APIs
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.
CredentialsContainer - Web APIs
the credentialscontainer interface of the the credential management api exposes methods to request credentials and notify the user agent when events such as successful sign in or sign out happen.
CustomElementRegistry.upgrade() - Web APIs
examples taken from the html spec: const el = document.createelement("spider-man"); class spiderman extends htmlelement {} customelements.define("spider-man", spiderman); console.assert(!(el instanceof spiderman)); // not yet upgraded customelements.upgrade(el); console.assert(el instanceof spiderman); // upgraded!
CustomEvent() - Web APIs
note: this feature is available in web workers.
CustomEvent.detail - Web APIs
note: this feature is available in web workers.
DOMConfiguration - Web APIs
note: this interface has never been supported in gecko, and has been removed from the dom specification.
DOMException() - Web APIs
if not present, the empty string '' is used.
DOMLocator - Web APIs
note: this is not implemented in mozilla indicates a location such as where an error occurred.
DOMMatrix - Web APIs
WebAPIDOMMatrix
usage notes the matrix defined by the dommatrix interface is comprised of four rows of four columns each.
DOMPoint.fromPoint() - Web APIs
although this interface is based on dompointreadonly, it is not read-only; the properties within may be changed at will.
DOMPointInit.w - Web APIs
WebAPIDOMPointInitw
this value is assumed to be 1 by default if not included in the dompointinit object passed into frompoint().
DOMPointInit.x - Web APIs
WebAPIDOMPointInitx
in general, positive values x mean to the right, and negative values of x means to the left, assuming that transforms have not altered the orientation of the axes.
DOMPointReadOnly.x - Web APIs
this property cannot be changed by javascript code in this read-only version of the dompoint object.
DOMPointReadOnly - Web APIs
note: this feature is available in web workers.
DOMRect - Web APIs
WebAPIDOMRect
the difference is that they are not read-only anymore.
DOMRectReadOnly - Web APIs
note that this constructor cannot be called by 3rd party javascript; doing so returns an "illegal constructor" typeerror.
DOMTokenList.contains() - Web APIs
first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; let result = classes.contains("c"); if (result) { span.textcontent = "the classlist contains 'c'"; } else { span.textcontent = "the classlist does not contain 'c'"; } the output looks like this: specifications specification status comment domthe definition of 'contains()' in that specification.
DOMTokenList.remove() - Web APIs
if the string is not in the list, no error is thrown, and nothing happens.
DOMTokenList.supports() - Web APIs
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.
DataTransfer.dropEffect - Web APIs
none the item may not be dropped.
DataTransfer.types - Web APIs
some values that are not mime types are special-cased for legacy reasons (for example "text").
DataTransferItem.getAsFile() - Web APIs
if the item is not a file, this method returns null.
DataTransferItem.type - Web APIs
the type is a unicode string generally given by a mime type, although a mime type is not required.
DataTransferItem.webkitGetAsEntry() - Web APIs
note that to read all files in a directory, readentries needs to be called repeatedly until it returns an empty array.
DataTransferItem - Web APIs
methods datatransferitem.getasfile() returns the file object associated with the drag data item (or null if the drag item is not a file).
DataTransferItemList - Web APIs
recommendation not included in w3c html5 recommendation ...
DedicatedWorkerGlobalScope.close() - Web APIs
note: there is also a way to stop the worker from the main thread: the worker.terminate method.
DedicatedWorkerGlobalScope.onmessage - Web APIs
ta; console.log('message received from worker'); } in the worker.js script, a dedicatedworkerglobalscope.onmessage handler is used to handle messages from the main script: onmessage = function(e) { console.log('message received from main script'); var workerresult = 'result: ' + (e.data[0] * e.data[1]); console.log('posting message back to main script'); postmessage(workerresult); } notice how in the main script, onmessage has to be called on myworker, whereas inside the worker script you just need onmessage because the worker is effectively the global scope (the dedicatedworkerglobalscope, in this case).
DedicatedWorkerGlobalScope.postMessage() - Web APIs
note: postmessage() can only send a single object at once.
DedicatedWorkerGlobalScope - Web APIs
some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the javascript reference.
DelayNode.delayTime - Web APIs
syntax var audioctx = new audiocontext(); var mydelay = audioctx.createdelay(5.0); mydelay.delaytime.value = 3.0; note: though the audioparam returned is read-only, the value it represents is not.
DelayNode - Web APIs
WebAPIDelayNode
number of inputs 1 number of outputs 1 channel count mode "max" channel count 2 (not used in the default count mode) channel interpretation "speakers" constructor delaynode() creates a new instance of an delaynode object instance.
DeprecationReportBody - Web APIs
if the date is not known, this property will return null.
Using light sensors - Web APIs
when the light sensor of the device detects a change in light intensity, the browser is notified of the change and fires a devicelightevent event.
DeviceMotionEvent.DeviceMotionEvent() - Web APIs
specifications not part of any specifications.
DeviceMotionEvent.acceleration - Web APIs
note: if the hardware doesn't know how to remove gravity from the acceleration data, this value may not be present in the devicemotionevent.
DeviceMotionEvent.accelerationIncludingGravity - Web APIs
this value is not typically as useful as devicemotionevent.acceleration, but may be the only value available on devices that aren't able of removing gravity from the acceleration data, such as on devices that don't have a gyroscope.
DeviceMotionEvent.rotationRate - Web APIs
note: if the hardware isn't capable of providing this information, this property returns null.
DeviceMotionEvent - Web APIs
warning: currently, firefox and chrome do not handle the coordinates the same way.
DeviceOrientationEvent.DeviceOrientationEvent() - Web APIs
absolute: a boolean that indicates whether or not the device is providing orientation data absolutely.
DeviceOrientationEvent.absolute - Web APIs
indicates whether or not the device is providing orientation data absolutely (that is, in reference to the earth's coordinate frame) or using some arbitrary frame determined by the device.
Document.anchors - Web APIs
WebAPIDocumentanchors
chor); toc.appendchild(li); } } </script> </head> <body onload="init()"> <h1>title</h1> <h2><a name="contents">contents</a></h2> <ul id="toc"></ul> <h2><a name="plants">plants</a></h2> <ol> <li>apples</li> <li>oranges</li> <li>pears</li> </ol> <h2><a name="veggies">veggies</a></h2> <ol> <li>carrots</li> <li>celery</li> <li>beats</li> </ol> </body> </html> view on jsfiddle notes for reasons of backwards compatibility, the returned set of anchors only contains those anchors created with the name attribute, not those created with the id attribute.
Document: animationend event - Web APIs
if the animation aborts before reaching completion, such as if the element is removed from the dom or the animation is removed from the element, the animationend event is not fired.
Document.applets - Web APIs
WebAPIDocumentapplets
note: the <applet> element was removed in gecko 56 and chrome in late 2015.
Document.body - Web APIs
WebAPIDocumentbody
syntax const objref = document.body document.body = objref example // given this html: <body id="oldbodyelement"></body> alert(document.body.id); // "oldbodyelement" const anewbodyelement = document.createelement("body"); anewbodyelement.id = "newbodyelement"; document.body = anewbodyelement; alert(document.body.id); // "newbodyelement" notes document.body is the element that contains the content for the document.
Document.characterSet - Web APIs
do not use them any more.
Document.clear() - Web APIs
WebAPIDocumentclear
in recent versions of mozilla-based applications, as well as in internet explorer and netscape 4, this method does nothing.
Document.compatMode - Web APIs
note: all these modes are now standardized, so the older "standards" and "almost standards" names are nonsensical and no longer used in standards.
Document.contentType - Web APIs
note: this property is unaffected by <meta> elements.
Document.createAttribute() - Web APIs
the dom does not enforce what sort of attributes can be added to a particular element in this manner.
Document.createComment() - Web APIs
example var docu = new domparser().parsefromstring('<xml></xml>', 'application/xml'); var comment = docu.createcomment('this is a not-so-secret comment in your document'); docu.getelementsbytagname('xml')[0].appendchild(comment); alert(new xmlserializer().serializetostring(docu)); // displays: <xml><!--this is a not-so-secret comment in your document--></xml> specifications specification status comment domthe definition of 'document.createcomment' in that specification.
Document.createElement() - Web APIs
note: for backwards compatibility with previous versions of the custom elements specification, some browsers will allow you to pass a string here instead of an object, where the string's value is the custom element's tag name.
Document.createExpression() - Web APIs
firefox 3 note prior to firefox 3, you could call this method on documents other than the one you planned to run the xpath against.
Document.createProcessingInstruction() - Web APIs
obsolete added note that the namespace of the target name is not checked whether it is well-formed, defined what is considered an illegal character for the target name and specified the returned processinginstruction object more precisely.
Document.createRange() - Web APIs
example let range = document.createrange(); range.setstart(startnode, startoffset); range.setend(endnode, endoffset); notes once a range is created, you need to set its boundary points before you can make use of most of its methods.
Document.currentScript - Web APIs
(for modules use import.meta instead.) it's important to note that this will not reference the <script> element if the code in the script is being called as a callback or event handler; it will only reference the element while it's initially being processed.
Document.doctype - Web APIs
WebAPIDocumentdoctype
example var doctypeobj = document.doctype; console.log( "doctypeobj.name: " + doctypeobj.name + "\n" + "doctypeobj.internalsubset: " + doctypeobj.internalsubset + "\n" + "doctypeobj.publicid: " + doctypeobj.publicid + "\n" + "doctypeobj.systemid: " + doctypeobj.systemid ); notes the property returns null if there is no dtd associated with the current document.
Document.documentElement - Web APIs
syntax const element = document.documentelement example const rootelement = document.documentelement; const firsttier = rootelement.childnodes; // firsttier is a nodelist of the direct children of the root element // such as <head> and <body> for (const child of firsttier) { // do something with each direct child of the root element } notes for any non-empty html document, documentelement will always be an <html> element.
Document.domConfig - Web APIs
note: this has never been implemented in mozilla, and has been removed from the dom specification.
Document.domain - Web APIs
WebAPIDocumentdomain
exceptions securityerror an attempt has been made to set domain under one of the following conditions: the document is inside a sandboxed <iframe> the document has no browsing context the document's effective domain is null the given value is not equal to the document's effective domain (or it is not a registerable domain suffix of it) the document-domain feature-policy is enabled examples getting the domain for the uri http://developer.mozilla.org/docs/web, this example sets currentdomain to the string "developer.mozilla.org".
Document.exitFullscreen() - Web APIs
document.onclick = function (event) { if (document.fullscreenelement) { document.exitfullscreen() .then(() => console.log("document exited form full screen mode")) .catch((err) => console.error(err)) } else { document.documentelement.requestfullscreen(); } } note: for a more complete example, see the example in element.requestfullscreen().
Document.forms - Web APIs
WebAPIDocumentforms
note: similarly, you can access a list of a form's component user input elements using the htmlformelement.elements property.
Document: fullscreenchange event - Web APIs
if (document.fullscreenelement) { console.log(`element: ${document.fullscreenelement.id} entered full-screen mode.`); } else { console.log('leaving full-screen mode.'); } }); see element: fullscreenchange event for another example.
Document: fullscreenerror event - Web APIs
the fullscreenerror event is fired when the browser cannot switch to full-screen mode.
Document.head - Web APIs
WebAPIDocumenthead
example <!doctype html> <head id="my-document-head"> <title>example: using document.head</title> </head> <script> var thehead = document.head; console.log(thehead.id); // "my-document-head"; console.log( thehead === document.queryselector("head") ); // true </script> notes document.head is read-only.
Document.height - Web APIs
WebAPIDocumentheight
note: starting in gecko 6.0, document.height is no longer supported.
Document.hidden - Web APIs
WebAPIDocumenthidden
the document.hidden read-only property returns a boolean value indicating if the page is considered hidden or not.
Document.images - Web APIs
WebAPIDocumentimages
usage notes you can use either javascript array notation or the item() method on the returned collection to access the items in the collection.
Document.implementation - Web APIs
notes the w3c's dom level 1 recommendation only specified the hasfeature method, which is one way to determine if a dom module is supported by a browser (see example above and what does your user agent claim to support?).
Document.linkColor - Web APIs
another alternative is document.body.link, although this is deprecated in html 4.01.
Document.mozSetImageElement() - Web APIs
specifications not part of any specification.
Document.onafterscriptexecute - Web APIs
it does not fire if the element is added dynamically, such as with appendchild().
Document.onbeforescriptexecute - Web APIs
does not fire if the element is added dynamically, eg with appendchild().
Document.onfullscreenchange - Web APIs
usage notes the fullscreenchange event does not directly specify whether the transition is into or out of full-screen mode, so your event handler should look at the value of document.fullscreenelement.
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).
Document: pointermove event - Web APIs
the pointermove event is fired when a pointer changes coordinates, and the pointer has not been canceled by a browser touch-action.
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.
Document.referrer - Web APIs
WebAPIDocumentreferrer
syntax var referrer = document.referrer; value the value is an empty string if the user navigated to the page directly (not through a link, but, for example, by using a bookmark).
Document.rootElement - Web APIs
syntax const element = document.rootelement notes if the document is a non-empty svg document, then the rootelement will be an svgsvgelement, identical to the documentelement.
Document.scrollingElement - Web APIs
when in quirks mode, the scrollingelement attribute returns the html body element if it exists and is not potentially scrollable, otherwise it returns null.
Document.selectedStyleSheetSet - Web APIs
note: this attribute's value is live; directly changing the disabled attribute on style sheets will affect the value of this attribute.
Document: selectstart event - Web APIs
if the event is canceled, the selection is not changed.
Document.styleSheetSets - Web APIs
n an <ul> (list) element with the id "sheetlist", you can populate it with the names of all the available style sheet sets with code like this: let list = document.getelementbyid('sheetlist'); let sheets = document.stylesheetsets; list.innerhtml = ''; for (let i = 0; i < sheets.length; i++) { let item = document.createelement('li'); item.innerhtml = sheets[i]; list.appendchild(item); } notes the list of available style sheet sets is constructed by enumerating all the style sheets available for the document, in the order in which they're listed in the document.stylesheets attribute, adding the title of each style sheet that has a title to the list.
Document.timeline - Web APIs
WebAPIDocumenttimeline
note: a document timeline that is associated with a non-active document is also considered to be inactive.
Document.tooltipNode - Web APIs
not part of any specification.
Document: visibilitychange event - Web APIs
bubbles yes cancelable no interface event event handler property onvisibilitychange usage notes the event doesn't include the document's updated visibility status, but you can get that information from the document's visibilitystate property.
Document.xmlEncoding - Web APIs
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).
DocumentFragment.querySelector() - Web APIs
to match id or selectors that do not follow the css syntax (by using semicolon or space inappropriately for example), it's mandatory to escape the wrong character with a double back slash: <div id="foo\bar"></div> <div id="foo:bar"></div> <script> document.queryselector('#foo\bar') // does not match anything document.queryselector('#foo\\\\bar') // match the first div document.queryselector('#foo:bar') // does not match any...
DocumentFragment - Web APIs
usage notes a common use for documentfragment is to create one, assemble a dom subtree within it, then append or insert the fragment into the dom using node interface methods such as appendchild() or insertbefore().
DocumentOrShadowRoot.elementsFromPoint() - Web APIs
script let output = document.getelementbyid("output"); if (document.elementsfrompoint) { let elements = document.elementsfrompoint(30, 20); for (var i = 0; i < elements.length; i++) { output.textcontent += elements[i].localname; if (i < elements.length - 1) { output.textcontent += " < "; } } } else { output.innerhtml = "<span style=\"color: red;\">" + "browser does not support <code>document.elementsfrompoint()</code>" + "</span>"; } specifications specification status shadow domthe definition of 'elementsfrompoint()' in that specification.
DocumentOrShadowRoot.nodeFromPoint() - Web APIs
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
div> javascript content var output = document.getelementbyid("output"); if (document.nodesfrompoint) { var nodes = document.nodesfrompoint(30, 20); for(var i = 0; i < nodes.length; i++) { output.textcontent += nodes[i].localname; if (i < nodes.length - 1) { output.textcontent += " < "; } } } else { output.innerhtml = "<span style=\"color: red;\">" + "browser does not support <code>document.nodesfrompoint()</code>" + "</span>"; } specifications not part of any specification at present.
DocumentOrShadowRoot.pointerLockElement - Web APIs
it is null if lock is pending, pointer is unlocked, or the target is in another document.
DocumentOrShadowRoot.styleSheets - Web APIs
examples function getstylesheet(unique_title) { for (var i=0; i<document.stylesheets.length; i++) { var sheet = document.stylesheets[i]; if (sheet.title == unique_title) { return sheet; } } } notes the returned list is ordered as follows: stylesheets retrieved from <link> headers are placed first, sorted in header order.
DocumentOrShadowRoot - Web APIs
it returns null if lock is pending, the pointer is unlocked, or if the target is in another document.
How to create a DOM tree - Web APIs
another application is that, since xul is xml, the ui of your application can be dynamically manipulated, downloaded, uploaded, saved, loaded, converted, or transformed quite easily.
Using the W3C DOM Level 1 Core - Web APIs
for example, the following document <html> <head> <title>my document</title> </head> <body> <h1>header</h1> <p>paragraph</p> </body> </html> has a dom tree that looks like this: (note that, although the above tree is similar to the above document's dom tree, it's not identical, as the actual dom tree preserves whitespace.) when a web browser parses an html document, it builds a dom tree and then uses it to display the document.
DragEvent() - Web APIs
although this interface has a constructor, it is not possible to create a useful datatransfer object from script, since datatransfer objects have a processing and security model that is coordinated by the browser during drag-and-drops.
DynamicsCompressorNode.attack - Web APIs
note: though the audioparam returned is read-only, the value it represents is not.
DynamicsCompressorNode.knee - Web APIs
note: though the audioparam returned is read-only, the value it represents is not.
DynamicsCompressorNode.ratio - Web APIs
note: though the audioparam returned is read-only, the value it represents is not.
DynamicsCompressorNode.release - Web APIs
note: though the audioparam returned is read-only, the value it represents is not.
DynamicsCompressorNode.threshold - Web APIs
note: though the audioparam returned is read-only, the value it represents is not.
EXT_color_buffer_float - Web APIs
this extension does not work in webgl 1 contexts.
EXT_disjoint_timer_query.getQueryObjectEXT() - Web APIs
if pname is ext.query_result_available_ext: a glboolean indicating whether or not a query result is available.
EXT_disjoint_timer_query.isQueryEXT() - Web APIs
return value a glboolean indicating whether the given object is a webglquery object (true) or not (false).
EXT_float_blend - Web APIs
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.
EffectTiming.duration - Web APIs
this value must not be negative; otherwise, it can have any value (including positive infinity).
EffectTiming.easing - Web APIs
ease-out another decelerated rate of change, going from fast to slow.
EffectTiming.endDelay - Web APIs
this is useful for sequencing animations based on the end time of another animation; note, however, that many of the sequence effectst that will benefit most from this property have not been defined in the specification yet.
EffectTiming.iterationStart - Web APIs
syntax var timingproperties = { iterationstart = iterationnumber }; timingproperties.iterationstart = iterationnumber; value a floating-point value whose value is at least 0 and is not +infinity, indicating the offset into the number of iterations the animation sequence is to run at which to start animating.
Element: MSGestureChange event - Web APIs
bubbles unknown cancelable unknown interface msgestureevent event handler property unknown specifications not part of any specification.
Element: MSGestureEnd event - Web APIs
bubbles unknown cancelable unknown interface msgestureevent event handler property unknown specifications not part of any specification.
Element: MSGestureHold event - Web APIs
msgesture_flag_end & msgesture_flag_cancel (bitwise and-ed together) this value indicates that the user has moved their finger, regardless of whether they also stopped touching the touch surface specifications not part of any specification.
Element: MSGestureStart event - Web APIs
bubbles unknown cancelable unknown interface msgestureevent event handler property unknown specifications not part of any specification.
Element: MSGestureTap event - Web APIs
bubbles unknown cancelable unknown interface msgestureevent event handler property unknown specifications not part of any specification.
Element: MSManipulationStateChanged event - Web APIs
examples // listen for panning state change events outerscroller.addeventlistener("msmanipulationstatechanged", function(e) { // check to see if they lifted while pulled to the top if (e.currentstate == ms_manipulation_state_inertia && outerscroller.scrolltop === 0) { refreshitemsasync(); } }); specifications not part of any specification.
Element.attributes - Web APIs
it is a namednodemap, not an array, so it has no array methods and the attr nodes' indexes may differ among browsers.
Element: blur event - Web APIs
the main difference between this event and focusout is that focusout bubbles while blur does not.
Element.className - Web APIs
WebAPIElementclassName
example let el = document.getelementbyid('item'); if (el.classname === 'active'){ el.classname = 'inactive'; } else { el.classname = 'active'; } notes the name classname is used for this property instead of class because of conflicts with the "class" keyword in many languages which are used to manipulate the dom.
Element.computedStyleMap() - Web APIs
update the 'a' to the 'p', and you'll notice a difference in the margin-top and margin-bottom default computed values.
Element.currentStyle - Web APIs
* http://creativecommons.org/publicdomain/zero/1.0/ */ if (!("currentstyle" in element.prototype)) { object.defineproperty(element.prototype, "currentstyle", { get: function() { return window.getcomputedstyle(this); } }); } specification not part of any specification.
Element: focus event - Web APIs
the main difference between this event and focusin is that focusin bubbles while focus does not.
Element: focusin event - Web APIs
the main difference between this event and focus is that focusin bubbles while focus does not.
Element: focusout event - Web APIs
the main difference between this event and blur is that focusout bubbles while blur does not.
Element: fullscreenerror event - Web APIs
the fullscreenerror event is fired when the browser cannot switch to full-screen mode.
Element: gesturechange event - Web APIs
bubbles unknown cancelable unknown interface gestureevent event handler property unknown specifications not part of any specification.
Element: gestureend event - Web APIs
bubbles unknown cancelable unknown interface gestureevent event handler property unknown specifications not part of any specification.
Element: gesturestart event - Web APIs
bubbles unknown cancelable unknown interface gestureevent event handler property unknown specifications not part of any specification.
Element.getAnimations() - Web APIs
note: this array includes css animations, css transitions, and web animations.
Element.getElementsByTagNameNS() - Web APIs
note that only the descendants of this element are included in the search, not the node itself.
Element.hasAttributeNS() - Web APIs
example // check that the attribute exists before you set a value var d = document.getelementbyid("div1"); if (d.hasattributens( "http://www.mozilla.org/ns/specialspace/", "special-align")) { d.setattribute("align", "center"); } notes dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) ge...
Element.hasAttributes() - Web APIs
the hasattributes() method of the element interface returns a boolean indicating whether the current element has any attributes or not.
Element: mousedown event - Web APIs
note: this differs from the click event in that click is fired after a full click action occurs; that is, the mouse button is pressed and released while the pointer remains inside the same element.
Element: mouseenter event - Web APIs
bubbles no cancelable no interface mouseevent event handler property onmouseenter usage notes though similar to mouseover, mouseenter differs in that it doesn't bubble and it isn't sent to any descendants when the pointer is moved from one of its descendants' physical space to its own physical space.
Element: mouseleave event - Web APIs
bubbles no cancelable no interface mouseevent event handler property onmouseleave mouseleave and mouseout are similar but differ in that mouseleave does not bubble and mouseout does.
Element: msContentZoom event - Web APIs
bubbles unknown cancelable unknown interface unknown event handler property unknown example contentzoom.addeventlistener("mscontentzoom", function(e) { zoomfactor.value = contentzoom.mscontentzoomfactor.tofixed(2); }); specifications not part of any specification.
Element: overflow event - Web APIs
eventlistener("underflow", function( event ) { console.log( event ); }, false); toggle.addeventlistener("change", function( event ) { if ( event.target.checked ) { child.style.width = "40px"; child.style.height = "40px"; } else { child.style.width = "10px"; child.style.height = "10px"; } }, false); </script> specifications not part of any specification.
Element: paste event - Web APIs
it's possible to construct and dispatch a synthetic paste event, but this will not affect the document's contents.
Element.releasePointerCapture() - Web APIs
exceptions exception explanation invalidpointerid pointerid does not match any of the active pointers.
Element.removeAttributeNS() - Web APIs
example // given: // <div id="div1" xmlns:special="http://www.mozilla.org/ns/specialspace" // special:specialalign="utterleft" width="200px" /> d = document.getelementbyid("div1"); d.removeattributens("http://www.mozilla.org/ns/specialspace", "specialalign"); // now: <div id="div1" width="200px" /> notes dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) ge...
Element.scrollIntoView() - Web APIs
example var element = document.getelementbyid("box"); element.scrollintoview(); element.scrollintoview(false); element.scrollintoview({block: "end"}); element.scrollintoview({behavior: "smooth", block: "end", inline: "nearest"}); notes the element may not be scrolled completely to the top or bottom depending on the layout of other elements.
Element.scrollLeftMax - Web APIs
syntax var pxl = element.scrollleftmax; specifications this property is not part of any specification.
Element.scrollTop - Web APIs
WebAPIElementscrollTop
when an element's content does not generate a vertical scrollbar, then its scrolltop value is 0.
Element.scrollTopMax - Web APIs
syntax var pxl = elt.scrolltopmax; specifications this property is not part of any specification.
Element: select event - Web APIs
bubbles yes cancelable no interface uievent if generated from a user interface, event otherwise event handler property onselect the event is not available for all elements in all languages.
Element.setAttributeNS() - Web APIs
example let d = document.getelementbyid('d1'); d.setattributens('http://www.mozilla.org/ns/specialspace', 'spec:align', 'center'); notes dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) ge...
Element.setCapture() - Web APIs
tion mousemoved(e) { var output = document.getelementbyid("output"); output.innerhtml = "position: " + e.clientx + ", " + e.clienty; } </script> </head> <body onload="init()"> <p>this is an example of how to use mouse capture on elements in gecko 2.0.</p> <p><a id="mybutton" href="#">test me</a></p> <div id="output">no events yet</div> </body> </html> view live examples notes the element may not be scrolled completely to the top or bottom, depending on the layout of other elements.
Element: webkitmouseforcechanged event - Web APIs
specifications not part of any specification.
Element: webkitmouseforcedown event - Web APIs
specifications not part of any specification.
Element: webkitmouseforceup event - Web APIs
specifications not part of any specification.
ElementCSSInlineStyle - Web APIs
note: elementcssinlinestyle is a mixin and not an interface; you can't actually create an object of type elementcssinlinestyle.
ElementTraversal - Web APIs
the elementtraversal interface used to define methods that allowed access from one node to another in the document tree.
Event() - Web APIs
WebAPIEventEvent
example // create a look event that bubbles up and cannot be canceled const evt = new event("look", {"bubbles":true, "cancelable":false}); document.dispatchevent(evt); // event can be dispatched from any element, not only the document mydiv.dispatchevent(evt); specifications specification status comment domthe definition of 'event()' in that specification.
Event.cancelBubble - Web APIs
in later implementations, setting this to false does nothing.
Event.currentTarget - Web APIs
rrenttarget); // when this function is used as an event handler: this === e.currenttarget } var ps = document.getelementsbytagname('p'); for(var i = 0; i < ps.length; i++){ // console: print the clicked <p> element ps[i].addeventlistener('click', hide, false); } // console: print <body> document.body.addeventlistener('click', hide, false); // click around and make paragraphs disappear note: the value of event.currenttarget is only available while the event is being handled.
Event.explicitOriginalTarget - Web APIs
defined in /dom/public/idl/events/nsidomnsevent.idl this event property is not defined in the w3.org dom level 2 events ...
Event.stopPropagation() - Web APIs
it does not, however, prevent any default behaviors from occurring; for instance, clicks on links are still processed.
Event.timeStamp - Web APIs
WebAPIEventtimeStamp
note: this property only works if the event system supports it for the particular event.
EventListener - Web APIs
note: due to the need for compatibility with legacy content, eventlistener accepts both a function and an object with a handleevent() property function.
EventSource() - Web APIs
examples var evtsource = new eventsource('sse.php'); var eventlist = document.queryselector('ul'); evtsource.onmessage = function(e) { var newelement = document.createelement("li"); newelement.textcontent = "message: " + e.data; eventlist.appendchild(newelement); } note: you can find a full example on github — see simple sse demo using php.
EventSource.onerror - Web APIs
syntax eventsource.onerror = function examples evtsource.onerror = function() { console.log("eventsource failed."); }; note: you can find a full example on github — see simple sse demo using php.
EventSource.onmessage - Web APIs
syntax eventsource.onmessage = function examples evtsource.onmessage = function(e) { var newelement = document.createelement("li"); newelement.textcontent = "message: " + e.data; eventlist.appendchild(newelement); } note: you can find a full example on github — see simple sse demo using php.
EventSource.onopen - Web APIs
syntax eventsource.onopen = function examples evtsource.onopen = function() { console.log("connection to server opened."); }; note: you can find a full example on github — see simple sse demo using php.
EventSource.readyState - Web APIs
possible values are: 0 — connecting 1 — open 2 — closed examples var evtsource = new eventsource('sse.php'); console.log(evtsource.readystate); note: you can find a full example on github — see simple sse demo using php.
EventSource.url - Web APIs
WebAPIEventSourceurl
examples var evtsource = new eventsource('sse.php'); console.log(evtsource.url); note: you can find a full example on github — see simple sse demo using php.
ExtendableMessageEvent - Web APIs
the extendablemessageevent interface of the service worker api represents the event object of a message event fired on a service worker (when a message is received on the serviceworkerglobalscope from another context) — extends the lifetime of such events.
FeaturePolicy.allowedFeatures() - Web APIs
please note that these features might be restricted by the permissions api, if the user did not grant the corrsponding permission yet.
FeaturePolicy.features() - Web APIs
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.
FetchEvent.client - Web APIs
WebAPIFetchEventclient
note: this feature has been deprecated, with its functionality replaced by fetchevent.clientid and clients.get().
FetchEvent.isReload - Web APIs
pressing the refresh button is a reload while clicking a link and pressing the back button is not.
FetchEvent.replacesClientId - Web APIs
it can be an empty string when navigating from about:blank to another page, as about:blank's client will be reused, rather than be replaced.
Fetch basic concepts - Web APIs
note: this article will be added to over time.
Cross-global fetch usage - Web APIs
frame.contentwindow.fetch() the url passed to fetch needs to be relative the problem in the past we would resolve the relative url against the current global, for example: let absolute = new url(relative, window.location.href) this is not a problem as such.
File.fileSize - Web APIs
WebAPIFilefileSize
specification not part of any specification.
File.mozFullPath - Web APIs
WebAPIFilemozFullPath
it is not available to web content.
File.size - Web APIs
WebAPIFilesize
syntax var size = instanceoffile.size value a number specification not part of any specification.
FileList - Web APIs
WebAPIFileList
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.
FileReader: error event - Web APIs
the error event is fired when the read failed due to an error (for example, because the file was not found or not readable).
FileReader: loadend event - Web APIs
the loadend event is fired when a file read has completed, successfully or not.
onerror - Web APIs
the filereader onerror handler receives an event object, not an error object, as a parameter, but an error can be accessed from the filereader object, as instanceoffilereader.error // callback from a <input type="file" onchange="onchange(event)"> function onchange(event) { var file = event.target.files[0]; var reader = new filereader(); reader.onerror = function(event) { alert("failed to read file!\n\n" + reader.error); reader.abort(); // (...does this do anything useful in an onerror handler?) }; reader.readastext(file); } ...
FileReader.readAsBinaryString() - Web APIs
note that this method was once removed from the file api specification, but re-introduced for backward compatibility.
FileReader.readAsText() - Web APIs
by default, utf-8 is assumed if this parameter is not specified.
FileReader.result - Web APIs
WebAPIFileReaderresult
the value is null if the reading is not yet complete or was unsuccessful.
FileSystemEntry.getParent() - Web APIs
fileerror.not_found_err the specified path could not be found.
FileSystemFileEntry.file() - Web APIs
editor's note: we need to find out what kinds of errors can occur and document them.
FocusEvent.relatedTarget - Web APIs
focus the eventtarget receiving focus the eventtarget losing focus (if any) focusin the eventtarget receiving focus the eventtarget losing focus (if any) focusout the eventtarget losing focus the eventtarget receiving focus (if any) note that many elements can't have focus, which is a common reason for relatedtarget to be null.
FontFace.featureSettings - Web APIs
the featuresettings property of the fontface interface retrieves or sets infrequently used font features that are not available from a font's variant properties.
FontFace - Web APIs
WebAPIFontFace
fontface.featuresettings a cssomstring that retrieves or sets infrequently used font features that are not available from a font's variant properties.
FontFaceSet.check() - Web APIs
WebAPIFontFaceSetcheck
this does not check for individual glyph coverage.
FontFaceSet.load() - Web APIs
WebAPIFontFaceSetload
this does not check for individual glyph coverage.
FormData.delete() - Web APIs
WebAPIFormDatadelete
note: this method is available in web workers.
FormData.entries() - Web APIs
WebAPIFormDataentries
note: this method is available in web workers.
FormData.get() - Web APIs
WebAPIFormDataget
note: this method is available in web workers.
FormData.getAll() - Web APIs
WebAPIFormDatagetAll
note: this method is available in web workers.
FormData.has() - Web APIs
WebAPIFormDatahas
note: this method is available in web workers.
FormData.keys() - Web APIs
WebAPIFormDatakeys
note: this method is available in web workers.
FormData.values() - Web APIs
WebAPIFormDatavalues
note: this method is available in web workers.
FormDataEntryValue - Web APIs
note that the formdata.append() and formdata.set() methods allow passing a blob value, which is converted to a file in the process.
FullscreenOptions.navigationUI - Web APIs
let elem = document.documentelement; elem.requestfullscreen({ navigationui: "show" }).then({}).catch(err => { alert(`an error occurred while trying to switch into full-screen mode: ${err.message} (${err.name})`); }); the promise's resolve handler does nothing, but if the promise is rejected, an error message is displayed by calling alert().
FullscreenOptions - Web APIs
properties navigationuioptional a string controlling whether or not to keep browser user interface elements visible while the element is in full-screen mode.
Gamepad.connected - Web APIs
WebAPIGamepadconnected
if the gamepad is connected, the value is true; if not, it is false.
Gamepad.hand - Web APIs
WebAPIGamepadhand
empty string ("") — this value is returned if the other values are not applicable, e.g.
Gamepad.id - Web APIs
WebAPIGamepadid
the exact syntax is not strictly specified, but in firefox it will contain three pieces of information separated by dashes (-): two 4-digit hexadecimal strings containing the usb vendor and product id of the controller the name of the controller as provided by the driver.
GamepadButton.value - Web APIs
the values are normalized to the range 0.0 — 1.0, with 0.0 representing a button that is not pressed, and 1.0 representing a button that is fully pressed.
GamepadHapticActuator.pulse() - Web APIs
note: repeated calls to pulse() override the previous calls if they are still ongoing.
Geolocation - Web APIs
note: for security reasons, when a web page tries to access location information, the user is notified and asked to grant permission.
GeolocationCoordinates.altitude - Web APIs
this value is null if the implementation cannot provide this data.
GeolocationCoordinates.heading - Web APIs
if the device is not able to provide heading information, this value is null.
GeolocationCoordinates.longitude - Web APIs
note: the zero meridian (also known as the prime meridian or the reference meridian) is not precisely the same as the greenwhich meridian that most people think of.
GeolocationCoordinates.speed - Web APIs
this value is null if the implementation is not able to measure it.
GeolocationCoordinates - Web APIs
this value can be null if the implementation cannot provide the data.
GeolocationPositionError - Web APIs
specifications note that this is primarily intended for debugging use and not to be shown directly in a user interface.
Geolocation API - Web APIs
longitude = 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 ...
GeometryUtils - Web APIs
properties this interface does not implement any properties.
GlobalEventHandlers.onloadstart - Web APIs
notes see the dom event handlers page for information on working with on...
GlobalEventHandlers.onabort - Web APIs
while the standard for aborting a document load is defined, html issue #3525 suggests that browsers should not currently fire the abort event on a window that would trigger onabort to be called.
GlobalEventHandlers.onanimationcancel - Web APIs
note the use of animationevent.animationname and animationevent.elapsedtime to get information about the event which occurred.
GlobalEventHandlers.onblur - Web APIs
note: the opposite of onblur is onfocus.
GlobalEventHandlers.oncancel - Web APIs
this event handler prevents the event from bubbling, so any parent handlers are not notified of the event.
GlobalEventHandlers.oncanplay - Web APIs
the canplay event is fired when the user agent can play the media, but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content.
GlobalEventHandlers.onchange - Web APIs
note: unlike oninput, the onchange event handler is not necessarily called for each alteration to an element's value.
GlobalEventHandlers.onclick - Web APIs
note: when using the click event to trigger an action, also consider adding this same action to the keydown event, to allow the use of that same action by people who don't use a mouse or a touch screen.
GlobalEventHandlers.onclose - Web APIs
note: to handle the closing of a window, use onbeforeunload or onunload.
GlobalEventHandlers.onemptied - Web APIs
notes see the dom event handlers page for information on working with on...
GlobalEventHandlers.onfocus - Web APIs
note: the opposite of onfocus is onblur.
GlobalEventHandlers.oninput - Web APIs
note: unlike oninput, the onchange event handler is not necessarily called for each alteration to an element's value.
GlobalEventHandlers.onmousedown - Web APIs
note: the opposite of onmousedown is onmouseup.
GlobalEventHandlers.onmouseup - Web APIs
note: the opposite of onmouseup is onmousedown.
GlobalEventHandlers.onplay - Web APIs
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.
GlobalEventHandlers.onpointerdown - Web APIs
if the pointerdown event isn't canceled through a call to preventdefault(), most user agents will fire a mousedown event, so that sites not using pointer events will work.
GlobalEventHandlers.onscroll - Web APIs
note: don't confuse onscroll with onwheel!
GlobalEventHandlers.onwheel - Web APIs
note: don't confuse onwheel with onscroll: onwheel handles general wheel rotation, while onscroll handles scrolling of an object's content.
Gyroscope.Gyroscope() - Web APIs
this is not something that would ever be shown to a user.
Gyroscope.x - Web APIs
WebAPIGyroscopex
this is not something that would ever be shown to a user.
Gyroscope.y - Web APIs
WebAPIGyroscopey
this is not something that would ever be shown to a user.
Gyroscope.z - Web APIs
WebAPIGyroscopez
this is not something that would ever be shown to a user.
Gyroscope - Web APIs
WebAPIGyroscope
this is not something that would ever be shown to a user.
HTMLAnchorElement.relList - Web APIs
the property itself is read-only, meaning you can't substitute the domtokenlist with another one, but its contents can still be changed.
HTMLAreaElement.relList - Web APIs
the property itself is read-only, meaning you can't substitute the domtokenlist by another one, but the content of the returned list can be changed.
Audio() - Web APIs
usage notes you can also use other element-creation methods, such as the document object's createelement() method, to construct a new htmlaudioelement.
HTMLAudioElement - Web APIs
obsolete mozilla-only methods the following methods are non-standard and should not be used.
HTMLBaseElement - Web APIs
htmlbaseelement.target is a domstring that reflects the target html attribute, containing a default target browsing context or frame for elements that do not have a target reference specified.
disabled - Web APIs
is a boolean indicating whether or not the control is disabled, meaning that it does not accept any clicks.
HTMLCanvasElement.height - Web APIs
when the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used.
HTMLCanvasElement.mozGetAsFile() - Web APIs
k', copy); } function copy() { var canvas = document.getelementbyid('canvas'); var f = canvas.mozgetasfile('test.png'); var reader = new filereader(); reader.readasdataurl(f); reader.onloadend = function() { var newimg = document.createelement('img'); newimg.src = reader.result; document.body.appendchild(newimg); } } window.addeventlistener('load', draw); specifications not part of any specification.
HTMLCanvasElement.width - Web APIs
when the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used.
HTMLDetailsElement - Web APIs
htmldetailselement.open is a boolean reflecting the open html attribute, indicating whether or not the element’s contents (not counting the <summary>) is to be shown to the user.
HTMLDialogElement: cancel event - Web APIs
.queryselector('.example-dialog'); dialog.addeventlistener('cancel', (event) => { result.textcontent = 'dialog was canceled'; }); const opendialog = document.queryselector('.open-dialog'); opendialog.addeventlistener('click', () => { if (typeof dialog.showmodal === 'function') { dialog.showmodal(); result.textcontent = ''; } else { result.textcontent = 'the dialog api is not supported by this browser'; } }); const closebutton = document.queryselector('.close'); closebutton.addeventlistener('click', () => { dialog.close(); }); result specifications specification status html living standardthe definition of 'cancel' in that specification.
HTMLDialogElement.close() - Web APIs
log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also).
HTMLDialogElement: close event - Web APIs
nt.queryselector('.example-dialog'); dialog.addeventlistener('close', (event) => { result.textcontent = 'dialog was closed'; }); const opendialog = document.queryselector('.open-dialog'); opendialog.addeventlistener('click', () => { if (typeof dialog.showmodal === 'function') { dialog.showmodal(); result.textcontent = ''; } else { result.textcontent = 'the dialog api is not supported by this browser'; } }); const closebutton = document.queryselector('.close'); closebutton.addeventlistener('click', () => { dialog.close(); }); result specifications specification status html living standardthe definition of 'close' in that specification.
HTMLDialogElement.returnValue - Web APIs
nt.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if (dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } function handleuserinput(returnvalue) { if (returnvalue === 'cancel' || returnvalue == null) { // user canceled the dialog, do nothing } else if (returnvalue === 'confirm') { // user chose a favorite animal, do something with it } } // “update details” button opens the <dialog> modally updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); handleuserinput(dialog.returnvalue); }); })(); </script> note: yo...
HTMLDialogElement.show() - Web APIs
log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> specifications specification status comment html living standardthe definition of 'show()' in that specification.
HTMLDialogElement.showModal() - Web APIs
log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also).
HTMLDialogElement - Web APIs
log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also).
HTMLElement: animationend event - Web APIs
if the animation aborts before reaching completion, such as if the element is removed from the dom or the animation is removed from the element, the animationend event is not fired.
HTMLElement.dir - Web APIs
WebAPIHTMLElementdir
firefox uses ctrl/cmd + shift + x but does not update the dir attribute value.
HTMLElement.forceSpellCheck() - Web APIs
the forcespellcheck() method of the htmlelement interface forces a spelling and grammar check on html elements, even if the user has not focused on the elements.
HTMLElement.offsetLeft - Web APIs
therefore, a box with the left, top, width and height of offsetleft, offsettop, offsetwidth and offsetheight will not be a bounding box for a span with wrapped text.
HTMLElement.offsetParent - Web APIs
note: offsetparent returns null in the following situations: the element or its parent element has the display property set to none.
HTMLElement.offsetTop - Web APIs
(having display:none does not affect this browser.) ...
HTMLElement.onpaste - Web APIs
note that there is currently no dom-only way to obtain the text being pasted; you'll have to use an nsiclipboard to get that information.
HTMLElement.outerText - Web APIs
specification not part of any specification.
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).
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.
HTMLElement: transitioncancel event - Web APIs
if the transitioncancel event is fired, the transitionend event will not fire.
HTMLEmbedElement - Web APIs
it does not address earlier, non-standardized version of the interface.
HTMLFontElement.color - Web APIs
green valid hex color string in rgb format: #rrggbb #008000 rgb using decimal values rgb(x,x,x) (x in 0-255 range) rgb(0,128,0) syntax colorstring = fontobj.color; fontobj.color = colorstring; examples // assumes there is <font id="f"> element in the html var f = document.getelementbyid("f"); f.color = "green"; specifications the <font> tag is not supported in html5 and as a result neither is <font>.color.
HTMLFontElement.face - Web APIs
description examples list of one or more valid font family names a list of font names, that have to be present on the local system courier,verdana syntax facestring = fontobj.face; fontobj.face = facestring; examples // assumes there is <font id="f"> element in the html var f = document.getelementbyid("f"); f.face = "arial"; specifications the <font> tag is not supported in html5 and as a result neither is <font>.face .
HTMLFontElement.size - Web APIs
ng +x or -x, where x is the number relative to the value of the size attribute of the <basefont> element (the result should be in the same range of 1-7) +2 -1 syntax sizestring = fontobj.size; fontobj.size = sizestring; examples // assumes there is <font id="f"> element in the html var f = document.getelementbyid("f"); f.size = "6"; specifications the <font> tag is not supported in html5 and as a result neither is <font>.size .
HTMLFontElement - Web APIs
specifications the <font> tag is not supported in html5 since it is now obsolete.
HTMLFormControlsCollection.namedItem() - Web APIs
note that this version of nameditem() hides the one inherited from htmlcollection.
HTMLFormControlsCollection - Web APIs
note that this version of nameditem() hide the one inherited from htmlcollection.
HTMLFormElement.elements - Web APIs
note: similarly, you can get a list of all of the forms contained within a given document using the document's forms property.
HTMLFormElement.name - Web APIs
internet explorer (ie) does not allow the name attribute of an element created using createelement() to be set or modified using the name property.
HTMLFormElement.reset() - Web APIs
it does not reset other attributes in the input, such as disabled.
HTMLFormElement: reset event - Web APIs
recommendation added info that the event is not trusted.
HTMLHtmlElement - Web APIs
this property should not be used any more as it is non-conforming.
HTMLHyperlinkElementUtils.host - Web APIs
syntax string = object.host; object.host = string; examples var anchor = document.createelement("a"); anchor.href = "https://developer.mozilla.org/htmlhyperlinkelementutils.host" anchor.host == "developer.mozilla.org" anchor.href = "https://developer.mozilla.org:443/htmlhyperlinkelementutils.host" anchor.host == "developer.mozilla.org" // the port number is not included because 443 is the scheme's default port anchor.href = "https://developer.mozilla.org:4097/htmlhyperlinkelementutils.host" anchor.host == "developer.mozilla.org:4097" specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.host' in that specification.
HTMLHyperlinkElementUtils.origin - Web APIs
note: this feature is available in web workers.
HTMLHyperlinkElementUtils.port - Web APIs
if the url does not contain an explicit port number, it will be set to ''.
HTMLIFrameElement.setNfcFocus() - Web APIs
specifications not part of any specification.
HTMLIFrameElement - Web APIs
note that programatically removing an <iframe>'s src attribute (e.g.
HTMLImageElement.align - Web APIs
it may be worth noting that vertical-align offers several additional options for its value; you may wish to consider these when changing your code to use it.
HTMLImageElement.decode() - Web APIs
usage notes one potential use case for decode(): when loading very large images (for example, in an online photo album), you can present a low resolution thumbnail image initially and then replace that image with the full-resolution image by instantiating a new htmlimageelement, setting its source to the full-resolution image's url, then using decode() to get a promise which is resolved once the full-reso...
HTMLImageElement.decoding - Web APIs
usage notes the decoding property allows you to control whether or not the browser is allowed to try to parallelize loading your image.
HTMLImageElement.height - Web APIs
the terms in which the height is defined depends on whether the image is being rendered to a visual medium or not.
HTMLImageElement.longDesc - Web APIs
usage notes this property is obsolete and should no longer be used.
HTMLImageElement.name - Web APIs
recommendation provides additional details not available in the html 5 browser compatibility the compatibility table on this page is generated from structured data.
HTMLImageElement.src - Web APIs
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.
HTMLImageElement.useMap - Web APIs
usage notes the string value of usemap must be a valid anchor for a <map> element.
HTMLImageElement.vspace - Web APIs
usage notes the value specified for vspace is mapped to the margin-top and margin-bottom properties to specify the height of those margins in pixels.
HTMLImageElement.width - Web APIs
the terms in which the width is defined depends on whether the image is being rendered to a visual medium or not.
HTMLImageElement.x - Web APIs
note: the x property is only valid if the computed value of the image's display property is either table-column or table-column-group; in other words, either of those are set directly on the <img> or they're inherited from a containing element or by being located within a column described by either <col> or <colgroup>.
HTMLImageElement.y - Web APIs
note: the y property is only valid if the computed value of the image's display property is either table-column or table-column-group; in other words, either of those are set directly on the <img> or they're inherited from a containing element or by being located within a column described by either <col> or <colgroup>.
HTMLInputElement: invalid event - Web APIs
it is not checked on blur.
HTMLInputElement.mozGetFileNameArray() - Web APIs
note: this method is gecko-specific and is not available in other browsers.
HTMLInputElement.mozSetFileNameArray() - Web APIs
note: this method is gecko-specific and is not available in other browsers.
HTMLInputElement: search event - Web APIs
ples // addeventlistener version const input = document.queryselector('input[type="search"]'); input.addeventlistener('search', () => { console.log("the term searched for was " + input.value); }) // onsearch version const input = document.queryselector('input[type="search"]'); input.onsearch = () => { console.log("the term searched for was " + input.value); }) specifications this event is not part of any specification.
HTMLInputElement.setRangeText() - Web APIs
html <input type="text" id="text-box" size="30" value="this text has not been updated."> <button onclick="selecttext()">update text</button> javascript function selecttext() { const input = document.getelementbyid('text-box'); input.focus(); input.setrangetext('already', 14, 17, 'select'); } result specifications specification status comment html living standardthe definition of 'htmlinputelement.setselectionrange()' in that s...
HTMLLIElement - Web APIs
if the <li> element is not a child of an <ol> element, the property has no meaning.
HTMLLinkElement.relList - Web APIs
the property itself is read-only, meaning you can substitute the domtokenlist by another one, but the content of the returned list can be changed.
HTMLMapElement - Web APIs
if the id attribute is set, this must have the same value; and it cannot be null or empty.
HTMLMediaElement: abort event - Web APIs
the abort event is fired when the resource was not fully loaded, but not as the result of an error.
HTMLMediaElement.audioTracks - Web APIs
the list of tracks can be accessed using array notation, or using the object's gettrackbyid() method.
HTMLMediaElement.buffered - Web APIs
note: this feature is not available in web workers.
HTMLMediaElement.captureStream() - Web APIs
the stream can then be used for other purposes—like a source for streaming over webrtc, to allow sharing prerecorded videos with another person during a video call.
HTMLMediaElement.defaultPlaybackRate - Web APIs
the value 0.0 is invalid and throws a not_supported_err exception.
HTMLMediaElement.disableRemotePlayback - Web APIs
(false means "not disabled", which means "enabled") example var obj = document.createelement('audio'); obj.disableremoteplayback = true; specifications specification status comment remote playback apithe definition of 'disableremoteplayback' in that specification.
HTMLMediaElement: durationchange event - Web APIs
using addeventlistener(): const video = document.queryselector('video'); video.addeventlistener('durationchange', (event) => { console.log('not sure why, but the duration of the video has changed.'); }); using the ondurationchange event handler property: const video = document.queryselector('video'); video.ondurationchange = (event) => { console.log('not sure why, but the duration of the video has changed.'); }; specifications specification status html living standardthe definition of 'durationchange media eve...
HTMLMediaElement.error - Web APIs
the htmlmediaelement.error is the mediaerror object for the most recent error, or null if there has not been an error.
HTMLMediaElement: error event - Web APIs
the error event is fired when the resource could not be loaded due to an error (for example, a network connectivity problem).
HTMLMediaElement.fastSeek() - Web APIs
note: if you need to seek with precision, you should set htmlmediaelement.currenttime instead.
HTMLMediaElement: loadeddata event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onloadeddata specification html5 media note that this event will not fire in mobile/tablet devices if data-saver is on in browser settings.
HTMLMediaElement.muted - Web APIs
true means muted and false means not muted.
HTMLMediaElement.onencrypted - Web APIs
the onencrypted property of the htmlmediaelement is an event handler, fired whenever an encrypted event occurs, denoting the media is encrypted.
HTMLMediaElement.paused - Web APIs
true is paused and false is not paused.
HTMLMediaElement.playbackRate - Web APIs
if playbackrate is negative, the media is not played backwards.
HTMLMediaElement.src - Web APIs
note: the best way to know the url of the media resource currently in active use in this element is to look at the value of the currentsrc attribute, which also takes into account selection of a best or preferred media resource from a list provided in an htmlsourceelement (which represents a <source> element).
HTMLMediaElement: stalled event - Web APIs
the stalled event is fired when the user agent is trying to fetch media data, but data is unexpectedly not forthcoming.
HTMLMedia​Element​.textTracks - Web APIs
the list of tracks can be accessed using array notation, or using the object's gettrackbyid() method.
HTMLMediaElement: timeupdate event - Web APIs
user agents are encouraged to vary the frequency of the event based on the system load and the average cost of processing the event each time, so that the ui updates are not any more frequent than the user agent can comfortably handle while decoding the video.
HTMLMediaElement.videoTracks - Web APIs
the list of tracks can be accessed using array notation, or using the object's gettrackbyid() method.
HTMLMeterElement - Web APIs
methods this interface does not implement any specific methods but inherits methods from its parent, htmlelement.
HTMLOptGroupElement - Web APIs
htmloptgroupelement.disabled is a boolean representing whether or not the whole list of children <option> is disabled (true) or not (false).
HTMLOrForeignElement - Web APIs
note: htmlorforeignelement is a mixin and not an interface; you can't actually create an object of type htmlorforeignelement.
HTMLQuoteElement - Web APIs
the htmlquoteelement interface provides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating quoting elements, like <blockquote> and <q>, but not the <cite> element.
HTMLSelectElement.disabled - Web APIs
if it is disabled, it does not accept clicks.
HTMLSelectElement.form - Web APIs
if the element is not associated with of a <form> element, then it returns null.
HTMLSelectElement.remove() - Web APIs
if the index is not found the method has no effect.
HTMLSelectElement.setCustomValidity() - Web APIs
use the empty string to indicate that the element does not have a custom validity error.
HTMLSlotElement.assignedElements() - Web APIs
the available options are: flatten: a boolean indicating whether to return the assigned elements of any available child <slot> elements (true) or not (false).
HTMLSlotElement.assignedNodes() - Web APIs
the available options are: flatten: a boolean indicating whether to return the assigned nodes of any available child <slot> elements (true) or not (false).
HTMLSlotElement: slotchange event - Web APIs
note: the slotchange event doesn't fire if the children of a slotted node change — only if you change (e.g.
HTMLSourceElement - Web APIs
note: if the src property is updated (along with any siblings), the parent htmlmediaelement's load method should be called when done, since <source> elements are not re-scanned automatically.
HTMLStyleElement.type - Web APIs
for gecko, the type is most often given as "text/css." from the w3c spec on css: "the expectation is that binding-specific casting methods can be used to cast down from an instance of the cssrule interface to the specific derived interface implied by the type." syntax string = style.type; example if (newstyle.type != "text/css"){ // not supported!
HTMLStyleElement - Web APIs
htmlstyleelement.disabled is a boolean value representing whether or not the stylesheet is disabled (true) or not (false).
HTMLTableElement.deleteCaption() - Web APIs
if there is no <caption> element associated with the table, this method does nothing.
HTMLTableElement.deleteRow() - Web APIs
return value no return value errors thrown if the number of the row to delete, specified by the parameter, is greater or equal to the number of available rows, or if it is negative and not equal to the special index -1, representing the last row of the table, the exception index_size_err is thrown.
HTMLTableElement.tBodies - Web APIs
for example: <table> <tr> <td>cell one</td> </tr> </table> the html dom generated from the above html will have a <tbody> element even though the tags are not included in the source html.
HTMLTableRowElement.rowIndex - Web APIs
syntax var index = htmltablerowelement.rowindex value returns the index of the row, or -1 if the row is not part of a table.
HTMLVideoElement.getVideoPlaybackQuality() - Web APIs
this value includes any dropped or corrupted frames, so it's not the same as "total number of frames played." var videoelem = document.getelementbyid("my_vid"); var counterelem = document.getelementbyid("counter"); var quality = videoelem.getvideoplaybackquality(); counterelem.innertext = quality.totalvideoframes; specifications specification status comment media playback qualitythe definition of 'htmlvideoelement.getvideoplaybackq...
HTMLVideoElement.msIsStereo3D - Web APIs
msisstereo3d is a read-only property which determines whether the system considers the loaded video source to be stereo 3-d or not.
HTMLVideoElement - Web APIs
htmlvideoelement.msisstereo3d read only determines whether the system considers the loaded video source to be stereo 3-d or not.
Headers() - Web APIs
WebAPIHeadersHeaders
in the following snippet we create a new headers object, adding some headers by passing the constructor an init object as an argument: var httpheaders = { 'content-type' : 'image/jpeg', 'accept-charset' : 'utf-8', 'x-my-custom-header' : 'zeke are cool' }; var myheaders = new headers(httpheaders); you can now create another headers object, passing it the first headers object as its init object: var secondheadersobj = new headers(myheaders); secondheadersobj.get('content-type'); // would return 'image/jpeg' — it inherits it from the first headers object specifications specification status comment fetchthe definition of 'headers()' in that specification.
Headers.append() - Web APIs
WebAPIHeadersappend
the append() method of the headers interface appends a new value onto an existing header inside a headers object, or adds the header if it does not already exist.
Headers.delete() - Web APIs
WebAPIHeadersdelete
this method throws a typeerror for the following reasons: the value of the name parameter is not the name of an http header.
Headers.entries() - Web APIs
WebAPIHeadersentries
note: this method is available in web workers.
Headers.has() - Web APIs
WebAPIHeadershas
if the given name is not a valid http header name, this method throws a typeerror.
Headers.keys() - Web APIs
WebAPIHeaderskeys
note: this method is available in web workers.
Headers.values() - Web APIs
WebAPIHeadersvalues
note: this method is available in web workers.
History.back() - Web APIs
WebAPIHistoryback
if there is no previous page, this method call does nothing.
HkdfParams - Web APIs
unlike the input key material passed into derivekey(), salt does not need to be kept secret.
IDBCursor.request - Web APIs
WebAPIIDBCursorrequest
note: this feature is available in web workers.
IDBDatabase: abort event - Web APIs
bubbles yes cancelable no interface event event handler property onabort examples this example opens a database (creating the database if it does not exist), then opens a transaction, adds a listener to the abort event, then aborts the transaction to trigger the event.
IDBDatabase: close event - Web APIs
note that it is not fired if the database connection is closed normally using idbdatabase.close().
IDBEnvironmentSync - Web APIs
note: until the indexed database api specification is finalized, this attribute should be accessed as moz_indexeddbsync.
IDBFactorySync - Web APIs
exceptions this method can raise an idbdatabaseexception with the following codes: non_transient_err if the name parameter is not valid.
IDBIndex.getAll() - Web APIs
WebAPIIDBIndexgetAll
a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included.
IDBIndex.getAllKeys() - Web APIs
a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included.
IDBObjectStore.count() - Web APIs
note: this feature is available in web workers.
IDBObjectStore.getAllKeys() - Web APIs
that method provides a cursor if the record exists, and no cursor if it does not.
IDBObjectStore.getKey() - Web APIs
note: this feature is available in web workers.
IDBTransaction: abort event - Web APIs
examples this example opens a database (creating the database if it does not exist), then opens a transaction, adds a listener to the abort event, then aborts the transaction to trigger the event.
IDBVersionChangeEvent.oldVersion - Web APIs
note: this feature is available in web workers.
IIRFilterNode.getFrequencyResponse() - Web APIs
return value undefined exceptions notsupportederror the three arrays provided are not all of the same length.
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.
IdleDeadline.timeRemaining() - Web APIs
for example, if the callback finishes a task and has another one to begin, it can call timeremaining() to see if there's enough time to complete the next task.
ImageCapture.grabFrame() - Web APIs
for simplicy it does not show how to instantiate the imagecapture object.
ImageData() - Web APIs
errors thrown indexsizeerror thrown if array is specified, but its length is not a multiple of (4 * width) or (4 * width * height).
ImageData - Web APIs
WebAPIImageData
note that this is the most common way to create such an object in workers as createimagedata() is not available there.
InputEvent() - Web APIs
ranges: (optional) an array of static ranges that will be affected by a change to the dom if the input event is not canceled.
InputEvent.getTargetRanges() - Web APIs
the gettargetranges() property of the inputevent interface returns an array of static ranges that will be affected by a change to the dom if the input event is not canceled.
enabled - Web APIs
summary indicates whether or not software installation is enabled for this client machine.
getVersion - Web APIs
if the component has not been registered in the client version registry or if the specified component was installed with a null version, this method returns null.
installChrome - Web APIs
note that this return value does not indicate anything about the success of the installation.
startSoftwareUpdate - Web APIs
note also that xpis installed with this method must have their own install.js files in which the full installation is defined.
IntersectionObserver.IntersectionObserver() - Web APIs
any part of the target not visible in the visible area of the root is not considered visible.
IntersectionObserver.observe() - Web APIs
note that this design allows multiple elements' intersection changes to be processed by a single call to the callback.
IntersectionObserver.rootMargin - Web APIs
the string returned by this property may not match the one specified when the intersectionobserver was instantiated.
IntersectionObserver.thresholds - Web APIs
if you accidentally use thresholds as the name of the field in your options, the thresholds array will wind up being simply [0.0], which is likely not what you expect.
IntersectionObserver.unobserve() - Web APIs
if the specified element isn't being observed, this method does nothing and no exception is thrown.
IntersectionObserverEntry.boundingClientRect - Web APIs
this value is obtained using the same algorithm as element.getboundingclientrect(), so refer to that article for details on precisely what is done to obtain this rectangle and what is and is not included within its bounds.
IntersectionObserverEntry.intersectionRatio - Web APIs
if the area of the target's bounds rectangle is zero, the returned value is 1 if isintersecting is true or 0 if not.
IntersectionObserverEntry.isIntersecting - Web APIs
if this is true, then, the intersectionobserverentry describes a transition into a state of intersection; if it's false, then you know the transition is from intersecting to not-intersecting.
IntersectionObserverEntry - Web APIs
if this is true, then, the intersectionobserverentry describes a transition into a state of intersection; if it's false, then you know the transition is from intersecting to not-intersecting.
KeyboardEvent.altKey - Web APIs
the keyboardevent.altkey read-only property is a boolean that indicates if the alt key (option or ⌥ on os x) was pressed (true) or not (false) when the event occured.
KeyboardEvent: code values - Web APIs
2" kvk_pagedown (0x79) "pagedown" "pagedown" kvk_f1 (0x7a) "f1" "f1" kvk_leftarrow (0x7b) "arrowleft" "arrowleft" kvk_rightarrow (0x7c) "arrowright" "arrowright" kvk_downarrow (0x7d) "arrowdown" "arrowdown" kvk_uparrow (0x7e) "arrowup" "arrowup" code values on linux (x11) (when scancode is available) note that x has too many keys and some of them are not testable with usual keyboard.
KeyboardEvent.ctrlKey - Web APIs
the keyboardevent.ctrlkey read-only property returns a boolean that indicates if the control key was pressed (true) or not (false) when the event occured.
KeyboardEvent.keyIdentifier - Web APIs
specifications not part of any current specification.
KeyboardEvent.shiftKey - Web APIs
the keyboardevent.shiftkey read-only property is a boolean that indicates if the shift key was pressed (true) or not (false) when the event occurred.
KeyframeEffect.target - Web APIs
it may be null for animations that do not target a specific element.
LinearAccelerationSensor.LinearAccelerationSensor() - Web APIs
this is not something that would ever be shown to a user.
LinearAccelerationSensor.x - Web APIs
this is not something that would ever be shown to a user.
LinearAccelerationSensor.y - Web APIs
this is not something that would ever be shown to a user.
LinearAccelerationSensor.z - Web APIs
this is not something that would ever be shown to a user.
LinearAccelerationSensor - Web APIs
this is not something that would ever be shown to a user.
Location: assign() - Web APIs
WebAPILocationassign
if the provided url is not valid, a domexception of the syntax_error type is thrown.
Location: host - Web APIs
WebAPILocationhost
syntax string = object.host; object.host = string; examples var anchor = document.createelement("a"); anchor.href = "https://developer.mozilla.org/location.host" anchor.host == "developer.mozilla.org" anchor.href = "https://developer.mozilla.org:443/location.host" anchor.host == "developer.mozilla.org" // the port number is not included because 443 is the scheme's default port anchor.href = "https://developer.mozilla.org:4097/location.host" anchor.host == "developer.mozilla.org:4097" specifications specification status comment html living standardthe definition of 'host' in that specification.
Location: origin - Web APIs
WebAPILocationorigin
note: this feature is available in web workers.
Location: port - Web APIs
WebAPILocationport
if the url does not contain an explicit port number, it will be set to ''.
Location - Web APIs
WebAPILocation
the difference from the assign() method and setting the href property is that after using replace() the current page will not be saved in session history, meaning the user won't be able to use the back button to navigate to it.
Lock - Web APIs
WebAPILock
navigator.locks.request("net_db_sync", show_lock_properties); navigator.locks.request("another_lock", {mode: "shared"}, show_lock_properties); function show_lock_properties(lock) { console.log(`the lock name is: ${lock.name}`); console.log(`the lock mode is: ${lock.mode}`); } specifications specification status comment web locks apithe definition of 'lock' in that specification.
MIDIInputMap - Web APIs
though it works generally like a map, because it is read-only it does not contain clear(), delete(), or set() functions.
MIDIMessageEvent - Web APIs
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.
MIDIOutputMap - Web APIs
although it works like a map, because it is read-only, it does not contain clear(), delete(), or set() functions.
Magnetometer.Magnetometer() - Web APIs
this is not something that would ever be shown to a user.
Magnetometer.x - Web APIs
WebAPIMagnetometerx
this is not something that would ever be shown to a user.
Magnetometer.y - Web APIs
WebAPIMagnetometery
this is not something that would ever be shown to a user.
Magnetometer.z - Web APIs
WebAPIMagnetometerz
this is not something that would ever be shown to a user.
Magnetometer - Web APIs
this is not something that would ever be shown to a user.
MediaDecodingConfiguration - Web APIs
'' : 'not ') + 'supported.') }); specifications specification status comment media capabilitiesthe definition of 'mediadecodingconfiguration' in that specification.
MediaDeviceInfo.label - Web APIs
for security reasons, the label is always an empty string ("") if the user has not obtained permission to use at least one media device, either by starting a stream from the microphone or camera, or by persistent permissions being granted.
MediaDevices.enumerateDevices() - Web APIs
if (!navigator.mediadevices || !navigator.mediadevices.enumeratedevices) { console.log("enumeratedevices() not supported."); return; } // list cameras and microphones.
MediaDevices.ondevicechange - Web APIs
the line let [kind, type, direction] = device.kind.match(/(\w+)(input|output)/i); deserves special notice.
MediaDevices - Web APIs
ar videotracks = stream.getvideotracks(); console.log('got stream with constraints:', constraints); console.log('using video device: ' + videotracks[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 d...
MediaEncodingConfiguration - Web APIs
'' : 'not ') + 'supported.') }); specifications specification status comment media capabilitiesthe definition of 'mediaencodingconfiguration' in that specification.
MediaError.code - Web APIs
WebAPIMediaErrorcode
media_err_src_not_supported 4 the associated resource or media provider object (such as a mediastream) has been found to be unsuitable.
close() - Web APIs
the mediakeysession.close() method notifies that the current media session is no longer needed, and that the content decryption module should release any resources associated with this object and close it.
MediaKeySession.onkeystatuseschange - Web APIs
the onkeystatuseschange property of the mediakeysession is an event handler, fired whenever a keystatuschange event ocurrs, denoting there has been a change in the keys or their statuses within a session.
MediaKeySession.onmessage - Web APIs
the onmessage property of the mediakeysession is an event handler, fired whenever a mediakeymessageevent occurs, denoting a message is generated by the content decryption module.
MediaKeySession - Web APIs
methods mediakeysession.close() returns a promise after notifying the current media session is no longer needed and that the cdm should release any resources associated with this object and close it.
MediaList - Web APIs
WebAPIMediaList
note: medialist is a live list; updating the list using properties or methods listed below will immediately update the behavior of the document.
MediaPositionState.position - Web APIs
if the media is not playing, clearinterval() is used to remove the interval handler.
MediaQueryListEvent.MediaQueryListEvent() - Web APIs
matches: a boolean representing the media query status — true if it matches, false if not.
MediaQueryListEvent - Web APIs
mediaquerylistevent.matchesread only a boolean that returns true if the document currently matches the media query list, or false if not.
MediaQueryListListener - Web APIs
a mediaquerylist object maintains a list of media queries on a document, and handles sending notifications to listeners when the media queries on the document change.
MediaRecorder.ondataavailable - Web APIs
this occurs in four situations: when the media stream ends, any media data not already delivered to your ondataavailable handler is passed in a single blob.
MediaRecorder.stop() - Web APIs
if the mediarecorder.state is not "inactive", continue on to the next step.
MediaRecorderErrorEvent.error - Web APIs
notsupportederror a mediarecorder couldn't be created because the specified options weren't valid.
MediaSession.metadata - Web APIs
the metadata property of the mediasession interface contains a mediametadata object providing descriptive information about the currently playing media, or null if the metadata has not been set.
MediaSession.playbackState - Web APIs
the value may be one of the following: none the browsing context doesn't currently know the current playback state, or the playback state is not available at this time.
MediaSessionActionDetails.action - Web APIs
this action may or may not be available, depending on the platform and user agent, or may be disabled due to subscription level or other circumstances.
MediaSessionActionDetails.fastSeek - Web APIs
once fastseek is false or not present, the repeating series of seekto actions is complete and you can finalize the state of your web app or content.
MediaSessionActionDetails.seekTime - Web APIs
usage notes to perform a "fast" seek (such as when issuing multiple seekto actions in sequence while handling a scrubbing operation, the details object's fastseek property's value is set to true, indicating that you should minimize or eliminate anything you do while handling the action that is only necessary at the final step.
MediaSource.duration - Web APIs
invalidstateerror mediasource.readystate is not equal to open, or one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e.
MediaSource.endOfStream() - Web APIs
return value undefined exceptions exception explanation invalidstateerror mediasource.readystate is not equal to open, or one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e.
MediaSource.readyState - Web APIs
the three possible values are: closed: the source is not currently attached to a media element.
MediaSource.removeSourceBuffer() - Web APIs
return value undefined exceptions exception explanation notfounderror the supplied sourcebuffer doesn't exist in mediasource.sourcebuffers.
MediaSource - Web APIs
mediasource.readystate read only returns an enum representing the state of the current mediasource, whether it is not currently attached to a media element (closed), attached and ready to receive sourcebuffer objects (open), or attached but the stream has been ended via mediasource.endofstream() (ended.) mediasource.duration gets and sets the duration of the current media being presented.
MediaStream() - Web APIs
the tracks are not removed from the original stream, so they're shared by the two streams.
MediaStream.ended - Web APIs
WebAPIMediaStreamended
the ended read-only property of the mediastream interface returns a boolean value which is true if the stream has been completely read, or false if the end of the stream has not been reached.
MediaStream.getAudioTracks() - Web APIs
note: the order of the returned tracks is not defined by the specification and may, in fact, change from one call to getaudiotracks() to the next.
MediaStream.getVideoTracks() - Web APIs
note: the order of the tracks is not defined by the specification, and may not be the same from one call to getvideotracks() to another.
MediaStream.id - Web APIs
WebAPIMediaStreamid
the mediastream.id() read-only property is a domstring containing 36 characters denoting a unique identifier (guid) for the object.
MediaStream.onaddtrack - Web APIs
the addtrack event does not get fired when javascript code explicitly adds tracks to the stream (by calling addtrack()).
MediaStream.onremovetrack - Web APIs
the removetrack event does not get fired when javascript code explicitly removes tracks from the stream (by calling removetrack()).
MediaStreamAudioDestinationNode.stream - Web APIs
you can use this property to get a stream out of the audio graph and feed it into another construct, such as a media recorder.
MediaStreamAudioDestinationNode - Web APIs
you can use this property to get a stream out of the audio graph and feed it into another construct, such as a media recorder.
MediaStreamAudioSourceOptions - Web APIs
it is not needed when using the audiocontext.createmediastreamsource() method.
MediaStreamConstraints.audio - Web APIs
syntax var audioconstraints = true | false | mediatrackconstraints; value the value of the audio property can be specified as either of two types: boolean if a boolean value is specified, it simply indicates whether or not an audio track should be included in the returned stream; if it's true, an audio track is included; if no audio source is available or if permission is not given to use the audio source, the call to getusermedia() will fail.
MediaStreamConstraints.video - Web APIs
syntax var videoconstraints = true | false | mediatrackconstraints; value the value of the video property can be specified as either of two types: boolean if a boolean value is specified, it simply indicates whether or not a video track should be included in the returned stream; if it's true, a video track is included; if no video source is available or if permission is not given to use the video source, the call to getusermedia() will fail.
MediaStreamTrack.getSettings() - Web APIs
note: the returned object identifies the current values of every constrainable property, including those which are platform defaults rather than having been expressly set by the site's code.
MediaStreamTrack.label - Web APIs
when the track is deassociated from its source, the label is not changed.
MediaStreamTrack.muted - Web APIs
the muted read-only property of the mediastreamtrack interface returns a boolean value indicating whether or not the track is currently unable to provide media output.
MediaStreamTrack.onmute - Web APIs
such an event is sent when the track is temporarily not able to send data.
MediaStreamTrack.readyState - Web APIs
"ended" which indicates that the input is not giving any more data and will never provide new data.
MediaStreamTrackAudioSourceOptions.mediaStreamTrack - Web APIs
true, video: false }).then(function(stream) { let options = { mediastreamtrack: stream.getaudiotracks()[0]; } let source = new mediastreamtrackaudiosourcenode(audioctx, options); source.connect(audioctx.destination); }).catch(function(err) { console.log('the following gum error occured: ' + err); }); } else { console.log('new getusermedia not supported on your browser!'); } specifications specification status comment web audio apithe definition of 'mediastreamtrackaudiosourceoptions.mediastream' in that specification.
MediaStream Recording API - Web APIs
note: individual blobs containing slices of the recorded media will not necessarily be individually playable.
MediaTrackConstraints.aspectRatio - Web APIs
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().
MediaTrackConstraints.channelCount - Web APIs
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().
MediaTrackConstraints.deviceId - Web APIs
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().
MediaTrackConstraints.facingMode - Web APIs
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().
MediaTrackConstraints.frameRate - Web APIs
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().
MediaTrackConstraints.groupId - Web APIs
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().
MediaTrackConstraints.height - Web APIs
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().
MediaTrackConstraints.latency - Web APIs
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().
MediaTrackConstraints.sampleRate - Web APIs
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().
MediaTrackConstraints.sampleSize - Web APIs
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().
MediaTrackConstraints.width - Web APIs
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().
MediaTrackSettings.aspectRatio - Web APIs
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().
MediaTrackSettings.channelCount - Web APIs
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().
MediaTrackSettings.cursor - Web APIs
the mediatracksettings dictionary's cursor property indicates whether or not the cursor should be captured as part of the video track included in the mediastream returned by getdisplaymedia().
MediaTrackSettings.facingMode - Web APIs
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().
MediaTrackSettings.frameRate - Web APIs
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().
MediaTrackSettings.height - Web APIs
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().
MediaTrackSettings.latency - Web APIs
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().
MediaTrackSettings.sampleRate - Web APIs
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().
MediaTrackSettings.sampleSize - Web APIs
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().
MediaTrackSettings.volume - Web APIs
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().
MediaTrackSettings.width - Web APIs
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().
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.
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.
MessageChannel() - Web APIs
note: this feature is available in web workers.
MessageChannel.port1 - Web APIs
note: this feature is available in web workers.
MessageChannel.port2 - Web APIs
note: this feature is available in web workers.
MessageChannel - Web APIs
note: this feature is available in web workers.
MessagePort.close() - Web APIs
WebAPIMessagePortclose
note: this feature is available in web workers.
MessagePort.onmessage - Web APIs
note: this feature is available in web workers.
MessagePort.postMessage() - Web APIs
note: this feature is available in web workers.
Microsoft API extensions - Web APIs
note: these apis will only work in microsoft applications, and are not on a standards track.
MimeType - Web APIs
WebAPIMimeType
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.
MimeTypeArray - Web APIs
} else { // notify the user that flash is being deprecated and they // should upgrade their browser.
MouseEvent.buttons - Web APIs
note: do not confuse this property with the mouseevent.button property.
MouseEvent.which - Web APIs
WebAPIMouseEventwhich
specification this is not part of any specification.
MouseScrollEvent - Web APIs
do not use this interface for wheel events.
MouseWheelEvent - Web APIs
do not use this interface for wheel events.
MutationObserver.MutationObserver() - Web APIs
dom observation does not begin immediately; the observe() method must be called first to establish which portion of the dom to watch and what kinds of changes to watch for.
MutationObserverInit - Web APIs
if this property isn't included, changes to all attributes cause mutation notifications.
MutationRecord - Web APIs
note that for this to work as expected, attributeoldvalue or characterdataoldvalue must be set to true in the corresponding mutationobserverinit parameter of the mutationobserver observe method specifications specification status comment domthe definition of 'mutationrecord' in that specification.
NDEFRecord.id - Web APIs
WebAPINDEFRecordid
web nfc does not sign the nfc content, thus record consumer should not make any assumptions about integrity or authenticity of the identifier or any other part of the records.
NDEFRecord.lang - Web APIs
WebAPINDEFRecordlang
the record might be missing a language tag, for example, if the recorded information is not locale-specific.
NDEFRecord.recordType - Web APIs
local type name represents a local type name, frequently used to specify ndef record embedded within another record.
NDEFRecord.toRecords() - Web APIs
exceptions notsupported the user agent does not know how to parse this combination of ndefrecord.data and ndefrecord.recordtype.
NDEFRecord - Web APIs
note: the uniqueness of the identifier is enforced only by the generator of the record.
NDEFWriter - Web APIs
methods ndefwriter.write() called to write ndef message to a tag (after ensuring hardware and ua compatibility and obtaining permission from the user) or get an error explaining why feature is not available.
NamedNodeMap - Web APIs
objects inside a namednodemap are not in any particular order, unlike nodelist, although they may be accessed by an index as in an array.
Navigator.buildID - Web APIs
WebAPINavigatorbuildID
example console.log(window.navigator.buildid); specification not part of any public standard.
Navigator.credentials - Web APIs
the credentialscontainer interface also notifies the user agent when an interesting event occurs, such as a successful sign-in or sign-out.
Navigator.geolocation - Web APIs
note: for security reasons, when a web page tries to access location information, the user is notified and asked to grant permission.
Navigator.mediaSession - Web APIs
note that the code begins by ensuring that the navigator.mediasession property is available before attempting to use it.
Navigator.oscpu - Web APIs
WebAPINavigatoroscpu
pc mac os x version x.y mac os x (i386/x64 build) intel mac os x or macos version x.y linux 64-bit (32-bit build) output of uname -s plus "i686 on x86_64" linux output of uname -sm x.y refers to the version of the operating system example function osinfo() { alert(window.navigator.oscpu); } osinfo(); // alerts "windows nt 6.0" for example usage notes unless your code is privileged (chrome or at least has the universalbrowserread privilege), it may get the value of the general.oscpu.override preference instead of the true platform.
Navigator.productSub - Web APIs
example <script> function prodsub() { var dt = document.getelementbyid("d").childnodes[0]; dt.data = window.navigator.productsub; } </script> <button onclick="prodsub();">productsub</button> // returns: 20010725 notes on ie, this property returns undefined.
Navigator.requestMediaKeySystemAccess() - Web APIs
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).
Navigator.sendBeacon() - Web APIs
there is nothing the next page can do to avoid this, so the new page seems slow, even though it's the previous page's fault.
Navigator.serviceWorker - Web APIs
the feature may not be available in private mode.
Navigator.xr - Web APIs
WebAPINavigatorxr
usage notes each window has its own instance of navigator, which can be accessed as window.navigator or simply as navigator.
NavigatorConcurrentHardware - Web APIs
note: this feature is available in web workers.
NavigatorID.appCodeName - Web APIs
note: do not rely on this property to return a real product name.
NavigatorID.appName - Web APIs
note: do not rely on this property to return a real browser name.
NavigatorID.platform - Web APIs
for example: "macintel", "win32", "freebsd i386", "webtv os" example console.log(navigator.platform); usage notes most browsers, including chrome, edge, and firefox 63 and later, return "win32" even if running on a 64-bit version of windows.
NavigatorID.product - Web APIs
note: do not rely on this property to return a real product name.
NavigatorLanguage.language - Web APIs
note that in safari on ios prior to 10.2, the country code returned is lowercase: "en-us", "fr-fr" etc.
NavigatorPlugins.mimeTypes - Web APIs
note: named properties of mimetypearray objects are no longer enumerable in the latest browser versions.
NavigatorPlugins - Web APIs
navigatorplugins.javaenabled() read only returns a boolean flag indicating whether the host browser is java-enabled or not.
NavigatorStorage - Web APIs
the navigatorstorage mixin adds to the navigator and workernavigator interfaces the navigator.storage property, which provides access to the storagemanager singleton used for controlling the persistence of data stores as well as obtaining information note: this feature is available in web workers.
NetworkInformation.downlink - Web APIs
note that chrome-based browsers do not conform to the specification, and arbitrarily cap the reported downlink at a maximum of 10 mbps as an anti-fingerprinting measure.
NetworkInformation.onchange - Web APIs
} // register for event changes: navigator.connection.onchange = changehandler; // another way: navigator.connection.addeventlistener('change', changehandler); specifications specification status comment network information apithe definition of 'onchange' in that specification.
NetworkInformation.rtt - Web APIs
note: this feature is available in web workers.
NetworkInformation.type - Web APIs
note: this feature is available in web workers.
Node.baseURI - Web APIs
WebAPINodebaseURI
note that obtaining the base url for a document may return different urls over time if the <base> tags or the document's location change.
Node.baseURIObject - Web APIs
specification not in any specification.
Node.hasChildNodes() - Web APIs
the node.haschildnodes() method returns a boolean value indicating whether the given node has child nodes or not.
Node.isConnected - Web APIs
WebAPINodeisConnected
syntax var isitconnected = nodeobjectinstance.isconnected return value a boolean that is true if the node is connected to its relevant context object, and false if not.
Node.isDefaultNamespace() - Web APIs
the node.isdefaultnamespace() method accepts a namespace uri as an argument and returns a boolean with a value of true if the namespace is the default namespace on the given node or false if not.
Node.isSupported() - Web APIs
WebAPINodeisSupported
if the version is not specified, supporting any version of the feature will cause the method to return true.
Node.nodeValue - Web APIs
WebAPINodenodeValue
the following table shows the return values for different elements: node value of nodevalue cdatasection content of the cdata section comment content of the comment document null documentfragment null documenttype null element null namednodemap null entityreference null notation null processinginstruction entire content excluding the target text content of the text node when nodevalue is defined to be null, setting it has no effect.
Node.previousSibling - Web APIs
syntax previousnode = node.previoussibling; example <img id="b0"> <img id="b1"> <img id="b2"> console.log(document.getelementbyid("b1").previoussibling); // <img id="b0"> console.log(document.getelementbyid("b2").previoussibling.id); // "b1" notes gecko-based browsers insert text nodes into a document to represent whitespace in the source markup.
Node.replaceChild() - Web APIs
WebAPINodereplaceChild
note the idiosyncratic argument order (new before old).
Node.rootNode - Web APIs
WebAPINoderootNode
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.
NodeIterator.expandEntityReferences - Web APIs
the nodeiterator.expandentityreferences read-only property returns a boolean flag indicating whether or not the children of entity reference nodes are visible to the nodeiterator.
NodeIterator.filter - Web APIs
when creating the nodeiterator, the filter object is passed in as the third parameter, and the object method acceptnode(node) is called on every single node to determine whether or not to accept it.
NodeList.item() - Web APIs
WebAPINodeListitem
this is usually obtained from another dom property or method, such as childnodes.
NonDocumentTypeChildNode.previousElementSibling - Web APIs
syntax prevnode = elementnodereference.previouselementsibling; example <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <li>this is a list item</li> <li>this is another list item</li> <div id="div-03">here is div-03</div> <script> let el = document.getelementbyid('div-03').previouselementsibling; 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: si...
NonDocumentTypeChildNode - Web APIs
the nondocumenttypechildnode interface contains methods that are particular to node objects that can have a parent, but not suitable for documenttype.
OES_texture_float - Web APIs
limitation: linear filtering linear filtering on floating-point textures is not allowed with this extension.
OES_texture_float_linear - Web APIs
linear filtering the oes_texture_float extension alone does not allow linear filtering with floating-point textures.
OES_texture_half_float - Web APIs
limitation: linear filtering linear filtering on half floating-point textures is not allowed with this extension.
OES_texture_half_float_linear - Web APIs
linear filtering the oes_texture_half_float extension alone does not allow linear filtering with half floating-point textures.
OES_vertex_array_object.isVertexArrayOES() - Web APIs
return value a glboolean indicating whether the given object is a webglvertexarrayobject object (true) or not (false).
OfflineAudioCompletionEvent - Web APIs
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.
OfflineAudioContext.OfflineAudioContext() - Web APIs
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.
OffscreenCanvas - Web APIs
// commit rendering to the second canvas var bitmaptwo = offscreen.transfertoimagebitmap(); two.transferfromimagebitmap(bitmaptwo); asynchronous display of frames produced by an offscreencanvas another way to use the offscreencanvas api, is to call transfercontroltooffscreen() on a <canvas> element, either on a worker or the main thread, which will return an offscreencanvas object from an htmlcanvaselement object from the main thread.
OrientationSensor.populateMatrix() - Web APIs
this is not something that would ever be shown to a user.
OscillatorNode.detune - Web APIs
syntax var oscillator = audioctx.createoscillator(); oscillator.detune.setvalueattime(100, audioctx.currenttime); // value in cents note: though the audioparam returned is read-only, the value it represents is not.
OscillatorNode.frequency - Web APIs
syntax var oscillator = audioctx.createoscillator(); oscillator.frequency.setvalueattime(440, audioctx.currenttime); // value in hertz note: though the audioparam returned is read-only, the value it represents is not.
OscillatorNode.start() - Web APIs
if a value is not included or is less than currenttime, the oscillator starts playing immediately.
OscillatorNode.stop() - Web APIs
if a value is not included, it defaults to 0.
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.
PageTransitionEvent - Web APIs
example html <!doctype html> <html> <body> </body> </html> javascript window.addeventlistener('pageshow', myfunction); function myfunction(event) { if (event.persisted) { alert("the page was cached by the browser"); } else { alert("the page was not cached by the browser"); } } specifications specification status comment html living standardthe definition of 'pagetransitionevent' in that specification.
PaintWorklet.registerPaint - Web APIs
note that registerpaint() is called without a reference to paintworklet.
PaintWorklet - Web APIs
note that registerpaint() is called without a reference to paintworklet.
PannerNode.positionY - Web APIs
note that in this case, the change will mainly affect the timbre of the oscillator, as it's a simple mono wave.
PannerNode.positionZ - Web APIs
note that in this case, the change will mainly affect the timbre and perceived volume of the sound.
ParentNode.children - Web APIs
you can access the individual child nodes in the collection by using either the item() method on the collection, or by using javascript array-style notation.
ParentNode.lastElementChild - Web APIs
note: this property was initially defined in the elementtraversal pure interface.
Path2D - Web APIs
WebAPIPath2D
if the shape has already been closed or has only one point, this function does nothing.
PayerErrors.email - Web APIs
WebAPIPayerErrorsemail
if the payer's email address passed validation, this property is not included in the payererrors object.
PaymentAddress.addressLine - Web APIs
the addressline read-only property of the paymentaddress interface is an array of domstring objects, each specifying a line of the address that is not covered by one of the other properties of paymentaddress.
PaymentAddress.country - Web APIs
syntax var paymentcountry = paymentaddress.country; value a domstring which contains the iso3166-1 alpha-2 code identifying the country in which the address is located, or an empty string if no country is available, which frequently can be assumed to mean "same country as the site owner." usage notes if the payment handler validates the address and determines that the value of country is invalid, a call to paymentrequestupdateevent.updatewith() will be made with a details object containing a shippingaddresserrors field.
PaymentAddress.region - Web APIs
usage notes in some countries, like belgium, it's uncommon for people to provide a region as part of their postal address.
PaymentAddress.regionCode - Web APIs
the string is empty if the region code couldn't be determined, isn't needed for the address's country, or was not provided.
PaymentDetailsUpdate.error - Web APIs
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.
PaymentMethodChangeEvent.methodDetails - Web APIs
ev.updatewith(newstuff); }; const response = await request.show(); note that the methoddetails property is being used by the calculatediscount() function to compute any payment discount, then updatewith() is called to update the event with the computed update.
PaymentRequest: merchantvalidation event - Web APIs
typically, a client should not access the validation url.
PaymentRequest.onmerchantvalidation - Web APIs
this event is not be fired by all payment handlers.
PaymentRequest.onpaymentmethodchange - Web APIs
this event may not be fired by all payment handlers.
PaymentRequest: paymentmethodchange event - Web APIs
for example, if the user switches from one credit card to another on their apple pay account, a paymentmethodchange event is fired to let you know about the change.
PaymentRequest: shippingaddresschange event - Web APIs
bubbles no cancelable no interface paymentrequestupdateevent event handler property onshippingaddresschange usage notes depending on the browser, the shipping address information may be redacted for privacy reasons.
PaymentRequest - Web APIs
this will be one of shipping, delivery, pickup, or null if a value was not provided in the constructor.
PaymentRequestEvent() - Web APIs
options optional options are as follows: instrumentkey: a paymentinstrument object reflecting the payment instrument selected by the user or an empty string if the user has not registered or chosen a payment instrument.
PaymentRequestEvent.instrumentKey - Web APIs
the instrumentkey read-only property of the paymentrequestevent interface returns a paymentinstrument object reflecting the payment instrument selected by the user or an empty string if the user has not registered or chosen a payment instrument.
PaymentRequestEvent - Web APIs
properties instrumentkeyread only returns a paymentinstrument object reflecting the payment instrument selected by the user or an empty string if the user has not registered or chosen a payment instrument.
PaymentResponse.retry() - Web APIs
validate the returned reponse; if there are any fields whose values are not acceptable, call the response's complete() method with a value of "fail" to indicate failure.
PaymentResponse - Web APIs
paymentresponse.complete() secure context notifies the user agent that the user interaction is over.
Pbkdf2Params - Web APIs
unlike the input key material passed into derivekey(), salt does not need to be kept secret.
performance.clearMarks() - Web APIs
note: this feature is available in web workers.
performance.clearMeasures() - Web APIs
note: this feature is available in web workers.
performance.mark() - Web APIs
WebAPIPerformancemark
note: this feature is available in web workers.
performance.measure() - Web APIs
note: this feature is available in web workers.
Performance.navigation - Web APIs
this property is not available in workers.
Performance.onresourcetimingbufferfull - Web APIs
note: this feature is available in web workers.
Performance: resourcetimingbufferfull event - Web APIs
function buffer_full(event) { console.log("warning: resource timing buffer is full!"); performance.setresourcetimingbuffersize(200); } function init() { // set a callback if the resource buffer becomes filled performance.onresourcetimingbufferfull = buffer_full; } <body onload="init()"> note that you could also set up the handler using the addeventlistener() function: performance.addeventlistener('resourcetimingbufferfull', buffer_full); specifications specification status comment resource timing level 1the definition of 'onresourcetimingbufferfull' in that specification.
Performance.timeOrigin - Web APIs
note: this feature is available in web workers.
Performance.timing - Web APIs
this property is not available in workers.
performance.toJSON() - Web APIs
note: this feature is available in web workers.
PerformanceNavigationTiming - Web APIs
if there was no redirect, or if the redirect was from another origin, and that origin does not permit it's timing information to be exposed to the current origin then the value will be 0.
PerformanceObserverEntryList.getEntries() - Web APIs
this parameter is currently not supported on chrome or opera.
PerformanceObserverEntryList.getEntriesByName() - Web APIs
if the type argument is not specified, only the name will be used to determine the entries to return.
PerformanceObserverEntryList - Web APIs
note: this interface is exposed to window and worker.
PerformanceTiming.domContentLoadedEventEnd - Web APIs
the legacy performancetiming.domcontentloadedeventend read-only property returns an unsigned long long representing the moment, in milliseconds since the unix epoch, right after all the scripts that need to be executed as soon as possible, in order or not, has been executed.
PerformanceTiming.domInteractive - Web APIs
nevertheless there are a few caveats that happens if scripts are blocking rendering and not loaded asynchronously or with custom web fonts.
PerformanceTiming.loadEventEnd - Web APIs
if this event has not yet been sent, or is not yet completed, it returns 0.
PerformanceTiming.loadEventStart - Web APIs
if this event has not yet been sent, it returns 0.
PerformanceTiming.redirectEnd - Web APIs
if there is no redirect, or if one of the redirect is not of the same origin, the value returned is 0.
PerformanceTiming.redirectStart - Web APIs
if there is no redirect, or if one of the redirect is not of the same origin, the value returned is 0.
PerformanceTiming.unloadEventEnd - Web APIs
if there is no previous document, or if the previous document, or one of the needed redirects, is not of the same origin, the value returned is 0.
PerformanceTiming.unloadEventStart - Web APIs
if there is no previous document, or if the previous document, or one of the needed redirects, is not of the same origin, the value returned is 0.
Using the Performance API - Web APIs
function print_json() { var json; var o = document.getelementsbytagname("output")[0]; if (window.performance.tojson === undefined) { json = "window.performance.tojson() is not supported"; o.innerhtml += json + "<br>"; } else { var s; json = window.performance.tojson(); // print the performance object s = json.stringify(json); o.innerhtml = "<p>performance = " + s + "</p>"; // print the performance.timing and performance.navigation objects var perf = json.parse(s); var timing = perf.timing; o.innerhtml += "<p>peformance.timin...
PeriodicWave - Web APIs
a simple way of manually obtaining such coefficients (though not the best) is to use a graphing calculator.
PhotoCapabilities.redEyeReduction - Web APIs
never red-eye reduction is not available.
Plugin - Web APIs
WebAPIPlugin
note: own properties of plugin objects are no longer enumerable in the latest browser versions.
PointerEvent.PointerEvent() - Web APIs
note: the pointereventinit dictionary also accepts fields from the mouseevent, uieventinit and eventinit dictionaries.
PointerEvent.height - Web APIs
if the input hardware cannot report the contact geometry to the browser, the height defaults to 1.
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.
PointerEvent.pointerId - Web APIs
since the value may be randomly generated, it is not guaranteed to convey any particular meaning.
PointerEvent.pressure - Web APIs
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.
PointerEvent.tiltX - Web APIs
for devices that do not support this property, the value is 0.
PointerEvent.tiltY - Web APIs
for devices that do not support this property, the value is 0.
PointerEvent.twist - Web APIs
for devices that do not report twist, the value is 0.
PointerEvent.width - Web APIs
if the input hardware cannot report the contact geometry to the browser, the width defaults to 1.
Multi-touch interaction - Web APIs
function pointermove_handler(ev) { // note: if the user makes more than one "simultaneous" touch, most browsers // fire at least one pointermove event and some will fire several pointermoves.
PositionOptions.enableHighAccuracy - Web APIs
note that this can result in slower response times or increased power consumption (with a gps chip on a mobile device for example).
PositionOptions.maximumAge - Web APIs
if set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position.
ProcessingInstruction - Web APIs
user-defined processing instructions cannot begin with "xml", as xml-prefixed processing-instruction target names are reserved by the xml specification for particular, standard uses (see, for example, <?xml-stylesheet ?>).
ProgressEvent.lengthComputable - Web APIs
if not, the progressevent.total property has no significant value.
ProgressEvent.loaded - Web APIs
when downloading a resource using http, this only represent the part of the content itself, not headers and other overhead.
ProgressEvent.total - Web APIs
when downloading a resource using http, this only represent the content itself, not headers and other overhead.
PublicKeyCredential.id - Web APIs
note: this property may only be used in top-level contexts and will not be available in an <iframe> for example.
PublicKeyCredential.rawId - Web APIs
note: this property may only be used in top-level contexts and will not be available in an <iframe> for example.
PublicKeyCredentialCreationOptions.attestation - Web APIs
syntax attestation = publickeycredentialcreationoptions.attestation value a string which may be "none": the relying party is not interested in this attestation.
PublicKeyCredentialCreationOptions.pubKeyCredParams - Web APIs
examples var publickey = { pubkeycredparams: [ // we would like an elliptic curve to be used if possible { type: "public-key", alg: -7 }, // if not, then we will fallback on an rsa algorithm { type: "public-key", alg: -37 } ], challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", } }; navigator.cr...
PublicKeyCredentialCreationOptions.timeout - Web APIs
note: an analogous option exists for the fetching operation (navigators.credentials.get()), see publickeycredentialrequestoptions.timeout.
PublicKeyCredentialCreationOptions.user - Web APIs
this is not intended to store the login of the user (see name below).
PublicKeyCredentialRequestOptions.timeout - Web APIs
note: an analogous option exists for the creation operation (navigators.credentials.create()), see publickeycredentialcreationoptions.timeout.
PublicKeyCredentialRequestOptions - Web APIs
if this option is not provided, the client will use the current origin's domain.
PushManager.getSubscription() - Web APIs
example this code snippet is taken from a push messaging and notification sample.
PushMessageData - Web APIs
examples self.addeventlistener('push', function(event) { var obj = event.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { firenotification(obj, event); port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); specifications specification status comment push apithe definition of 'pushmessagedata' in that specification.
PushSubscription.endpoint - Web APIs
for this reason, it is a good idea to keep your endpoint a secret, so others do not hijack it and abuse the push functionality.
RTCAnswerOptions - Web APIs
note: at this time, rtcansweroptions does not have any additional properties defined beyond those included in rtcofferansweroptions.
RTCDTMFSender.insertDTMF() - Web APIs
invalidcharactererror one or more of the characters in tones is not valid dtmf.
RTCDataChannel.bufferedAmount - Web APIs
syntax var amount = adatachannel.bufferedamount; value the number of bytes of data currently queued to be sent over the data channel but have not yet been sent.
RTCDataChannel.bufferedAmountLowThreshold - Web APIs
bufferedamountlow events are not fired after the data channel is closed.
RTCDataChannel.close() - Web APIs
closure of the data channel is not instantaneous.
RTCDataChannel: error event - Web APIs
*/ } note: since rtcerror is not one of the legacy errors, the value of rtcerror.code is always 0.
RTCDataChannel.maxPacketLifeTime - Web APIs
if not set when rtcpeerconnection.createdatachannel() was called to create the data channel, this value is null.
RTCDataChannel.maxRetransmits - Web APIs
syntax var tries = adatachannel.maxretransmits; value the maximum number of times the browser will try to retransmit a message before giving up, or null if not set when rtcpeerconnection.createdatachannel() was called.
RTCDataChannel: message event - Web APIs
bubbles no cancelable no interface messageevent event handler property onmessage note: the message event uses as its event object type the messageevent interface defined by the html specification.
RTCDataChannel.onclosing - Web APIs
for example, after rtcdatachannel.close() was called but the underlying data transport might not have been closed yet.
RTCDataChannel.ordered - Web APIs
the read-only rtcdatachannel property ordered indicates whether or not the data channel guarantees in-order delivery of messages; the default is true, which indicates that the data channel is indeed ordered.
RTCDataChannel.protocol - Web APIs
the ability for each channel to have a defined subprotocol lets your app, for example, use json objects as messages on one channel while another channel is plaintext and another is raw binary or even some other format.
RTCDataChannel.readyState - Web APIs
example var datachannel = peerconnection.createdatachannel("file transfer"); var sendqueue = []; function sendmessage(msg) { switch(datachannel.readystate) { case "connecting": console.log("connection not open; queueing: " + msg); sendqueue.push(msg); break; case "open": sendqueue.foreach((msg) => datachannel.send(msg)); break; case "closing": console.log("attempted to send message while closing: " + msg); break; case "closed": console.log("error!
RTCDataChannel.reliable - Web APIs
the read-only rtcdatachannel property reliable indicates whether or not the data channel is reliable.
RTCDataChannelEvent - Web APIs
pc.ondatachannel = function(event) { inbounddatachannel = event.channel; inbounddatachannel.onmessage = handleincomingmessage; inbounddatachannel.onopen = handlechannelopen; inbounddatachannel.onclose = handlechannelclose; } see a simple rtcdatachannel sample for another, more complete, example of how to use data channels.
RTCIceCandidate.component - Web APIs
usage notes consider this sdp attribute line (a-line): a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host this is an ice candidate a-line, whose foundation is 4234997325.
RTCIceCandidate.sdpMLineIndex - Web APIs
note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmlineindex will throw a typeerror exception.
RTCIceCandidate.sdpMid - Web APIs
note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmlineindex will throw a typeerror exception.
RTCIceCandidateInit.candidate - Web APIs
if your client-side signaling layer builds and transmits a json string including the candidate to the remote peer, the remote peer might handle receiving that json message like this: function goticecandidatemessage(msg) { var icecandidate = new rtcicecandidate({ candidate: msg.candidate; }); pc.addicecandidate(icecandidate).catch({ /* handle error */ }); } it's helpful to note that for backward compatibility with older versions of the webrtc specification, the rtcicecandidate() constructor accepts the value of candidate as its only input, in place of the rtcicecandidateinit dictionary.
RTCIceCandidateInit.sdpMLineIndex - Web APIs
note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmlineindex will throw a typeerror exception.
RTCIceCandidateInit.sdpMid - Web APIs
note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmlineindex will throw a typeerror exception.
RTCIceCandidateInit.usernameFragment - Web APIs
another example: it might take a user-defined string and append three 8-bit random bytes to the end.
RTCIceCandidateInit - Web APIs
this property has no default value and is not present unless set explicitly.
RTCIceCandidatePairStats.availableIncomingBitrate - Web APIs
note: the returned value is computed using a method similar—but not identical—to the transport independent application specific maximum (tias) described in rfc 3890: 6.2.
RTCIceCandidatePairStats.availableOutgoingBitrate - Web APIs
note: the returned value is computed using a method similar—but not identical—to the transport independent application specific maximum (tias) described in rfc 3890: 6.2.
RTCIceCandidatePairStats.bytesReceived - Web APIs
only data bytes are counted; overhead such as padding, headers, and the like are not included in this count.
RTCIceCandidatePairStats.bytesSent - Web APIs
only data bytes are counted; overhead such as padding, headers, and the like are not included in this count.
RTCIceCandidatePairStats.lastPacketReceivedTimestamp - Web APIs
stun packets are not included.
RTCIceCandidateStats.lastPacketSentTimestamp - Web APIs
the rtcicecandidatepairstats property lastpacketsenttimestamp indicates the time at which the connection described by the candidate pair last sent a packet, not including stun packets.
RTCIceCandidatePairStats.requestsSent - Web APIs
note: the reported number of requests does not include retransmissions.
RTCIceCandidatePairStats.responsesSent - Web APIs
note: since it isn't possible to tell the difference between connectivity check requests and consent requests, this value includes both.
RTCIceCandidatePairStats.retransmissionsReceived - Web APIs
note: retransmissions are connectivity check requests with a transaction_transmit_counter attribute whose req field is greater than 1 (indicating that the request has been transmitted more than once).
RTCIceCandidatePairStats.retransmissionsSent - Web APIs
note: retransmissions are connectivity check requests with a transaction_transmit_counter attribute whose req field is greater than 1 (indicating that the request has been transmitted more than once).
RTCIceCandidateStats.address - Web APIs
usage notes the address property was previously known as ip, and only permitted ipv4 and ipv6 addresses to be used.
RTCIceCandidateStats.mozLocalTransport - Web APIs
syntax instead of using mozlocaltransport, you should use code like this: localtransport = rtcicecandidatestats.relayprotocol; specifications not part of any specification.
RTCIceCandidateStats.relayProtocol - Web APIs
note: this property is only present on rtcicecandidatestats objects that represent local candidates.
RTCIceCandidateStats.url - Web APIs
note: this property does not exist for remote candidates.
RTCIceCandidateType - Web APIs
usage notes the rtcicecandidatetype enumeration is used by the type property of rtcicecandidate objects, as well as when reporting statistics on candidates using rtcicecandidatestats.candidatetype.
RTCIceComponent - Web APIs
usage notes the rtcicecomponent type is used by the component property of rtcicecandidate and rtcicetransport objects.
RTCIceGathererState - Web APIs
values "new" the rtcicetransport is newly created and has not yet started to gather ice candidates.
RTCIceParameters - Web APIs
usage notes the username fragment and password uniquely identify the remote peer for the duration of the ice session, and are used to both ensure security and to avoid crosstalk across multiple ongoing ice sessions.
RTCIceProtocol - Web APIs
usage notes the rtciceprotocol type is used by the protocol property of rtcicecandidate objects.
RTCIceServers.urls - Web APIs
WebAPIRTCIceServerurls
mypeerconnection = new rtcpeerconnection({ iceservers: [ { urls: "stun:stunserver.example.org" } ] }); notice that only the urls property is provided; the stun server doesn't require authentication, so this is all that's needed.
RTCIceTcpCandidateType - Web APIs
usage notes the rtcicetcpcandidatetype type is used by the tcptype property of rtcicecandidate objects.
RTCIceTransport.gatheringState - Web APIs
syntax gatherstate = rtcicetransport.gatheringstate; value a string from the rtcicegathererstate enumerated type whose value indicates the current state of the ice agent's candidate gathering process: "new" the rtcicetransport is newly created and has not yet started to gather ice candidates.
RTCIceTransport: gatheringstatechange event - Web APIs
the gathering state, whose actual status can be found in the transport object's gatheringstate property, indicates whether or not the ice agent has begun gathering candidates, and if so, if it has finished doing so.
RTCIceTransport.getLocalParameters() - Web APIs
returns null if the parameters have not yet been received.
RTCIceTransport: selectedcandidatepairchange event - Web APIs
the pair of candidates is in turn described by an rtcicecandidatepair object which contains one rtcicecandidate representing the local end of the connection, and another representing the remote end of the connection.
RTCInboundRtpStreamStats.bytesReceived - Web APIs
syntax var bytesreceived = rtcinboundrtpstreamstats.bytesreceived; value an unsigned integer value indicating the total number of bytes received so far on this rtp stream, not including header and padding bytes.
RTCInboundRtpStreamStats.fecPacketsDiscarded - Web APIs
this can happen if all the packets covered by the fec packet have already been received or recovered using another fec packet, or if the fec packet arrived outside the recovery window and the lost rtp packets have already been skipped during playback as a result.
RTCInboundRtpStreamStats.firCount - Web APIs
the receiver sends a fir packet to the sender any time it falls bahind or loses packets and cannot decode the incoming stream any longer because of the lost data.
RTCInboundRtpStreamStats.lastPacketReceivedTimestamp - Web APIs
note: this value differs from the timestamp, which represents the time at which the statistics object was created.
RTCInboundRtpStreamStats.packetsFailedDecryption - Web APIs
syntax var packetsfaileddecryption = rtcinboundrtpstreamstats.packetsfaileddecryption; value an integer value which indicates how many packets the local end of the rtp connection could not be successfully decrypted.
RTCInboundRtpStreamStats.pliCount - Web APIs
these are sent by the receiver's decoder to notify the encoder (the sender) that an undefined amount of coded video data, which may span frame boundaries, has been lost.
RTCInboundRtpStreamStats.sliCount - Web APIs
note: this value is only present for video media.
RTCOutboundRtpStreamStats.firCount - Web APIs
the receiver sends a fir packet to the sender any time it falls bahind or loses packets and cannot decode the incoming stream any longer because of the lost data.
RTCOutboundRtpStreamStats.framesEncoded - Web APIs
note: this property is only valid for video streams.
RTCOutboundRtpStreamStats.lastPacketSentTimestamp - Web APIs
note: this value differs from the timestamp, which represents the time at which the statistics object was created.
RTCOutboundRtpStreamStats.sliCount - Web APIs
note: this value is only present for video media.
RTCOutboundRtpStreamStats - Web APIs
plicount an integer specifying the number of times the remote receiver has notified this rtcrtpsender that some amount of encoded video data for one or more frames has been lost, using picture loss indication (pli) packets.
RTCPeerConnection.addTransceiver() - Web APIs
exceptions typeerror a string was specified as trackorkind which is not valid.
RTCPeerConnection: datachannel event - Web APIs
note: this event is not dispatched when the local end of the connection creates the channel.
RTCPeerConnection.generateCertificate() - Web APIs
rtcpeerconnection.generatecertificate() is a static method, so it is always called on the rtcpeerconnection interface itself, not an instance thereof.
RTCPeerConnection.getConfiguration() - Web APIs
e: 'rsassa-pkcs1-v1_5', hash: 'sha-256', moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]) }).then(function(cert) { configuration.certificates = [cert]; mypeerconnection.setconfiguration(configuration); }); } this example fetches the current configuration of the rtcpeerconnection, then looks to see if it has any certificates set by examining whether or not (a) the configuration has a value for certificates, and (b) whether its length is zero.
RTCPeerConnection.getDefaultIceServers() - Web APIs
however, browsers are not required to provide any default ice servers at all.
RTCPeerConnection.getReceivers() - Web APIs
the order of the returned rtcrtpreceiver instances is not defined by the specification, and may change from one call to getreceivers() to the next.
RTCPeerConnection.getSenders() - Web APIs
the order of the returned rtcrtpsenders is not defined by the specification, and may change from one call to getsenders() to the next.
RTCPeerConnection.getStreamById() - Web APIs
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: iceconnectionstatechange event - Web APIs
usage notes a successful connection attempt will typically involve the state starting at new, then transitioning through checking, then connected, and finally completed.
RTCPeerConnection: icegatheringstatechange event - Web APIs
bubbles no cancelable no interface event event handler onicegatheringstatechange note: while you can determine that ice candidate gathering is complete by watching for icegatheringstatechange events and checking for the value of icegatheringstate to become complete, you can also simply have your handler for the icecandidate event look to see if its candidate property is null.
RTCPeerConnection: icecandidateerror event - Web APIs
pc.addeventlistener("icecandidateerror", (event) => { if (event.errorcode === 701) { reportconnectfail(event.url, event.errortext); } }); note that if multiple stun and/or turn servers are provided when creating the connection, this error may happen more than once, if more than one of those servers fails.
RTCPeerConnection: identityresult event - Web APIs
note: while older versions of the webrtc specification used events to report assertions, this has been deprecated and removed from the specification.
RTCPeerConnection.localDescription - Web APIs
if it has not yet been set, this is null.
RTCPeerConnection.onaddstream - Web APIs
it is included here in order to help you adapt existing code and understand existing samples, which may not be up-to-date yet.
RTCPeerConnection.onconnectionstatechange - Web APIs
the event object contains no special information of note; you can look at the value of the peer connection's connectionstate property to determine what the new state is.
RTCPeerConnection.ondatachannel - Web APIs
at the time this event is received, the rtcdatachannel it indicates may not yet actually be open.
RTCPeerConnection.onicecandidateerror - Web APIs
} else if (event.errorcode >= 700 && event.errorcode <= 799) { // server could not be reached; a specific error number is // provided but these are not yet specified.
RTCPeerConnection.onicegatheringstatechange - Web APIs
this happens when the ice gathering state—that is, whether or not the ice agent is actively gathering candidates—changes.
RTCPeerConnection.onnegotiationneeded - Web APIs
this negotiation should be carried out as the offerer, because some session changes cannot be negotiated as the answerer.
RTCPeerConnection.restartIce() - Web APIs
usage notes after calling restartice(), the next offer created using createoffer() will initiate ice restart once sent to the remote peer over your signaling mechanism.
RTCPeerConnection: signalingstatechange event - Web APIs
an signalingstatechange event is sent to an rtcpeerconnection to notify it that its signaling state, as indicated by the signalingstate property, has changed.
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
usage notes you can think of the local and remote views of the same rtp stream as pairs, each of which has a reference back to the other one.
RTCRemoteOutboundRtpStreamStats.remoteTimestamp - Web APIs
keep in mind that this means the clock may not be synchronized with the local clock, and that both the current time and the pace at which the clock runs may differ to some extent.
RTCRemoteOutboundRtpStreamStats.reportsSent - Web APIs
usage notes sender reports, described in rfc 3550, section 6.4.1 with an overview in rfc 3550, section 6.4, are used by rtp to share data transmission quality feedback between the two peers.
RTCRtpCapabilities - Web APIs
there will only be one entry for rtx, and it will not have an sdpfmtpline property.
RTCRtpCodecParameters - Web APIs
note: on an rtcrtpreceiver, the format-specific parameters come from the sdp sent by the remote peer, while for rtcrtpsender, they're provided by the local description.
RTCRtpReceiver.transport - Web APIs
note that when bundling is in effect—that is, when the rtcpeerconnection was created with an rtcconfiguration object whose bundlepolicy is max-compat or max-bundle—multiple receivers may be sharing the same transport; in this case, all of them are using the same connection to transmit and/or receive rtp and rtcp packets.
RTCRtpSender.track - Web APIs
if no track is associated with the sender, this value is null, in which case the sender transmits nothing.
RTCRtpSender.transport - Web APIs
note that when bundling is in effect—that is, when the rtcpeerconnection was created with an rtcconfiguration object whose bundlepolicy is max-compat or max-bundle—multiple senders may be sharing the same transport; in this case, all of them are using the same connection to transmit and/or receive rtp and rtcp packets.
RTCRtpSender - Web APIs
rtcrtpsender.replacetrack() attempts to replace the track currently being sent by the rtcrtpsender with another track, without performing renegotiation.
RTCRtpStreamStats.firCount - Web APIs
the receiver sends a fir packet to the sender any time it falls bahind or loses packets and cannot decode the incoming stream any longer because of the lost data.
RTCRtpStreamStats.nackCount - Web APIs
note: this value is only available on the receiver.
RTCRtpStreamStats.sliCount - Web APIs
note: this value is sent by the sender to the receiver and is only present for video media.
RTCRtpStreamStats.trackId - Web APIs
note: this value is not the same as the value of mediastramtrack.id.
RTCRtpTransceiver.mid - Web APIs
this value is null if negotiation has not completed.
RTCRtpTransceiver - Web APIs
stopped indicates whether or not sending and receiving using the paired rtcrtpsender and rtcrtpreceiver has been permanently disabled, either due to sdp offer/answer, or due to a call to stop().
RTCSessionDescription - Web APIs
pranswer the session description object describes a provisional answer; that is, a response to a previous offer that is not the final answer.
RTCStats.id - Web APIs
WebAPIRTCStatsid
the format of the id string is not defined by the specification, so you cannot reliably make any assumptions about the contents of the string, or assume that the format of the string will remain unchanged for a given object type.
RTCStats.timestamp - Web APIs
this should be accurate to within a few milliseconds but may not be entirely pricise, either because of hardware or operating system limitations or because of fingerprinting protection in the form of reduced clock precision or accuracy.
RTCTrackEvent.receiver - Web APIs
note: the transceiver includes its own receiver property, which will always be the same rtcrtpreceiver as this one.
RTCTrackEvent.transceiver - Web APIs
note: the rtcrtpreceiver referred to by this rtcrtpreceiver's receiver property will always be the same as the rtctrackevent's receiver property.
RTCTrackEventInit.receiver - Web APIs
note: the transceiver includes its own receiver property, which will always be the same rtcrtpreceiver as this one.
RTCTrackEventInit.streams - Web APIs
if streams is not specified, its default value is an empty array.
RTCTrackEventInit.transceiver - Web APIs
note: the rtcrtpreceiver referred to by this rtcrtpreceiver's receiver property will always be the same as the rtctrackevent's receiver property.
RadioNodeList.value - Web APIs
if the collection does not contain any radio buttons or none of the radio buttons in the collection is in checked state, the empty string is returned.
RadioNodeList - Web APIs
if the collection does not contain any radio buttons or none of the radio buttons in the collection is in checked state, the empty string is returned.
Range.cloneContents() - Web APIs
event listeners added using dom events are not copied during cloning.
Range.cloneRange() - Web APIs
WebAPIRangecloneRange
the returned clone is copied by value, not reference, so a change in either range does not affect the other.
Range.collapsed - Web APIs
WebAPIRangecollapsed
it returns true if the start and end boundary points of the range are the same point in the dom, false if not.
Range.commonAncestorContainer - Web APIs
since a range need not be continuous, and may also partially select nodes, this is a convenient way to find a node which encloses a range.
Range.deleteContents() - Web APIs
unlike range.extractcontents(), this method does not return a documentfragment containing the deleted content.
Range.detach() - Web APIs
WebAPIRangedetach
the range.detach() method does nothing.
Range.extractContents() - Web APIs
event listeners added using dom events are not retained during extraction.
Range.setEndAfter() - Web APIs
WebAPIRangesetEndAfter
the range.setendafter() method sets the end position of a range relative to another node.
Range.setEndBefore() - Web APIs
the range.setendbefore() method sets the end position of a range relative to another node.
Range.setStartBefore() - Web APIs
the range.setstartbefore() method sets the start position of a range relative to another node.
Range.surroundContents() - Web APIs
that is, unlike the alternative above, if there are partially selected nodes, they will not be cloned and instead the operation will fail.
ReadableByteStreamController.desiredSize - Web APIs
note that this can be negative if the queue is over-full.
ReadableByteStreamController.enqueue() - Web APIs
exceptions typeerror the source object is not a readablebytestreamcontroller, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existant or detached.
ReadableByteStreamController.error() - Web APIs
exceptions typeerror the source object is not a readablebytestreamcontroller, or the stream is not readable for some other reason.
ReadableStream.pipeThrough() - Web APIs
syntax var transformedstream = readablestream.pipethrough(transformstream[, options]); parameters transformstream a transformstream (or an object with the structure {writable, readable}) consisting of a readable stream and a writable stream working together to transform some data from one form to another.
ReadableStream.pipeTo() - Web APIs
exceptions typeerror the writablestream and/or readablestream objects are not a writable stream/readable stream, or one or both of the streams are locked.
ReadableStreamBYOBReader.read() - Web APIs
exceptions typeerror the source object is not a readablestreambyobreader, the stream has no owner, the view is not an object or has become detached, or the view's length is 0.
ReadableStreamBYOBReader - Web APIs
the supplied reason argument will be given to the underlying source, which may or may not use it.
ReadableStreamBYOBRequest.respond() - Web APIs
exceptions typeerror the source object is not a readablestreambyobrequest, or there is no associated controller, or the associated internal array buffer is detached.
ReadableStreamBYOBRequest.respondWithNewView() - Web APIs
exceptions typeerror the source object is not a readablestreambyobrequest, or there is no associated controller, or the associated internal array buffer is non-existant or detached.
RelativeOrientationSensor.RelativeOrientationSensor() - Web APIs
this is not something that would ever be shown to a user.
ReportingObserver() - Web APIs
buffered: a boolean that defines whether the reports that were generated before the observer was able to be created should be observable (true) or not (false).
ReportingObserver - Web APIs
note: if you look at the complete source code, you'll notice that we actually call the deprecated getusermedia() method twice.
ReportingObserverOptions - Web APIs
buffered a boolean that defines whether the reports that were generated before the observer was able to be created should be observable (true) or not (false).
Request.context - Web APIs
WebAPIRequestcontext
note: you can find a full list of the different available contexts including associated context frame types, csp directives, and platform feature examples in the fetch spec request context section.
Request.integrity - Web APIs
WebAPIRequestintegrity
if an integrity has not been specified, the property returns ''.
Request.redirect - Web APIs
WebAPIRequestredirect
syntax var myredirect = request.redirect; value a requestredirect enum value, which can be one the following strings: follow error manual if not specified when the request is created, it takes the default value of follow.
Request.referrer - Web APIs
WebAPIRequestreferrer
(e.g., client, no-referrer, or a url.) note: if referrer's value is no-referrer, it returns an empty string.
RequestDestination - Web APIs
values "" the default value of destination is used for destinations that do not have their own value.
ResizeObserverEntry.borderBoxSize - Web APIs
note: for more explanation of writing modes and block and inline dimensions, read handling different text directions.
ResizeObserverEntry.contentBoxSize - Web APIs
note: for more explanation of writing modes and block and inline dimensions, read handling different text directions.
Resource Timing API - Web APIs
however, note that some properties have little to no implementation so see each property's "browser compatibility" section for more specific interoperability data.
Response.headers - Web APIs
WebAPIResponseheaders
note that at the top of the fetch() block we log the response headers value to the console.
Response.status - Web APIs
WebAPIResponsestatus
note that at the top of the fetch() block we log the response status value to the console.
Response.statusText - Web APIs
note that at the top of the fetch() block we log the response statustext value to the console.
Response.url - Web APIs
WebAPIResponseurl
note that at the top of the fetch() block we log the response url to the console.
SVGAnimatedPathData - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgpathelement.
SVGAnimationElement - Web APIs
if the simple duration is undefined (e.g., the end time is indefinite), then a domexception with code not_supported_err is raised.
SVGColorProfileElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and implements methods of svgurireference and svgrenderingintent.
SVGElement: abort event - Web APIs
bubbles no cancelable no interface svgevent event handler property onabort examples svgelem.addeventlistener('abort', () => { console.log('load aborted.'); }) specifications not really described anywhere specifically, but mentioned in the svg 2 spec.
SVGFEComponentTransferElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and implements methods of svgfilterprimitivestandardattributes.
SVGFEDiffuseLightingElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEDistantLightElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement.
SVGFEGaussianBlurElement - Web APIs
roke="#d4dde4" stroke-width="2px" /><text x="361" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfegaussianblurelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_edgemode_unknown 0 the type is not one of predefined types.
SVGFEImageElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and implements methods of svgfilterprimitivestandardattributesand svgurireference.
SVGFEMergeNodeElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement.
SVGFEOffsetElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEPointLightElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement.
SVGFESpecularLightingElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFESpotLightElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement.
SVGFETileElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFilterPrimitiveStandardAttributes - Web APIs
methods this interface does not provide any specific methods.
SVGFitToViewBox - Web APIs
methods the svgfittoviewbox interface does not provide any specific methods.
SVGFontElement - Web APIs
object-oriented access to the attributes of the <font> element via the svg dom is not possible.
SVGFontFaceElement - Web APIs
object-oriented access to the attributes of the <font-face> element via the svg dom is not possible.
SVGFontFaceFormatElement - Web APIs
object-oriented access to the attributes of the <font-face-format> element via the svg dom is not possible.
SVGFontFaceNameElement - Web APIs
object-oriented access to the attributes of the <font-face-name> element via the svg dom is not possible.
SVGFontFaceSrcElement - Web APIs
object-oriented access to the attributes of the <font-face-src> element via the svg dom is not possible.
SVGFontFaceUriElement - Web APIs
object-oriented access to the attributes of the <font-face-uri> element via the svg dom is not possible.
SVGGeometryElement.getPointAtLength() - Web APIs
note: this method was originally part of the svgpathelement interface.
SVGGeometryElement.getTotalLength() - Web APIs
note: this method was originally part of the svgpathelement interface.
SVGGeometryElement.pathLength - Web APIs
note: this property was originally part of the svgpathelement interface.
SVGGeometryElement - Web APIs
/web/api/svggeometryelement" target="_top"><rect x="81" y="65" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="171" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svggeometryelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} note: the pathlength property and the gettotallength() and getpointatlength() methods were originally part of the svgpathelement interface.
SVGGlyphElement - Web APIs
object-oriented access to the attributes of the <glyph> element via the svg dom is not possible.
SVGGraphicsElement: paste event - Web APIs
it's possible to construct and dispatch a synthetic paste event, but this will not affect the document's contents.
SVGGraphicsElement - Web APIs
web/api/svggraphicselement" target="_top"><rect x="301" y="65" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="391" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svggraphicselement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} note: this interface was introduced in svg 2 and replaces the svglocatable and svgtransformable interfaces from svg 1.1.
SVGHKernElement - Web APIs
object-oriented access to the attributes of the <hkern> element via the svg dom is not possible.
SVGMatrix - Web APIs
WebAPISVGMatrix
this matrix is post-multiplied by another matrix, returning the resulting new matrix as svgmatrix.
SVGMissingGlyphElement - Web APIs
object-oriented access to the attributes of the <missing-glyph> element via the svg dom is not possible.
SVGNumber - Web APIs
WebAPISVGNumber
note: if the svgnumber is read-only, a domexception with the code no_modification_allowed_err is raised on an attempt to change the value.
SVGPathElement.getPointAtLength() - Web APIs
note: in svg 2 this property was moved to the svggeometryelement interface, from which the svgpathelement inherits it.
SVGPathElement.getTotalLength() - Web APIs
note: in svg 2 this method was moved to the svggeometryelement interface, from which the svgpathelement inherits it.
SVGPathElement.pathLength - Web APIs
note: in svg 2 this property was moved to the svggeometryelement interface, from which the svgpathelement inherits it.
SVGRenderingIntent - Web APIs
constants name value description rendering_intent_unknown 0 the type is not one of predefined types.
SVGTRefElement - Web APIs
object-oriented access to the attributes of the <tref> element via the svg dom is not possible.
SVGTransformable - Web APIs
methods the svgtransformable interface do not provide any specific methods.
SVGURIReference - Web APIs
methods this interface does not provide any specific methods.
SVGUnitTypes - Web APIs
"#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="61" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgunittypes</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_unit_type_unknown 0 the type is not one of predefined types.
SVGVKernElement - Web APIs
object-oriented access to the attributes of the <vkern> element via the svg dom is not possible.
SVGZoomAndPan - Web APIs
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> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_zoomandpan_unknown 0 the type is not one of predefined types.
Screen.availHeight - Web APIs
note the panels window filling all available vertical space at the left of the screen.
Screen.height - Web APIs
WebAPIScreenheight
} notes note that not all of the height given by this property may be available to the window itself.
Screen.mozEnabled - Web APIs
WebAPIScreenmozEnabled
syntax let screenenabled = window.screen.mozenabled specifications not part of specification.
Screen.onorientationchange - Web APIs
working draft initial definition (not present in the draft anymore) ...
Screen.orientation - Web APIs
note that older, prefixed versions returned a domstring equivalent to screenorientation.type.
Screen.pixelDepth - Web APIs
WebAPIScreenpixelDepth
syntax let depth = window.screen.pixeldepth example // if there is not adequate bit depth // choose a simpler color if ( window.screen.pixeldepth > 8 ) { document.style.color = "#faebd7"; } else { document.style.color = "#ffffff"; } specifications specification status comment css object model (cssom) view modulethe definition of 'screen.pixeldepth' in that specification.
Screen.top - Web APIs
WebAPIScreentop
syntax let top = window.screen.top; specifications not part of any current specification.
ScrollToOptions.behavior - Web APIs
the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not.
ScrollToOptions.left - Web APIs
the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not.
ScrollToOptions.top - Web APIs
the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not.
ScrollToOptions - Web APIs
the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not.
SecurityPolicyViolationEvent.sample - Web APIs
this will only be populated if the resource is an inline script, event handler, or style — external resources causing a violation will not generate a sample.
SecurityPolicyViolationEvent - Web APIs
this will only be populated if the resource is an inline script, event handler, or style — external resources causing a violation will not generate a sample.
Selection.addRange() - Web APIs
example currently only firefox supports multiple selection ranges, other browsers will not add new ranges to the selection if it already contains one.
Selection.anchorNode - Web APIs
the selection's anchor does not move, but the selection's focus, the other end of the selection, does move.
Selection.containsNode() - Web APIs
if not specified, the default value false is used.
Selection.focusNode - Web APIs
the selection's focus moves, but the selection's anchor, the other end of the selection, does not move.
Selection.removeAllRanges() - Web APIs
the selection.removeallranges() method removes all ranges from the selection, leaving the anchornode and focusnode properties equal to null and leaving nothing selected.
Selection.selectAllChildren() - Web APIs
parentnode itself is not part of the selection.
Selection.selectionLanguageChange() - Web APIs
it was removed in bug 949445 and should not be used.
ServiceWorker.onstatechange - Web APIs
on.waiting) { serviceworker = registration.waiting; document.queryselector('#kind').textcontent = 'waiting'; } else if (registration.active) { serviceworker = registration.active; document.queryselector('#kind').textcontent = 'active'; } if (serviceworker) { logstate(serviceworker.state); serviceworker.addeventlistener('statechange', function(e) { logstate(e.target.state); }); } note that when statechange fires, the service worker's references may have changed.
ServiceWorker - Web APIs
methods the serviceworker interface inherits methods from its parent, worker, with the exception of worker.terminate — this should not be accessible from service workers.
ServiceWorkerContainer.controller - Web APIs
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.
ServiceWorkerContainer.onmessage - Web APIs
note: messages received from service worker contexts (e.g.
ServiceWorkerContainer.ready - Web APIs
example if ('serviceworker' in navigator) { navigator.serviceworker.ready .then(function(registration) { console.log('a service worker is active:', registration.active); // at this point, you can call methods that require an active // service worker, like registration.pushmanager.subscribe() }); } else { console.log('service workers are not supported.'); } specifications specification status comment service workersthe definition of 'serviceworkerregistration.ready' in that specification.
ServiceWorkerContainer.startMessages() - Web APIs
note: the messages start being sent automatically when setting the handler directly using serviceworkercontainer.onmessage.
ServiceWorkerGlobalScope.onfetch - Web APIs
note that an http error response (e.g., 404) will not trigger an exception.
ServiceWorkerGlobalScope.onpushsubscriptionchange - Web APIs
working draft initial definition (note: this event is specified in the push api, but accessed through serviceworkerglobalscope.) ...
ServiceWorkerRegistration.active - Web APIs
an active worker controls a serviceworkerclient if the client's url falls within the scope of the registration (the scope option set when serviceworkercontainer.register is first called.) note: this feature is available in web workers.
ServiceWorkerRegistration.installing - Web APIs
note: this feature is available in web workers.
ServiceWorkerRegistration.onupdatefound - Web APIs
note: this feature is available in web workers.
ServiceWorkerRegistration.pushManager - Web APIs
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.scope - Web APIs
note: this feature is available in web workers.
ServiceWorkerRegistration.waiting - Web APIs
note: this feature is available in web workers.
ServiceWorkerState - Web APIs
this is primarily used to ensure that the service worker is not active until all of the core caches are populated.
ShadowRoot.delegatesFocus - Web APIs
let hostelem = shadow.delegatesfocus; specifications this feature is not currently in a specification.
ShadowRoot.innerHTML - Web APIs
examples let customelem = document.queryselector('my-shadow-dom-element'); let shadow = customelem.shadowroot; shadow.innerhtml = '<strong>this element should be more important!</strong>'; specifications this property is not defined by any specifications yet; see this open spec issue to specify it.
SharedWorker - Web APIs
note: if sharedworker can be accessed from several browsing contexts, all those browsing contexts must share the exact same origin (same protocol, host and port).
SharedWorkerGlobalScope.close() - Web APIs
note: there is also a way to stop the worker from the main thread: the worker.terminate method.
SharedWorkerGlobalScope.onconnect - Web APIs
onconnect = function(e) { var port = e.ports[0]; port.onmessage = function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); } port.start(); } for a complete running example, see our basic shared worker example (run shared worker.) note: the data property of the event object used to be null in firefox.
SharedWorkerGlobalScope - Web APIs
some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the javascript reference.
Slottable: assignedSlot - Web APIs
syntax var slotelement = elementinstance.assignedslot value an htmlslotelement instance, or null if the element is not assigned to a slot, or if the associated shadow root was attached with its mode set to closed (see element.attachshadow for further details).
SourceBuffer.mode - Web APIs
WebAPISourceBuffermode
this property cannot be changed during while the sourcebuffer is processing either an appendbuffer() or remove() call.
SourceBuffer.remove() - Web APIs
if sourcebuffer.updating is not equal to false, call sourcebuffer.abort().
SourceBuffer.trackDefaults - Web APIs
the trackdefaults property of the sourcebuffer interface specifies the default values to use if kind, label, and/or language information is not available in the initialization segment of the media to be appended to the sourcebuffer.
SourceBuffer - Web APIs
sourcebuffer.trackdefaults specifies the default values to use if kind, label, and/or language information is not available in the initialization segment of the media to be appended to the sourcebuffer.
SpeechGrammarList.addFromString() - Web APIs
the value can be between 0.0 and 1.0; if not specified, the default used is 1.0.
SpeechRecognition.continuous - Web APIs
true means continuous, and false means not continuous (single result each time.) examples this code is excerpted from our speech color changer example.
SpeechRecognition.interimResults - Web APIs
the interimresults property of the speechrecognition interface controls whether interim results should be returned (true) or not (false.) interim results are results that are not yet final (e.g.
SpeechRecognition.lang - Web APIs
if not specified, this defaults to the html lang attribute value, or the user agent's language setting if that isn't set either.
SpeechRecognition: nomatch event - Web APIs
bubbles no cancelable no interface speechrecognitionevent event handler property onnomatch examples you can use the nomatch event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('nomatch', function() { console.log('speech not recognized'); }); or use the onnomatch event handler property: recognition.onnomatch = function() { console.log('speech not recognized'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that specification.
SpeechRecognition.onsoundend - Web APIs
the onsoundend property of the speechrecognition interface represents an event handler that will run when any sound — recognisable speech or not — has stopped being detected (when the soundend event fires.) syntax myspeechrecognition.onsoundend = function() { ...
SpeechRecognition.onsoundstart - Web APIs
the onsoundstart property of the speechrecognition interface represents an event handler that will run when any sound — recognisable speech or not — has been detected (when the soundstart event fires.) syntax myspeechrecognition.onsoundstart = function() { ...
SpeechRecognition: soundend event - Web APIs
the soundend event of the web speech api is fired when any sound — recognisable speech or not — has stopped being detected.
SpeechRecognition: soundstart event - Web APIs
the soundstart event of the web speech api is fired when any sound — recognisable speech or not — has been detected.
SpeechRecognitionAlternative.confidence - Web APIs
note: mozilla's implementation of confidence is still being worked on — at the moment, it always seems to return 1.
SpeechRecognitionError.message - Web APIs
note that the spec does not define the exact wording of these messages — this is up to the implementors to decide upon.
SpeechRecognitionErrorEvent.message - Web APIs
note that the spec does not define the exact wording of these messages — this is up to the implementors to decide upon.
SpeechRecognitionEvent.resultIndex - Web APIs
the speechrecognitionresultlist object is not an array, but it has a getter that allows it to be accessed by array syntax.
SpeechRecognitionEvent.results - Web APIs
final results on the other hand will not be overwritten or removed.
SpeechRecognitionEvent - Web APIs
speechrecognitionevent.emma read only returns an extensible multimodal annotation markup language (emma) — xml — representation of the result.
SpeechRecognitionResult.isFinal - Web APIs
the isfinal read-only property of the speechrecognitionresult interface is a boolean that states whether this result is final (true) or not (false) — if so, then this is the final time this result will be returned; if not, then this result is an interim result, and may be updated later on.
SpeechRecognitionResult - Web APIs
properties speechrecognitionresult.isfinal read only a boolean that states whether this result is final (true) or not (false) — if so, then this is the final time this result will be returned; if not, then this result is an interim result, and may be updated later on.
SpeechSynthesis.cancel() - Web APIs
this is quite a long sentence to say.'); var utterance2 = new speechsynthesisutterance('we should say another sentence too, just to be on the safe side.'); synth.speak(utterance1); synth.speak(utterance2); synth.cancel(); // utterance1 stops being spoken immediately, and both are removed from the queue specifications specification status comment web speech apithe definition of 'cancel()' in that specification.
SpeechSynthesis.getVoices() - Web APIs
note: the spec wrongly lists this method as returning as a speechsynthesisvoicelist object, but this was in fact removed from the spec.
SpeechSynthesis.onvoiceschanged - Web APIs
}; 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.
SpeechSynthesis.pause() - Web APIs
this is quite a long sentence to say.'); var utterance2 = new speechsynthesisutterance('we should say another sentence too, just to be on the safe side.'); synth.speak(utterance1); synth.speak(utterance2); synth.pause(); // pauses utterances being spoken specifications specification status comment web speech apithe definition of 'pause()' in that specification.
SpeechSynthesis.pending - Web APIs
this is quite a long sentence to say.'); var utterance2 = new speechsynthesisutterance('we should say another sentence too, just to be on the safe side.'); synth.speak(utterance1); synth.speak(utterance2); var amipending = synth.pending; // will return true if utterance 1 is still being spoken and utterance 2 is in the queue specifications specification status comment web speech apithe definition of 'pending' in that specification.
SpeechSynthesis.resume() - Web APIs
this is quite a long sentence to say.'); var utterance2 = new speechsynthesisutterance('we should say another sentence too, just to be on the safe side.'); synth.speak(utterance1); synth.speak(utterance2); synth.pause(); // pauses utterances being spoken synth.resume() // resumes speaking specifications specification status comment web speech apithe definition of 'resume()' in that specification.
SpeechSynthesis.speaking - Web APIs
this is quite a long sentence to say.'); var utterance2 = new speechsynthesisutterance('we should say another sentence too, just to be on the safe side.'); synth.speak(utterance1); synth.speak(utterance2); var amispeaking = synth.speaking; // will return true if utterance 1 or utterance 2 are currently being spoken specifications specification status comment web speech apithe definition of 'speaking' in that specification.
SpeechSynthesisUtterance.voice - Web APIs
if not set by the time the utterance is spoken, the voice used will be the most suitable default voice available for the utterance's lang setting.
SpeechSynthesisUtterance.volume - Web APIs
if not set, the default value 1 will be used.
SpeechSynthesisVoice - Web APIs
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.
StaticRange.StaticRange() - Web APIs
it includes properties identifying the standard and end positions of the range as well as a boolean indicating whether or not the range is collapsed (that is, empty).
StereoPannerNode.pan - Web APIs
note: though the audioparam returned is read-only, the value it represents is not.
Storage.clear() - Web APIs
WebAPIStorageclear
function populatestorage() { localstorage.setitem('bgcolor', 'red'); localstorage.setitem('font', 'helvetica'); localstorage.setitem('image', 'migato.png'); localstorage.clear(); } note: for a real world example, see our web storage demo.
Storage.length - Web APIs
WebAPIStoragelength
example the following function adds three data items to the local storage for the current domain, then returns the number of items in the storage: function populatestorage() { localstorage.setitem('bgcolor', 'yellow'); localstorage.setitem('font', 'helvetica'); localstorage.setitem('image', 'cats.png'); return localstorage.length; // should return 3 } note: for a real world example, see our web storage demo.
Storage.setItem() - Web APIs
WebAPIStoragesetItem
function populatestorage() { localstorage.setitem('bgcolor', 'red'); localstorage.setitem('font', 'helvetica'); localstorage.setitem('image', 'mycat.png'); } note: to see this used within a real world example, see our web storage demo.
StorageEstimate.quota - Web APIs
the storageestimate dictionary's quota property is a conservative approximation of how much storage is allotted to the origin or web app that called storagemanager.estimate(); there may be more space available, but there will not be less.
StorageEstimate.usage - Web APIs
the storageestimate dictionary's usage property is a conservative approximation of how much storage is allotted to the origin or web app that called storagemanager.estimate(); there may be more space available, but there will not be less.
StorageManager.persist() - Web APIs
example if (navigator.storage && navigator.storage.persist) navigator.storage.persist().then(function(persistent) { if (persistent) console.log("storage will not be cleared except by explicit user action"); else console.log("storage may be cleared by the ua under storage pressure."); }); specifications specification status comment storagethe definition of 'persist' in that specification.
StorageManager.persisted() - Web APIs
example if (navigator.storage && navigator.storage.persist) navigator.storage.persisted().then(function(persistent) { if (persistent) console.log("storage will not be cleared except by explicit user action"); else console.log("storage may be cleared by the ua under storage pressure."); }); specifications specification status comment storagethe definition of 'persisted' in that specification.
StyleSheet.disabled - Web APIs
note that disabled == false does not guarantee the style sheet is applied (it could be removed from the document, for instance).
Stylesheet.href - Web APIs
WebAPIStyleSheethref
example // on a local machine: <html> <head> <link rel="stylesheet" href="example.css" type="text/css" /> <script> function sref() { alert(document.stylesheets[0].href); } </script> </head> <body> <div class="thunder">thunder</div> <button onclick="sref()">ss</button> </body> </html> // returns "file:////c:/windows/desktop/example.css notes if the style sheet is a linked style sheet, the value of its attribute is its location.
StyleSheet.ownerNode - Web APIs
syntax noderef = stylesheet.ownernode example <html lang="en"> <head> <link rel="stylesheet" href="example.css"> </head> <body> <button onclick="alert(document.stylesheets[0].ownernode)">show example.css’s ownernode</button> </body> </html> // displays "object htmllinkelement" notes for style sheets that are included by other style sheets, such as with @import, the value of this property is null.
StyleSheet.parentStyleSheet - Web APIs
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.
StyleSheet - Web APIs
properties stylesheet.disabled is a boolean representing whether the current stylesheet has been applied or not.
SubmitEvent.submitter - Web APIs
if the submission was not triggered by a button of some kind, the value of submitter is null.
SubmitEvent - Web APIs
note that currently, the only valid type for a submitevent is submit.
SubtleCrypto.digest() - Web APIs
warning: this algorithm is now considered vulnerable and should not be used for cryptographic applications.
SubtleCrypto.generateKey() - Web APIs
examples note: you can try the working examples on github.
SyncEvent.SyncEvent() - Web APIs
lastchance: a boolean indicating that the user agent will not make further synchronization attempts after the current attempt.
SyncEvent - Web APIs
WebAPISyncEvent
syncevent.lastchance read only returns true if the user agent will not make further synchronization attempts after the current attempt.
SyncManager.register() - Web APIs
the default is 0, meaning events are not periodic.
Text - Web APIs
WebAPIText
text.iselementcontentwhitespace read only returns a boolean flag indicating whether or not the text node contains only whitespace.
TextDecoder() - Web APIs
"chinese", "csgb2312", "csiso58gb231280", "gb2312", "gb_2312", "gb_2312-80", "gbk", "iso-ir-58", "x-gbk" 'gbk' "gb18030" 'gb18030' "hz-gb-2312" 'hz-gb-2312' "big5", "big5-hkscs", "cn-big5", "csbig5", "x-x-big5" 'big5' "cseucpkdfmtjapanese", "euc-jp", "x-euc-jp" 'euc-jp' "csiso2022jp", "iso-2022-jp" note: firefox used to accept iso-2022-jp-2 sequences silently when an iso-2022-jp decoder was instantiated, however this was removed in version 56 to simplify the api, as no other browsers support it and no pages seem to use it.
TextDecoder.prototype.decode() - Web APIs
set to true if processing the data in chunks, and false for the final chunk or if the data is not chunked.
TextTrackList.length - Web APIs
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.
TextTrackList.onchange - Web APIs
note: you can also add a handler for the change event using addeventlistener().
TextTrackList.onremovetrack - Web APIs
note: you can also add a handler for the removetrack event using addeventlistener().
TextTrackList - Web APIs
usage notes in addition to being able to obtain direct access to the text tracks present on a media element, texttracklist lets you set event handlers on the addtrack and removetrack events, so that you can detect when tracks are added to or removed from the media element's stream.
Touch.force - Web APIs
WebAPITouchforce
a value of 0.0 is returned if no value is known (for example the touch device does not support this property).
Touch.target - Web APIs
WebAPITouchtarget
note that if the target element is removed from the document, events will still be targeted at it, and hence won't necessarily bubble up to the window or document anymore.
TouchEvent.ctrlKey - Web APIs
syntax var ctrlenabled = touchevent.ctrlkey; return value ctrlenabled true if the control key is enabled for this event; and false if the control is not enabled.
TouchList.identifiedTouch() - Web APIs
specifications not part of any specification.
TouchList.item() - Web APIs
WebAPITouchListitem
returns null if the index is not less than the length of the list.
TrackDefault.byteStreamTrackID - Web APIs
if not specified in the constructor, this value will be an empty string and the sourcebuffer can contain any tracks of the specified trackdefault.type.
TrackDefault.kinds - Web APIs
the kinds read-only property of the trackdefault interface returns default kinds for an associated sourcebuffer to use when an initialization segment does not contain label information for a new track.
TrackDefault.label - Web APIs
the label read-only property of the trackdefault interface returns the default label for an associated sourcebuffer to use when an initialization segment does not contain label information for a new track.
TrackDefault.language - Web APIs
the language read-only property of the trackdefault interface returns a default language for an associated sourcebuffer to use when an initialization segment does not contain language information for a new track.
TransitionEvent.elapsedTime - Web APIs
this value is not affected by the transition-delay property.
TreeWalker.expandEntityReferences - Web APIs
the treewalker.expandentityreferences read-only property returns a boolean flag indicating whether or not the children of entity reference nodes are visible to the treewalker.
TreeWalker.filter - Web APIs
WebAPITreeWalkerfilter
when creating the treewalker, the filter object is passed in as the third parameter, and its method nodefilter.acceptnode() is called on every single node to determine whether or not to accept it.
TreeWalker.firstChild() - Web APIs
if no such child exists, returns null and the current node is not changed.
TreeWalker.lastChild() - Web APIs
if no such child exists, returns null and the current node is not changed.
TreeWalker.nextNode() - Web APIs
if no such node exists, returns null and the current node is not changed.
TreeWalker.nextSibling() - Web APIs
if there is no such node, return null and the current node is not changed.
TreeWalker.parentNode() - Web APIs
if no such node exists, or if it is above the treewalker's root node, returns null and the current node is not changed.
TreeWalker.previousNode() - Web APIs
if no such node exists,or if it is before that the root node defined at the object construction, returns null and the current node is not changed.
TreeWalker.previousSibling() - Web APIs
if there is no such node, return null and the current node is not changed.
sourceCapabilities - Web APIs
for example, many user agents allow a window to be resized with a mouse or a keyboard, but this detail is not exposed to the web platform in any way, and so the sourcecapabilities of a resize event will typically be null.
URL.hostname - Web APIs
WebAPIURLhostname
note: this feature is available in web workers.
URL.href - Web APIs
WebAPIURLhref
note: this feature is available in web workers.
URL.origin - Web APIs
WebAPIURLorigin
note: this feature is available in web workers.
URL.password - Web APIs
WebAPIURLpassword
note: this feature is available in web workers.
URL.pathname - Web APIs
WebAPIURLpathname
note: this feature is available in web workers.
URL.pathname - Web APIs
note: this feature is available in web workers.
URL.protocol - Web APIs
WebAPIURLprotocol
note: this feature is available in web workers.
URL.search - Web APIs
WebAPIURLsearch
note: this feature is available in web workers.
URL.search - Web APIs
WebAPIURLsearch?q=123
note: this feature is available in web workers.
URL.searchParams - Web APIs
WebAPIURLsearchParams
note: this feature is available in web workers.
URL.toJSON() - Web APIs
WebAPIURLtoJSON
note: this feature is available in web workers.
URL.toString() - Web APIs
WebAPIURLtoString
note: this feature is available in web workers.
URL.username - Web APIs
WebAPIURLusername
note: this feature is available in web workers.
URLSearchParams() - Web APIs
note: this feature is available in web workers.
URLSearchParams.append() - Web APIs
note: this feature is available in web workers.
URLSearchParams.delete() - Web APIs
note: this feature is available in web workers.
URLSearchParams.entries() - Web APIs
note: this feature is available in web workers.
URLSearchParams.forEach() - Web APIs
note: this feature is available in web workers.
URLSearchParams.get() - Web APIs
note: this feature is available in web workers.
URLSearchParams.getAll() - Web APIs
note: this feature is available in web workers.
URLSearchParams.has() - Web APIs
note: this feature is available in web workers.
URLSearchParams.keys() - Web APIs
note: this method is available in web workers.
URLSearchParams.set() - Web APIs
note: this feature is available in web workers.
URLSearchParams.sort() - Web APIs
note: this feature is available in web workers.
URLSearchParams.values() - Web APIs
note: this feature is available in web workers.
USBDevice.controlTransferOut() - Web APIs
not all commands require data; some commands can send data just through the value parameter.
USBInTransferResult - Web APIs
a stall on the control endpoint does not need to be cleared.
USBInterface - Web APIs
usbinterface.claimedread only returns whether or not this interface has been claimed by the current page by calling usbdevice.claiminterface().
USBIsochronousInTransferPacket - Web APIs
a stall on an isochronous endpoint does not need to be cleared.
USBIsochronousOutTransferPacket - Web APIs
a stall on an isochronous endpoint does not need to be cleared.
USVString - Web APIs
WebAPIUSVString
usvstring is equivalent to domstring except for not allowing unpaired surrogate codepoints.
UserProximityEvent.near - Web APIs
the near property tell if there is an object close to the device (true) or not (false).
VRStageParameters - Web APIs
examples var info = document.queryselector('p'); var vrdisplay; navigator.getvrdisplays().then(function(displays) { vrdisplay = displays[0]; var stageparams = vrdisplay.stageparameters; // stageparams is a vrstageparameters object if(stageparams === null) { info.textcontent = 'your vr hardware does not support room-scale experiences.' } else { info.innerhtml = '<strong>display stage parameters</strong>' + '<br>sitting to standing transform: ' + stageparams.sittingtostandingtransform + '<br>play area width (m): ' + stageparams.sizex + '<br>play area depth (m): ' + stageparams.sizey } }); specifications specification status ...
VTTCue() - Web APIs
WebAPIVTTCueVTTCue
this is the time, given in seconds and fractions of a second, denoting the beginning of the range of the media data to which this cue applies.
VTTCue - Web APIs
WebAPIVTTCue
embed live sample can not show subtitles in chrome.
validityState.badInput - Web APIs
note: while this is unsupported in internet explorer, any non-numeric value will be dismissed from the field if it is a number input.
ValidityState.rangeOverflow - Web APIs
the read-only rangeoverflow 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 max attribute.
ValidityState.rangeUnderflow - Web APIs
the read-only rangeunderflow 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 min attribute.
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.
VideoPlaybackQuality.corruptedVideoFrames - Web APIs
it is up to the user agent to determine whether or not to display a corrupted video frame.
VideoPlaybackQuality - Web APIs
methods the videoplaybackquality interface has no methods, and does not inherit any.
Videotrack.language - Web APIs
syntax var videotracklanguage = videotrack.language; value a domstring specifying the bcp 47 (rfc 5646) format language tag of the primary language used in the video track, or an empty string ("") if the language is not specified or known, or if the track doesn't contain speech.
VideoTrack.sourceBuffer - Web APIs
the read-only videotrack property sourcebuffer returns the sourcebuffer that created the track, or null if the track was not created by a sourcebuffer or the sourcebuffer has been removed from the mediasource.sourcebuffers attribute of its parent media source.
VideoTrackList.length - Web APIs
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.
VideoTrackList.onchange - Web APIs
note: you can also add a handler for the change event using addeventlistener().
VideoTrackList.onremovetrack - Web APIs
note: you can also add a handler for the removetrack event using addeventlistener().
VideoTrackList - Web APIs
usage notes in addition to being able to obtain direct access to the video tracks present on a media element, videotracklist lets you set event handlers on the addtrack and removetrack events, so that you can detect when tracks are added to or removed from the media element's stream.
Visual Viewport API - Web APIs
one thing that may not be clear in this example is the use of the pendingupdate flag and the call to requestanimationframe().
WEBGL_compressed_texture_etc1 - Web APIs
constants the compressed texture format is exposed by a constant and can be used with the compressedteximage2d() method (note that etc1 is not supported with the compressedtexsubimage2d() method).
WEBGL_compressed_texture_pvrtc - Web APIs
note: on ios devices, this extension is named webkit_webgl_compressed_texture_pvrtc.
WEBGL_debug_renderer_info - Web APIs
availability: depending on the privacy settings of the browser, this extension might only be available to privileged contexts or not work at all.
WEBGL_debug_shaders.getTranslatedShaderSource() - Web APIs
an empty string is returned, if: no source has been defined or, webglrenderingcontext.compileshader() has not yet been called or, the translation for the shader failed.
WEBGL_debug_shaders - Web APIs
this extension is not directly available to web sites as the way of how the shader is translated may uncover personally-identifiable information to the web page about the kind of graphics card in the user's computer.
WEBGL_lose_context.restoreContext() - Web APIs
syntax gl.getextension('webgl_lose_context').restorecontext(); errors thrown invalid_operation if the context was not lost.
WebGL2RenderingContext.createQuery() - Web APIs
webglquery objects are not available in webgl 1.
WebGL2RenderingContext.createSampler() - Web APIs
webglsampler objects are not available in webgl 1.
WebGL2RenderingContext.createTransformFeedback() - Web APIs
webgltransformfeedback objects are not available in webgl 1.
WebGL2RenderingContext.deleteQuery() - Web APIs
webglquery objects are not available in webgl 1.
WebGL2RenderingContext.deleteSampler() - Web APIs
webglsampler objects are not available in webgl 1.
WebGL2RenderingContext.deleteSync() - Web APIs
webglsync objects are not available in webgl 1.
WebGL2RenderingContext.deleteTransformFeedback() - Web APIs
webgltransformfeedback objects are not available in webgl 1.
WebGL2RenderingContext.drawArraysInstanced() - Web APIs
note: when using webgl 1, the angle_instanced_arrays extension can provide this method, too.
WebGL2RenderingContext.drawRangeElements() - Web APIs
exceptions if mode is not one of the accepted values, a gl.invalid_enum error is thrown.
WebGL2RenderingContext.fenceSync() - Web APIs
webglsync objects are not available in webgl 1.
WebGL2RenderingContext.getActiveUniforms() - Web APIs
gl.uniform_is_row_major: returns an array of glboolean indicating whether each of the uniforms is a row-major matrix or not.
WebGL2RenderingContext.getQueryParameter() - Web APIs
gl.query_result_available: returns a glboolean indicating whether or not a query result is available.
WebGL2RenderingContext.getUniformBlockIndex() - Web APIs
examples // assuming a shader with the following declaration: // uniform ubodata { // mat4 foo; // } instancename; // use the block name, not the instance name: var blockindex = gl.getuniformblockindex(program, 'ubodata'); specifications specification status comment webgl 2.0the definition of 'getuniformblockindex' in that specification.
WebGL2RenderingContext.isVertexArray() - Web APIs
return value a glboolean indicating whether the given object is a valid webglvertexarrayobject object (true) or not (false).
WebGL2RenderingContext.transformFeedbackVaryings() - Web APIs
examples var transformfeedback = gl.createtransformfeedback(); gl.bindtransformfeedback(gl.transform_feedback, transformfeedback); var transformfeedbackoutputs = ['gl_position', 'anotheroutput']; gl.transformfeedbackvaryings(shaderprog, transformfeedbackoutputs, gl.interleaved_attribs); gl.linkprogram(shaderprog); specifications specification status comment webgl 2.0the definition of 'transformfeedbackvaryings' in that specification.
WebGL2RenderingContext.uniform[1234][uif][v]() - Web APIs
not all combinations are valid: u cannot be combined with f.
WebGL2RenderingContext.vertexAttribDivisor() - Web APIs
note: when using webgl 1, the angle_instanced_arrays extension can provide this method, too.
WebGLBuffer - Web APIs
description the webglbuffer object does not define any methods or properties of its own and its content is not directly accessible.
WebGLFramebuffer - Web APIs
description the webglframebuffer object does not define any methods or properties of its own and its content is not directly accessible.
WebGLProgram - Web APIs
var program = gl.createprogram(); // attach pre-existing shaders gl.attachshader(program, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); if ( !gl.getprogramparameter( program, gl.link_status) ) { var info = gl.getprograminfolog(program); throw 'could not compile webgl program.
WebGLRenderbuffer - Web APIs
description the webglrenderbuffer object does not define any methods or properties of its own and its content is not directly accessible.
WebGLRenderingContext.activeTexture() - Web APIs
exceptions if texture is not one of gl.texturei, where i is within the range from 0 to gl.max_combined_texture_image_units - 1, a gl.invalid_enum error is thrown.
WebGLRenderingContext.attachShader() - Web APIs
var program = gl.createprogram(); // attach pre-existing shaders gl.attachshader(program, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); if ( !gl.getprogramparameter( program, gl.link_status) ) { var info = gl.getprograminfolog(program); throw 'could not compile webgl program.
WebGLRenderingContext.bindAttribLocation() - Web APIs
this name cannot start with "webgl_" or "_webgl_", as these are reserved for use by webgl.
WebGLRenderingContext.bindFramebuffer() - Web APIs
exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer, gl.draw_framebuffer, or gl.read_framebuffer.
WebGLRenderingContext.bindRenderbuffer() - Web APIs
exceptions a gl.invalid_enum error is thrown if target is not gl.renderbuffer.
WebGLRenderingContext.bindTexture() - Web APIs
exceptions a gl.invalid_enum error is thrown if target is not gl.texture_2d, gl.texture_cube_map, gl.texture_3d, or gl.texture_2d_array.
WebGLRenderingContext.blendEquation() - Web APIs
default value: gl.func_add exception if mode is not one of the three possible values, a gl.invalid_enum error is thrown.
WebGLRenderingContext.blendEquationSeparate() - Web APIs
exceptions if mode is not one of the three possible values, a gl.invalid_enum error is thrown.
WebGLRenderingContext.canvas - Web APIs
it might be null if it is not associated with a <canvas> element or an offscreencanvas object.
WebGLRenderingContext.clear() - Web APIs
exceptions if mask is not one of the listed possible values, a gl.invalid_enum error is thrown.
WebGLRenderingContext.commit() - Web APIs
the webglrenderingcontext.commit() method pushes frames back to the original htmlcanvaselement, if the context is not directly fixed to a specific canvas.
WebGLRenderingContext.createProgram() - Web APIs
examples creating a webgl program var program = gl.createprogram(); // attach pre-existing shaders gl.attachshader(program, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); if ( !gl.getprogramparameter( program, gl.link_status) ) { var info = gl.getprograminfolog(program); throw 'could not compile webgl program.
WebGLRenderingContext.cullFace() - Web APIs
the webglrenderingcontext.cullface() method of the webgl api specifies whether or not front- and/or back-facing polygons can be culled.
WebGLRenderingContext.depthFunc() - Web APIs
possible values are: gl.never (never pass) gl.less (pass if the incoming value is less than the depth buffer value) gl.equal (pass if the incoming value equals the the depth buffer value) gl.lequal (pass if the incoming value is less than or equal to the depth buffer value) gl.greater (pass if the incoming value is greater than the depth buffer value) gl.notequal (pass if the incoming value is not equal to the depth buffer value) gl.gequal (pass if the incoming value is greater than or equal to the depth buffer value) gl.always (always pass) return value none.
WebGLRenderingContext.depthMask() - Web APIs
syntax void gl.depthmask(flag); parameters flag a glboolean specifying whether or not writing into the depth buffer is enabled.
WebGLRenderingContext.drawArrays() - Web APIs
exceptions if mode is not one of the accepted values, a gl.invalid_enum error is thrown.
WebGLRenderingContext.drawingBufferHeight - Web APIs
it should match the height attribute of the <canvas> element associated with this context, but might differ if the implementation is not able to provide the requested height.
WebGLRenderingContext.drawingBufferWidth - Web APIs
it should match the width attribute of the <canvas> element associated with this context, but might differ if the implementation is not able to provide the requested width.
WebGLRenderingContext.getExtension() - Web APIs
return value a webgl extension object, or null if name does not match (case-insensitive) to one of the strings in webglrenderingcontext.getsupportedextensions.
WebGLRenderingContext.getFramebufferAttachmentParameter() - Web APIs
exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer, gl.draw_framebuffer, gl.read_framebuffer or if attachment is not one of the accepted attachment points.
WebGLRenderingContext.getParameter() - Web APIs
ext.gpu_disjoint_ext glboolean ext_disjoint_timer_query returns whether or not the gpu performed any disjoint operation.
WebGLRenderingContext.getTexParameter() - Web APIs
gl.texture_compare_func glenum comparison function gl.lequal (default value), gl.gequal, gl.less, gl.greater, gl.equal, gl.notequal, gl.always, gl.never.
WebGLRenderingContext.getUniformLocation() - Web APIs
gl_invalid_value the program parameter is not a value or object generated by webgl.
WebGLRenderingContext.getVertexAttrib() - Web APIs
when using a webgl 2 context, the following values are available additionally: gl.vertex_attrib_array_integer: returns a glboolean indicating whether or not an integer data type is in the vertex attribute array at the given index.
WebGLRenderingContext.isBuffer() - Web APIs
return value a glboolean indicating whether or not the buffer is valid.
WebGLRenderingContext.isFramebuffer() - Web APIs
return value a glboolean indicating whether or not the frame buffer is valid.
WebGLRenderingContext.isProgram() - Web APIs
return value a glboolean indicating whether or not the program is valid.
WebGLRenderingContext.isRenderbuffer() - Web APIs
return value a glboolean indicating whether or not the renderbuffer is valid.
WebGLRenderingContext.isShader() - Web APIs
return value a glboolean indicating whether or not the shader is valid.
WebGLRenderingContext.isTexture() - Web APIs
return value a glboolean indicating whether or not the texture is valid.
WebGLRenderingContext.lineWidth() - Web APIs
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.
WebGLRenderingContext.linkProgram() - Web APIs
examples var program = gl.createprogram(); // attach pre-existing shaders gl.attachshader(program, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); if ( !gl.getprogramparameter( program, gl.link_status) ) { var info = gl.getprograminfolog(program); throw new error('could not compile webgl program.
WebGLRenderingContext.sampleCoverage() - Web APIs
invert a glboolean which sets whether or not the coverage masks should be inverted.
WebGLRenderingContext.stencilFunc() - Web APIs
gl.notequal: pass if (ref & mask) != (stencil & mask).
WebGLRenderingContext.stencilFuncSeparate() - Web APIs
gl.notequal: pass if (ref & mask) != (stencil & mask).
WebGLRenderingContext.texParameter[fi]() - Web APIs
gl.texture_compare_func texture comparison function gl.lequal (default value), gl.gequal, gl.less, gl.greater, gl.equal, gl.notequal, gl.always, gl.never.
WebGLRenderingContext.validateProgram() - Web APIs
examples var program = gl.createprogram(); // attach pre-existing shaders gl.attachshader(program, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); gl.validateprogram(program); if ( !gl.getprogramparameter( program, gl.link_status) ) { var info = gl.getprograminfolog(program); throw 'could not compile webgl program.
WebGLRenderingContext.vertexAttrib[1234]f[v]() - Web APIs
this value will be used if a bound array buffer has not been enabled with enablevertexattribarray.
WebGLSampler - Web APIs
webglsampler objects are not available in webgl 1.
WebGLSync - Web APIs
WebAPIWebGLSync
webglsync objects are not available in webgl 1.
WebGLTexture - Web APIs
description the webgltexture object does not define any methods or properties of its own and its content is not directly accessible.
WebGLTransformFeedback - Web APIs
webgltransformfeedback objects are not available in webgl 1.
WebGLUniformLocation - Web APIs
description the webgluniformlocation object does not define any methods or properties of its own and its content is not directly accessible.
Animating textures in WebGL - Web APIs
that means that you'll not only need to deploy code like using a secure web server, but you'll need a secure server to test with as well.
Creating 3D objects using WebGL - Web APIs
if you wonder why we need 24 vertices, and not just 8, it is because each corner belongs to three faces of different colors, and a single vertex needs to have a single specific color; therefore we will create three copies of each vertex in three different colors, one for each face.
Lighting in WebGL - Web APIs
fortunately, it's not all that hard to do, and this article will cover some of the basics.
WebGL: 2D and 3D graphics for the web - Web APIs
WebAPIWebGL API
not optimized for webgl but extremely robust.
WebRTC Statistics API - Web APIs
mapping of statistic category names to the dictionaries they implement statistic category name (rtcstatstype) description dictionaries implemented candidate-pair statistics describing the change from one rtcicetransport to another, such as during an ice restart.
WebSocket.readyState - Web APIs
the connection is not yet open.
The WebSocket API (WebSockets) - Web APIs
note: while a websocket connection is functionally somewhat similar to standard unix-style sockets, they are not related.
WebXR performance guide - Web APIs
this has multiple benefits: the memory allocated for each value or structure will not need to be reallocated every frame.
Web Animations API - Web APIs
this interface exists to define timeline features (inherited by documenttimeline and future timeline objects) and is not itself accessed by developers.
Web Audio API best practices - Web APIs
browser vendors decided that web audio contexts should not be allowed to automatically play audio; they should instead be started by a user.
Web Audio API - Web APIs
if you are more familiar with the musical side of things, are familiar with music theory concepts, want to start building instruments, then you can go ahead and start building things with the advance tutorial and others as a guide (the above linked tutorial covers scheduling notes, creating bespoke oscillators and envelopes, as well as an lfo among other things.) if you aren't familiar with the programming basics, you might want to consult some beginner's javascript tutorials first and then come back here — see our beginner's javascript learning module for a great place to begin.
Web Crypto API - Web APIs
if you're not sure you know what you are doing, you probably shouldn't be using this api.
Window: animationend event - Web APIs
if the animation aborts before reaching completion, such as if the element is removed from the dom or the animation is removed from the element, the animationend event is not fired.
Window.blur() - Web APIs
WebAPIWindowblur
syntax window.blur() example window.blur(); notes the window.blur() method is the programmatic equivalent of the user shifting focus away from the current window.
Window.clearImmediate() - Web APIs
this method is not expected to become standard, and is only implemented by recent builds of internet explorer and node.js 0.10+.
Window.crypto - Web APIs
WebAPIWindowcrypto
although the property itself is read-only, all of its methods (and the methods of its child object, subtlecrypto) are not read-only, and therefore vulnerable to attack by polyfill.
Window.defaultStatus - Web APIs
example <html> <body onload="window.defaultstatus='hello!';"/> <button onclick="window.confirm('are you sure you want to quit?');">confirm</button> </body> </html> notes to set the status once the window has been opened, use window.status.
Window.directories - Web APIs
example <script> function dirs() { alert(window.directories); } </script> specification not part of specification.
Window.history - Web APIs
WebAPIWindowhistory
example history.back(); // equivalent to clicking back button history.go(-1); // equivalent to history.back(); notes for top-level pages you can see the list of pages in the session history, accessible via the history object, in the browser's dropdowns next to the back and forward buttons.
Window.home() - Web APIs
WebAPIWindowhome
not part of specification.
Window.innerHeight - Web APIs
usage notes to obtain the height of the window minus its horizontal scroll bar and any borders, use the root <html> element's clientheight() property instead.
Window.innerWidth - Web APIs
WebAPIWindowinnerWidth
usage notes if you need to obtain the width of the window minus the scrollbar and borders, use the root <html> element's clientwidth property instead.
Window.isSecureContext - Web APIs
syntax var issecure = window.issecurecontext examples feature detection you can use feature detection to check whether they are in a secure context or not by using the issecurecontext boolean which is exposed on the global scope.
Window: load event - Web APIs
WebAPIWindowload event
and note there are many places in the specification that refer to things that can "delays the load event".
window.location - Web APIs
WebAPIWindowlocation
note that security settings, like cors, may prevent this to effectively happen.
Window.moveBy() - Web APIs
WebAPIWindowmoveBy
note: this function moves the window relative to its current location.
Window.moveTo() - Web APIs
WebAPIWindowmoveTo
note: this function moves the window to an absolute location.
Window.mozAnimationStartTime - Web APIs
this value should be used instead of, for example, date.now(), because this value will be the same for all animations started in this window during this refresh interval, allowing them to remain in sync with one another.
Window.mozPaintCount - Web APIs
specification not part of any w3c technical specification or recommendation.
Window.onbeforeinstallprompt - Web APIs
window.addeventlistener("beforeinstallprompt", function(beforeinstallpromptevent) { beforeinstallpromptevent.preventdefault(); // prevents immediate prompt display // shows prompt after a user clicks an "install" button installbutton.addeventlistener("click", function(mouseevent) { // you should not use the mouseevent here, obviously beforeinstallpromptevent.prompt(); }); installbutton.hidden = false; // make button operable }); ...
Window.ondeviceorientationabsolute - Web APIs
}); specifications this event handler is not currently part of any specification.
Window: online event - Web APIs
note: this event shouldn't be used to determine the availability of a particular website.
Window.opener - Web APIs
WebAPIWindowopener
if this window was not opened by being linked to or created by another, returns null.
Window.outerHeight - Web APIs
notes to change the size of a window, see window.resizeby() and window.resizeto().
Window.outerWidth - Web APIs
WebAPIWindowouterWidth
notes to change the size of a window, see window.resizeby() and window.resizeto().
Window.parent - Web APIs
WebAPIWindowparent
if a window does not have a parent, its parent property is a reference to itself.
Window: resize event - Web APIs
there is a proposal to allow all elements to be notified of resize changes.
Window.restore() - Web APIs
WebAPIWindowrestore
this method is currently not working, but you can use: window.moveto(window.screenx, window.screeny); browser compatibility the compatibility table in this page is generated from structured data.
Window.scroll() - Web APIs
WebAPIWindowscroll
examples <!-- put the 100th vertical pixel at the top of the window --> <button onclick="scroll(0, 100);">click to scroll down 100 pixels</button> using options: window.scroll({ top: 100, left: 100, behavior: 'smooth' }); notes window.scrollto() is effectively the same as this method.
Window.scrollByLines() - Web APIs
example <!-- scroll up the document by 5 lines --> <button id="scroll-up" onclick="scrollbylines(-5);">up 5 lines</button> <!-- scroll down the document by 5 lines --> <button id="scroll-down" onclick="scrollbylines(5);">down 5 lines</button> specification this is not part of any specification.
Window.scrollByPages() - Web APIs
not part of specification.
Window.scrollTo() - Web APIs
WebAPIWindowscrollTo
examples window.scrollto(0, 1000); using options: window.scrollto({ top: 100, left: 100, behavior: 'smooth' }); notes window.scroll() is effectively the same as this method.
Window.sizeToContent() - Web APIs
syntax window.sizetocontent() example window.sizetocontent(); specification this feature is not part of any specification.
Window.statusbar - Web APIs
WebAPIWindowstatusbar
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>various dom tests</title> <script> // changing bar states on the existing window netscape.security.privilegemanager.enableprivilege("universalbrowserwrite"); window.statusbar.visible=!window.statusbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> notes when you load the example page above, the browser displays the following dialog: to toggle the visibility of these bars, you must either sign your scripts or enable the appropriate privileges, as in the example above.
Window.stop() - Web APIs
WebAPIWindowstop
because of how scripts are executed, this method cannot interrupt its parent document's loading, but it will stop its images, new windows, and other still-loading objects.
Window: storage event - Web APIs
the storage event of the window interface fires when a storage area (localstorage) has been modified in the context of another document.
Window.top - Web APIs
WebAPIWindowtop
syntax var topwindow = window.top; notes where the window.parent property returns the immediate parent of the current window, window.top returns the topmost window in the hierarchy of window objects.
Window: unhandledrejection event - Web APIs
bubbles no cancelable yes interface promiserejectionevent event handler property onunhandledrejection usage notes allowing the unhandledrejection event to bubble will eventually result in an error message being output to the console.
Window: unload event - Web APIs
bubbles no cancelable no interface event event handler property onunload it is fired after: beforeunload (cancelable event) pagehide the document is in the following state: all the resources still exist (img, iframe etc.) nothing is visible anymore to the end user ui interactions are ineffective (window.open, alert, confirm, etc.) an error won't stop the unloading workflow please note that the unload event also follows the document tree: parent frame unload will happen before child frame unload (see example below).
WindowClient.focus() - Web APIs
example self.addeventlistener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (clien...
WindowClient.focused - Web APIs
example self.addeventlistener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) { if(!client.focused) return client.focus(); } } } if (clients.openwindow) return clients.op...
WindowClient - Web APIs
example self.addeventlistener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (clien...
WindowEventHandlers.onbeforeprint - Web APIs
}; polyfill safari does not implement these events, but you can create an equivalent result to the beforeprint event with window.matchmedia('print').
WindowEventHandlers.onhashchange - Web APIs
function locationhashchanged() { if (location.hash === '#cool-feature') { console.log("you're visiting a cool feature!"); } } window.onhashchange = locationhashchanged; using an event listener this example uses an event listener to log a notification whenever the hash has changed.
WindowEventHandlers.onunload - Web APIs
note: browsers equipped with pop-up blockers will ignore all window.open() method calls in onunload event handler functions.
WindowOrWorkerGlobalScope.clearInterval() - Web APIs
it's worth noting that the pool of ids used by setinterval() and settimeout() are shared, which means you can technically use clearinterval() and cleartimeout() interchangeably.
WindowOrWorkerGlobalScope.isSecureContext - Web APIs
the issecurecontext read-only property of the windoworworkerglobalscope interface returns a boolean indicating whether the current context is secure (true) or not (false).
WindowOrWorkerGlobalScope.origin - Web APIs
examples executed from inside a worker script, the following snippet will log the worker's global scope's origin to the console each time it receives a message onmessage = function() { console.log(self.origin); }; if the origin is not a scheme/host/port tuple (say you are trying to run it locally, i.e.
Worker.terminate() - Web APIs
WebAPIWorkerterminate
this does not offer the worker an opportunity to finish its operations; it is simply stopped at once.
WorkerGlobalScope.close() - Web APIs
note: there is also a way to stop the worker from the main thread: the worker.terminate method.
WorkerGlobalScope.console - Web APIs
specifications not yet part of any specification.
WorkerGlobalScope.dump() - Web APIs
specifications this method does not appear in any specification.
WorkerGlobalScope.importScripts() - Web APIs
exceptions networkerror imported scripts were not served with a valid javascript mime type (i.e.
WorkerGlobalScope.location - Web APIs
note: firefox has a bug with using console.log inside shared/service workers (see bug 1058644), which may return strange results, but this should be fixed soon.
WorkerGlobalScope.self - Web APIs
this provides a full list of the objects available to that worker scope, so it is quite a useful test if you want to see whether something is available to your worker or not.
WorkerNavigator.permissions - Web APIs
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.
Worklet.addModule() - Web APIs
WebAPIWorkletaddModule
aborterror the specified script is invalid or could not be loaded.
WritableStream.WritableStream() - Web APIs
note: you could define your own custom queuingstrategy, or use an instance of bytelengthqueuingstrategy or countqueuingstrategy for this object value.
WritableStream.abort() - Web APIs
exceptions typeerror the stream you are trying to abort is not a writablestream, or it is locked.
WritableStream.getWriter() - Web APIs
exceptions typeerror the stream you are trying to create a writer for is not a writablestream.
WritableStream.locked - Web APIs
syntax var locked = writablestream.locked; value a boolean indicating whether or not the writable stream is locked.
WritableStreamDefaultController.error() - Web APIs
exceptions typeerror the stream you are trying to error is not a writablestream.
WritableStreamDefaultWriter.close() - Web APIs
exceptions typeerror the stream you are trying to close is not a writablestream.
XDomainRequest.abort() - Web APIs
syntax xdr.abort(); example var xdr = new xdomainrequest(); xdr.open("get", "http://example.com/api/method"); xdr.send(); xdr.abort(); specification not part of any specification.
XDomainRequest.onload - Web APIs
syntax xdr.onload = funcref; example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification.
XDomainRequest.ontimeout - Web APIs
example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.ontimeout = function(){ //handle timeout } xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification.
XDomainRequest.open() - Web APIs
example var xdr = new xdomainrequest(); xdr.open("get", "http://example.com/api/method"); specification not part of any specification.
XDomainRequest.send() - Web APIs
example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification.
XDomainRequest.timeout - Web APIs
example xdr.timeout = 10000; specification not part of any specification.
XMLDocument - Web APIs
it inherits from the generic document and does not add any specific methods or properties to it: nevertheless, several algorithms behave differently with the two types of documents.
XMLHttpRequest.channel - Web APIs
in the case of a multi-part request, this is the initial channel, not the different parts in the multi-part request.
XMLHttpRequest.mozResponseArrayBuffer - Web APIs
this is null if the request was not successful, or if it hasn't been sent yet.
XMLHttpRequest.mozSystem - Web APIs
if true, the same origin policy is not enforced on the request.
XMLHttpRequest.onreadystatechange - Web APIs
warning: this should not be used with synchronous requests and must not be used from native code.
XMLHttpRequest.readyState - Web APIs
open() not called yet.
XMLHttpRequest.send() - Web APIs
networkerror the resource type to be fetched is a blob, and the method is not get.
XMLHttpRequest.setRequestHeader() - Web APIs
note: for your custom fields, you may encounter a "not allowed by access-control-allow-headers in preflight response" exception when you send requests across domains.
XMLHttpRequest.statusText - Web APIs
unlike xmlhttprequest.status which indicates a numerical status code, this property contains the text of the response status, such as "ok" or "not found".
XMLHttpRequest.timeout - Web APIs
note: you may not use a timeout for synchronous requests with an owning window.
XPathResult.invalidIteratorState - Web APIs
note: this feature is available in web workers.
XPathResult.iterateNext() - Web APIs
exceptions type_err in case xpathresult.resulttype is not unordered_node_iterator_type or ordered_node_iterator_type, an xpathexception of type type_err is thrown.
XREye - Web APIs
WebAPIXREye
usage notes these values are used by the xrview property eye.
XRFrame.getPose() - Web APIs
WebAPIXRFramegetPose
the xrframe method getpose() returns the relative position and orientation—the pose—of one xrspace to that of another space.
XRFrame.getViewerPose() - Web APIs
exceptions invalidstateerror a domexception indicating that getviewerpose() was not called within the context of a callback to a session's xrsession.requestanimationframe().
XRFrame - Web APIs
WebAPIXRFrame
in addition to providing a reference to the xrsession for which this frame is to be rendered, the getviewerpose() method is provided to obtain the xrviewerpose describing the viewer's position and orientation in space, and getpose() can be used to create an xrpose describing the relative position of one xrspace relative to another.
XRHandedness - Web APIs
values none the input controller is not associated with one of the user's hands.
XRInputSource.targetRayMode - Web APIs
usage notes the input source's targetrayspace indicates the position and orientation of the target ray, and can be used to determine where to render the ray.
XRInputSource.targetRaySpace - Web APIs
usage notes all input sources—regardless of their targetraymode—have a valid targetrayspace.
XRInputSourceArray.forEach() - Web APIs
note that if you use arrow function notation (=>) to provide the callback, you can omit thisarg, since all arrow functions lexically bind this.
XRInputSourceArray.keys() - Web APIs
for each key, the input is retrieved using the index with array notation: xrsession.inputsources[inputidx].
XRInputSourceEvent.frame - Web APIs
usage notes the event frame does not correspond to a visual frame as is delivered to the frame rendering callback function (see rendering and the webxr frame rendering callback for details on the callback).
XRInputSourceEvent - Web APIs
because this is an event frame, not an animation frame, you cannot call the xrframe method getviewerpose() on it; instead, use getpose().
XRInputSourceEventInit.frame - Web APIs
usage notes the event frame does not correspond to a visual frame as is delivered to the frame rendering callback function (see rendering and the webxr frame rendering callback for details on the callback).
XRInputSourceEventInit - Web APIs
this event is not associated with the animation process, and has no viewer information contained within it.
XRPose - Web APIs
WebAPIXRPose
xrpose.emulatedposition read only a boolean value which is false if the position and orientation given by transform is obtained directly from a full six degree of freedom (6dof) xr device (that is, a device which tracks not only the pitch, yaw, and roll of the head but also the forward, backward, and side-to-side motion of the viewer).
XRReferenceSpace.onreset - Web APIs
usage notes see the reset event documentation for further details.
XRReferenceSpaceEvent.transform - Web APIs
usage notes upon receiving a reset event, you can apply the transform to cached position or orientation information to shift them into the updated coordinate system.
XRReferenceSpaceEvent - Web APIs
methods while xrreferencespaceevent does not define any methods, it inherits the methods of its parent interface, event.
XRReferenceSpaceType - Web APIs
xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object.
XRRenderState.baseLayer - Web APIs
examples you can set the xrwebgllayer used for rendering by calling updaterenderstate(), like this: let canvas = document.queryselector("canvas"); gl = canvas.getcontext("webgl", { xrcompatible: true }); setnewwebgllayer(); function setnewwebgllayer(gl) { if (!gl) { /* webgl not available */ return; } xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl); }); }; here, the canvas obtained in the first line is the canvas into which webgl is going to draw.
XRRigidTransform.inverse - Web APIs
the read-only inverse property of the xrrigidtransform interface returns another xrrigidtransform object which is the inverse of its owning transform.
XRRigidTransform.orientation - Web APIs
if you specify a quaternion whose length is not exactly 1.0 meters, it will be normalized for you.
XRRigidTransform - Web APIs
usage notes when an xrrigidtransform is interpreted, the orientation is always applied to the affected object before the position is applied.
XRSession.cancelAnimationFrame() - Web APIs
usage notes this function has no effect if the specified handle cannot be found.
XRSession.environmentBlendMode - Web APIs
important: environmentblendmode is part of the webxr augmented reality module, which has not yet reached a stable state.
XRSession.oninputsourceschange - Web APIs
note: the xrinputsource objects in xrsession.inputsources array are "live", so values within them are updated in-place.
XRSession.onselectend - Web APIs
note: not to be confused with xrsession.onselectstart and xrsession.onselect.
XRSession.onsqueezeend - Web APIs
the squeezeend event handler is where you handle closing out a squeeze action whether it was successfully completed or not.
XRSession.onvisibilitychange - Web APIs
note: the visibility state of xr session affects the frame loop so callbacks registered via xrsession.requestanimationframe() might not be called.
XRSessionEvent() - Web APIs
it reacts by calling a function mysessionvisible() with a boolean indicating whether or not the session is visible; this function might, for instance, spin up or reconfigure a worker that handles rendering the scene.
XRSessionEvent - Web APIs
it reacts by calling a function mysessionvisible() with a boolean indicating whether or not the session is visible; this function might, for instance, spin up or reconfigure a worker that handles rendering the scene.
XRSpace - Web APIs
WebAPIXRSpace
note: the xrspace interface is never used directly; instead, all spaces are created using one of the interfaces based on xrspace.
XRView.transform - Web APIs
WebAPIXRViewtransform
note: this example is derived from a larger example...
XRViewport.y - Web APIs
WebAPIXRViewporty
note: although other web apis typically consider the y axis to begin at the top and grow larger progressing downward, webgl reverses this, with y growing larger as it goes upward on the screen.
XRViewport - Web APIs
usage notes currently, the only type of surface available is the xrwebgllayer.
XRWebGLLayer.getViewport() - Web APIs
exceptions invalidstateerror either the specified view is not in an active xrframe or that xrframe and the xrwebgllayer are not part of the same webxr session.
XRWebGLLayer.ignoreDepthValues - Web APIs
usage notes when the ignoredepthvalues property is false, the xr compositor uses the values found in the depth buffer, which should be accurate for the scene, in order to potentially improve the quality or the output as well as the comfort level for the viewer.
XRWebGLLayerInit.stencil - Web APIs
syntax let layerinit = { stencil: false }; let gllayer = new xrwebgllayer(xrsession, gl, layerinit); let gllayer = new xrwebgllayer(xrsession, gl, { stencil: false }); value a boolean which can be set to false to specify that the new webgl layer should not include a stencil buffer.
Browser Differences - Web APIs
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.
ARIA guides - Accessibility
non virtual mode in at products using drag & drop notifying users of non-aria screen readers fixing structure with presentation role hiding layout tables managing modal and non modal dialogs using aria with html5 how to test aria aria on mobile devices ...
Using the aria-relevant attribute - Accessibility
any change that is not relevant acts in the same manner it would if the aria-live attribute were set to off.
ARIA: tabpanel role - Accessibility
the aria tabpanel role indicates description an element with the tabpanel role associated roles and attributes aria- keyboard interaction key action tab → ← delete required javascript features include note about semantic alternatives to using this role or attribute.
ARIA: Mark role - Accessibility
the mark landmark role semantically denotes html elements containing text that is marked/highlighted for reference purposes.
ARIA: Region role - Accessibility
a region role is a more generic term, and should only be used if the section needing to be identified is not accurately described by one of the other landmark roles, such as banner, main, contentinfo, complementary, or navigation.
ARIA: search role - Accessibility
because of this, you do not need to describe what the landmark is in its label.
HTML To MSAA - Accessibility
map html element role name value states relations actions events notes a role_system_ link n/a value of @href attribute state_system_ selectable if @name attribute is presented state_system_ linked if @href attribute is presented or click event listener is registered state_system_ traversed if link is traversed n/a "jump" if @href is valid n/a br role_system_ whitespace '\n' (new line char) state_system_ readonly n/a n/a n/a button role_system_ pus...
Color contrast - Accessibility
ifferent vision capabilities, the wcag guidelines recommend the following contrast ratios: type of content minimum ratio (aa rating) enhanced ratio (aaa rating) body text 4.5 : 1 7 : 1 large-scale text (120-150% larger than body text) 3 : 1 4.5 : 1 active user interface components and graphical objects such as icons and graphs 3 : 1 not defined these ratios do not apply to "incidental" text, such as inactive controls, logotypes, or purely decorative text.
Understanding the Web Content Accessibility Guidelines - Accessibility
however, we are not lawyers, and none of this constitutes legal advice.
Accessibility
accessible multimedia another category of content that can create accessibility problems is multimedia — video, audio, and image content need to be given proper textual alternatives so they can be understood by assistive technologies and their users.
-webkit-mask-position-x - CSS: Cascading Style Sheets
herwise a percentageanimation typediscrete formal syntax [ <length-percentage> | left | center | right ]#where <length-percentage> = <length> | <percentage> examples horizontally positioning a mask image .exampleone { -webkit-mask-image: url(mask.png); -webkit-mask-position-x: right; } .exampletwo { -webkit-mask-image: url(mask.png); -webkit-mask-position-x: 25%; } specifications not part of any standard.
-webkit-mask-position-y - CSS: Cascading Style Sheets
therwise a percentageanimation typediscrete formal syntax [ <length-percentage> | top | center | bottom ]#where <length-percentage> = <length> | <percentage> examples vertically positioning a mask image .exampleone { -webkit-mask-image: url(mask.png); -webkit-mask-position-y: bottom; } .exampletwo { -webkit-mask-image: url(mask.png); -webkit-mask-position-y: 25%; } specifications not part of any standard.
-webkit-tap-highlight-color - CSS: Cascading Style Sheets
)where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> specifications not part of any standard.
-webkit-text-fill-color - CSS: Cascading Style Sheets
if this property is not set, the value of the color property is used.
-webkit-text-stroke-color - CSS: Cascading Style Sheets
if this property is not set, the value of the color property is used.
-webkit-touch-callout - CSS: Cascading Style Sheets
formal definition initial valuedefaultapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax default | none examples turn off touch callout .example { -webkit-touch-callout: none; } specifications not part of any standard.
:-moz-drag-over - CSS: Cascading Style Sheets
syntax :-moz-drag-over examples html <table border="1"> <tr> <td width="100px" height="100px">drag over</td> </tr> </table> css td:-moz-drag-over { color: red; } result specifications not part of any standard.
::-moz-list-bullet - CSS: Cascading Style Sheets
syntax li::-moz-list-bullet examples html <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> css ::-moz-list-bullet { color: red; font-size: 1.5em; } result specifications not part of any standard.
::-moz-list-number - CSS: Cascading Style Sheets
syntax li::-moz-list-number examples html <ol> <li>first item</li> <li>second item</li> <li>third item</li> </ol> css li::-moz-list-number { font-style: italic; font-weight: bold; } result screenshotlive sample specifications not part of any standard.
::-moz-progress-bar - CSS: Cascading Style Sheets
syntax ::-moz-progress-bar examples html <progress value="30" max="100">30%</progress> <progress max="100">indeterminate</progress> css ::-moz-progress-bar { background-color: red; } /* force indeterminate bars to have zero width */ :indeterminate::-moz-progress-bar { width: 0; } result specifications not part of any standard.
::-webkit-file-upload-button - CSS: Cascading Style Sheets
screenshotlive sample specifications not part of any standard.
::-webkit-inner-spin-button - CSS: Cascading Style Sheets
html <input type="number"> css input[type=number]::-webkit-inner-spin-button { cursor: pointer; } result specifications not part of any standard.
::-webkit-meter-bar - CSS: Cascading Style Sheets
syntax ::-webkit-meter-bar specifications not part of any standard.
::-webkit-meter-even-less-good-value - CSS: Cascading Style Sheets
syntax ::-webkit-meter-even-less-good-value specifications not part of any standard.
::-webkit-meter-inner-element - CSS: Cascading Style Sheets
syntax ::-webkit-meter-inner-element specifications not part of any standard.
::-webkit-meter-optimum-value - CSS: Cascading Style Sheets
syntax ::-webkit-meter-optimum-value specifications not part of any standard.
::-webkit-meter-suboptimum-value - CSS: Cascading Style Sheets
html <meter min="0" max="10" value="6">score out of 10</meter> css meter::-webkit-meter-suboptimum-value { background: -webkit-gradient linear, left top, left bottom; height: 100%; box-sizing: border-box; } result specifications not part of any standard.
::-webkit-outer-spin-button - CSS: Cascading Style Sheets
html <input type="number"> css input::-webkit-outer-spin-button { -webkit-appearance: none; } result specifications not part of any standard.
::-webkit-search-cancel-button - CSS: Cascading Style Sheets
syntax selector::-webkit-search-cancel-button specifications not part of any standard.
::-webkit-search-results-button - CSS: Cascading Style Sheets
syntax selector::-webkit-search-results-button specifications not part of any standard.
::-webkit-slider-runnable-track - CSS: Cascading Style Sheets
syntax ::-webkit-slider-runnable-track specifications not part of any standard.
::-webkit-slider-thumb - CSS: Cascading Style Sheets
syntax ::-webkit-slider-thumb specifications not part of any standard.
::backdrop - CSS: Cascading Style Sheets
video::backdrop { background-color: #448; } the resulting screen looks like this: note the dark grey-blue letterbox effect above and below where the backdrop is visible.
::selection - CSS: Cascading Style Sheets
note: ::selection was in drafts of css selectors level 3, but it was removed in the candidate recommendation phase because its was under-specified (especially with nested elements) and interoperability wasn't achieved (based on discussion in the w3c style mailing list).
::slotted() - CSS: Cascading Style Sheets
WebCSS::slotted
note also that this selector won't select a text node placed into a slot; it only targets actual elements.
:active - CSS: Cascading Style Sheets
WebCSS:active
note: on systems with multi-button mice, css3 specifies that the :active pseudo-class must only apply to the primary button; on right-handed mice, this is typically the leftmost button.
:defined - CSS: Cascading Style Sheets
WebCSS:defined
<p>standard paragraph example text</p> in the css we first include the following rules: // give the two elements distinctive backgrounds p { background: yellow; } simple-custom { background: cyan; } // both the custom and the built-in element are given italic text :defined { font-style: italic; } then provide the following two rules to hide any instances of our custom element that are not defined, and display instances that are defined as block level elements: simple-custom:not(:defined) { display: none; } simple-custom:defined { display: block; } this is useful if you have a complex custom element that takes a while to load into the page — you might want to hide instances of the element until definition is complete, so that you don't end up with flashes of ugly unstyled ...
:disabled - CSS: Cascading Style Sheets
WebCSS:disabled
recommendation defines the pseudo-class, but not the associated semantics.
:enabled - CSS: Cascading Style Sheets
WebCSS:enabled
recommendation defines the pseudo-class, but not the associated semantics.
:first - CSS: Cascading Style Sheets
WebCSS:first
(see :first-child for general first element of a node.) /* selects the first page when printing */ @page :first { margin-left: 50%; margin-top: 50%; } note: you can't change all css properties with this pseudo-class.
:focus - CSS: Cascading Style Sheets
WebCSS:focus
/* selects any <input> when focused */ input:focus { color: red; } note: this pseudo-class applies only to the focused element itself.
:host - CSS: Cascading Style Sheets
WebCSS:host
note: this has no effect when used outside a shadow dom.
:in-range - CSS: Cascading Style Sheets
WebCSS:in-range
note: this pseudo-class only applies to elements that have (and can take) a range limitation.
:out-of-range - CSS: Cascading Style Sheets
note: this pseudo-class only applies to elements that have (and can take) a range limitation.
:state() - CSS: Cascading Style Sheets
WebCSS:state
custom-element:state(foo) { /* styles to apply when `custom-element` is in the `foo` state */ } syntax syntax not found in db!
pad - CSS: Cascading Style Sheets
if the minimum length is not reached, the representation will be padded with the specified <symbol>.
prefix - CSS: Cascading Style Sheets
if not specified, the default value will be "" (an empty string).
range - CSS: Cascading Style Sheets
when range is specified as integers, the value infinite can be used to denote infinity.
@document - CSS: Cascading Style Sheets
WebCSS@document
note: there is a -moz-prefixed version of this property — @-moz-document.
font-family - CSS: Cascading Style Sheets
syntax /* <string> values */ font-family: "font family"; font-family: 'another font family'; /* <custom-ident> value */ font-family: examplefont; values <family-name> specifies the name of the font family.
unicode-range - CSS: Cascading Style Sheets
if the page doesn't use any character in this range, the font is not downloaded; if it uses at least one, the whole font is downloaded.
@keyframes - CSS: Cascading Style Sheets
when a keyframe is defined multiple 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.
-webkit-device-pixel-ratio - CSS: Cascading Style Sheets
note: this media feature is a webkit feature.
aural - CSS: Cascading Style Sheets
WebCSS@mediaaural
note: this media type has been deprecated in favor of speech.
color-index - CSS: Cascading Style Sheets
(this value is zero if the device does not use such a table.) it is a range feature, meaning that you can also use the prefixed min-color-index and max-color-index variants to query minimum and maximum values, respectively.
hover - CSS: Cascading Style Sheets
WebCSS@mediahover
none the primary input mechanism cannot hover at all or cannot conveniently hover (e.g., many mobile devices emulate hovering when the user performs an inconvenient long tap), or there is no primary pointing input mechanism.
inverted-colors - CSS: Cascading Style Sheets
if you're not, it should be red on light gray.</p> <p>if the text is gray, your browser doesn't support the `inverted-colors` media feature.</p> css p { color: gray; } @media (inverted-colors: inverted) { p { background: black; color: yellow; } } @media (inverted-colors: none) { p { background: #eee; color: red; } } result specifications specification status co...
monochrome - CSS: Cascading Style Sheets
WebCSS@mediamonochrome
if the device is not a monochrome device, the value is zero.
orientation - CSS: Cascading Style Sheets
note: this feature does not correspond to device orientation.
overflow-block - CSS: Cascading Style Sheets
none content that overflows the block axis is not displayed.
overflow-inline - CSS: Cascading Style Sheets
none content that overflows the inline axis is not displayed.
prefers-reduced-motion - CSS: Cascading Style Sheets
reduce indicates that user has notified the system that they prefer an interface that removes or replaces the types of motion-based animation that trigger discomfort for those with vestibular motion disorders.
scan - CSS: Cascading Style Sheets
WebCSS@mediascan
the word scanning used in this context does not refer to an image scanner, such as one used to digitize a photograph.
max-zoom - CSS: Cascading Style Sheets
the browser will not zoom in any further than this, whether automatically or at the user's request.
min-zoom - CSS: Cascading Style Sheets
the browser will not zoom out any further than this, whether automatically or at the user's request.
viewport-fit - CSS: Cascading Style Sheets
accessibility concerns when using the viewport-fit descriptor, one must keep in mind that not all device displays are rectangular, and should therefore make use of the safe area inset variables.
Alternative style sheets - CSS: Cascading 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.
Resizing background images with background-size - CSS: Cascading Style Sheets
contain the contain value specifies that, regardless of the size of the containing box, the background image should be scaled so that each side is as large as possible while not exceeding the length of the corresponding side of the container.
Box alignment in Flexbox - CSS: Cascading Style Sheets
this means that a justify-self property does not make sense in flexbox as we are always dealing with moving the entire group of items around.
CSS Color - CSS: Cascading Style Sheets
WebCSSCSS Color
not all css properties that take a <color> as a value are part of this module, but they do depend upon it.
Handling Overflow in Multicol - CSS: Cascading Style Sheets
using vertical media queries one issue with multicol on the web is that, if your columns are taller than the viewport, the reader will need to scroll up and down to read, which is not good user experience.
Implementing image sprites in CSS - CSS: Cascading Style Sheets
note: when using http/2, it may in fact be more bandwidth-friendly to use multiple small requests.
Using CSS counters - CSS: Cascading Style Sheets
the counter's name must not be "none", "inherit", or "initial"; otherwise the declaration is ignored.
Logical properties for floating and positioning - CSS: Cascading Style Sheets
note: the browsers that have implemented the logical properties specification have so far implemented the direct mappings and not the new shorthands.
CSS Overflow - CSS: Cascading Style Sheets
this is the overflow of painting effects which do not affect layout or otherwise extend the scrollable overflow region, such as box shadows, border images, text decoration, overhanging glyphs, outlines, etc.
Stacking with floated blocks - CSS: Cascading Style Sheets
this behavior can be shown with an added rule to the above list: the background and borders of the root element descendant non-positioned blocks, in order of appearance in the html floating blocks descendant non-positioned inline elements descendant positioned elements, in order of appearance in the html note: if an opacity value is applied to the non-positioned block (div #4), then something strange happens: the background and border of that block pops up above the floating blocks and the positioned blocks.
Stacking context example 3 - CSS: Cascading Style Sheets
note: in the source code you will see that second-level and third level menus are made of several divs contained in an absolutely positioned container.
Stacking without the z-index property - CSS: Cascading Style Sheets
when the z-index property is not specified on any element, elements are stacked in the following order (from bottom to top): the background and borders of the root element descendant non-positioned blocks, in order of appearance in the html descendant positioned elements, in order of appearance in the html keep in mind, when the order property alters rendering from the "order of appearance in the html" within flex containers, it similarly affects the order for stacking context.
CSS Positioned Layout - CSS: Cascading Style Sheets
reference css properties bottom clear float left position right top z-index guides understanding css z-index presents the notion of stacking context and explains how z-ordering works, with several examples.
CSS Properties Reference - CSS: Cascading Style Sheets
common css properties reference the following is a basic list of the most common css properties with the equivalent of the dom notation which is usually accessed from javascript: note: this list is incomplete.
CSS Scroll Snap - CSS: Cascading Style Sheets
note: the previous version of this module was called scroll snap points and has been deprecated.
Shapes from box values - CSS: Cascading Style Sheets
you still have a border, even if you have not used the css border property.
Using CSS transforms - CSS: Cascading Style Sheets
by default the perspective is centered on the viewer, which is not always adequate.
CSS data types - CSS: Cascading Style Sheets
WebCSSCSS Types
in formal syntax, data types are denoted by a keyword placed between the inequality signs "<" and ">".
Child combinator - CSS: Cascading Style Sheets
<span>span #2, in the span that's in the div.</span> </span> </div> <span>span #3, not in the div at all.</span> result specifications specification status comment selectors level 4the definition of 'child combinator' in that specification.
Class selectors - CSS: Cascading Style Sheets
/* all elements with class="spacious" */ .spacious { margin: 2em; } /* all <li> elements with class="spacious" */ li.spacious { margin: 2em; } /* all <li> elements with a class list that includes both "spacious" and "elegant" */ /* for example, class="elegant retro spacious" */ li.spacious.elegant { margin: 2em; } syntax .class_name { style properties } note that this is equivalent to the following attribute selector: [class~=class_name] { style properties } examples css .red { color: #f33; } .yellow-bg { background: #ffa; } .fancy { font-weight: bold; text-shadow: 4px 4px 3px #77f; } html <p class="red">this paragraph has red text.</p> <p class="red yellow-bg">this paragraph has red text and a yellow background.</p> <p class="red f...
Descendant combinator - CSS: Cascading Style Sheets
/* list items that are descendants of the "my-things" list */ ul.my-things li { margin: 2em; } the descendant combinator is technically one or more css white space characters — the space character and/or one of four control characters: carriage return, form feed, new line, and tab characters — between two selectors in the absence of another combinator.
Questions about CSS - CSS: Cascading Style Sheets
WebCSSFAQ
an imported style sheet, using the css @import notation to automatically import and merge an external style sheet with the current style sheet style attributes specified by the viewer to the browser the default style sheet assumed by the browser in general, the web page creator's style sheet takes precedence, but it's recommended that browsers provide ways for the viewer to override the style attributes in some respects.
ID selectors - CSS: Cascading Style Sheets
/* the element with id="demo" */ #demo { border: red 2px solid; } syntax #id_value { style properties } note that syntactically (but not specificity-wise), this is equivalent to the following attribute selector: [id=id_value] { style properties } examples css #identified { background-color: skyblue; } html <div id="identified">this div has a special id on it!</div> <div>this is just a regular div.</div> result specifications specification status comment selectors level 4the definition of 'id selectors' in that specification.
Contribute a recipe - CSS: Cascading Style Sheets
it may see periodical improvements or updates, and may eventually even be cleaned up (and de-archived) for better uxp focus, but for now, it's a historical snapshot for reference, not a living website.
Pagination - CSS: Cascading Style Sheets
recipe download this example choices made this pattern is laid out using flexbox — one flex container nested inside another.
CSS Layout cookbook - CSS: Cascading Style Sheets
note: if you are new to css layout then you might first like to take a look at our css layout learning module, as this will give you the basic grounding you need to make use of the recipes here.
Microsoft CSS extensions - CSS: Cascading Style Sheets
microsoft-only properties (avoid using on websites) note: these properties will only work in microsoft applications, and are not on a standards track.
Privacy and the :visited selector - CSS: Cascading Style Sheets
this process was quick to execute, and made it possible not only to determine where the user had been on the web, but could also be used to guess a lot of information about the user's identity.
Cubic Bezier Generator - CSS: Cascading Style Sheets
this is not really yet a useful tool, but will be!
Tools - CSS: Cascading Style Sheets
WebCSSTools
this is not really yet a useful tool, but will be!linear-gradient generatorthis tool can be used to create custom css3 linear-gradient() backgrounds.
align-items - CSS: Cascading Style Sheets
syntax /* basic keywords */ align-items: normal; align-items: stretch; /* positional alignment */ /* align-items does not take left and right values */ align-items: center; /* pack items around the center */ align-items: start; /* pack items from the start */ align-items: end; /* pack items from the end */ align-items: flex-start; /* pack flex items from the start */ align-items: flex-end; /* pack flex items from the end */ /* baseline alignment */ align-items: baseline; align-items: first baseline; align-items: la...
<alpha-value> - CSS: Cascading Style Sheets
recommendation introduces <alpha-value> along with rgba() and hsla() functional notations.
animation-direction - CSS: Cascading Style Sheets
note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are.
animation-iteration-count - CSS: Cascading Style Sheets
note: when you specify multiple values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are.
animation-play-state - CSS: Cascading Style Sheets
note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are.
background-blend-mode - CSS: Cascading Style Sheets
if the blending modes' and background images' list lengths are not equal, it will be repeated and/or truncated until lengths match.
background-origin - CSS: Cascading Style Sheets
note that background-origin is ignored when background-attachment is fixed.
<blend-mode> - CSS: Cascading Style Sheets
changes between blend modes are not interpolated.
border-block-start - CSS: Cascading Style Sheets
nitial valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumborder-style: as each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: nonecolor: varies from one browser to anotherapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hidd...
border-bottom-color - CSS: Cascading Style Sheets
note which side of the box is <span class="redtext">red</span>.</p> </div> css .mybox { border: solid 0.3em gold; border-bottom-color: red; width: auto; } .redtext { color: red; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-bottom-color' in that specification.
border-bottom-style - CSS: Cascading Style Sheets
note: the specification doesn't define how borders of different styles connect in the corners.
border-bottom-width - CSS: Cascading Style Sheets
if it's a keyword, it must be one of the following values: thin a thin border medium a medium border thick a thick border note: because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific.
border-image-outset - CSS: Cascading Style Sheets
the parts of the border image that are rendered outside the element's border box with border-image-outset do not trigger overflow scrollbars and don't capture mouse events.
border-image-slice - CSS: Cascading Style Sheets
for vector images, the number is relative to the element's size, not the size of the source image, so percentages are generally preferable in these cases.
border-inline-start - CSS: Cascading Style Sheets
nitial valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumborder-style: as each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: nonecolor: varies from one browser to anotherapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hidd...
border-left-color - CSS: Cascading Style Sheets
note which side of the box is <span class="redtext">red</span>.</p> </div> css .mybox { border: solid 0.3em gold; border-left-color: red; width: auto; } .redtext { color: red; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-left-color' in that specification.
border-left-width - CSS: Cascading Style Sheets
if it's a keyword, it must be one of the following values: thin a thin border medium a medium border thick a thick border note: because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific.
border-right-color - CSS: Cascading Style Sheets
note which side of the box is <span class="redtext">red</span>.</p> </div> css .mybox { border: solid 0.3em gold; border-right-color: red; width: auto; } .redtext { color: red; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-right-color' in that specification.
border-right-width - CSS: Cascading Style Sheets
if it's a keyword, it must be one of the following values: thin a thin border medium a medium border thick a thick border note: because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific.
border-top-color - CSS: Cascading Style Sheets
note which side of the box is <span class="redtext">red</span>.</p> </div> css .mybox { border: solid 0.3em gold; border-top-color: red; width: auto; } .redtext { color: red; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-top-color' in that specification.
border-top-width - CSS: Cascading Style Sheets
if it's a keyword, it must be one of the following values: thin a thin border medium a medium border thick a thick border note: because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific.
border-width - CSS: Cascading Style Sheets
if it's a keyword, it must be one of the following values: thin a thin border medium a medium border thick a thick border note: because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific.
box-ordinal-group - CSS: Cascading Style Sheets
specifications not part of any standard.
box-orient - CSS: Cascading Style Sheets
div.example { display: -moz-box; /* mozilla */ display: -webkit-box; /* webkit */ display: box; /* as specified */ /* children should be oriented vertically */ -moz-box-orient: horizontal; /* mozilla */ -webkit-box-orient: horizontal; /* webkit */ box-orient: horizontal; /* as specified */ } result specifications not part of any standard.
column-gap (grid-column-gap) - CSS: Cascading Style Sheets
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.
column-span - CSS: Cascading Style Sheets
values none the element does not span multiple columns.
Computed value - CSS: Cascading Style Sheets
note: the getcomputedstyle() dom api returns the resolved value, which may either be the computed value or the used value, depending on the property.
<dimension> - CSS: Cascading Style Sheets
WebCSSdimension
3sec the seconds unit is abbreviated "s" not "sec".
<display-inside> - CSS: Cascading Style Sheets
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.
<display-listitem> - CSS: Cascading Style Sheets
note: in browsers that support the two-value syntax, if no inner value is specified it will default to flow.
opacity() - CSS: Cascading Style Sheets
note: this function is similar to the more established opacity property.
flex - CSS: Cascading Style Sheets
WebCSSflex
it shrinks to its minimum size to fit the container, but does not grow to absorb any extra free space in the flex container.
<flex> - CSS: Cascading Style Sheets
the <flex> css data type denotes a flexible length within a grid container.
font-language-override - CSS: Cascading Style Sheets
for example, a lot of fonts have a special character for the digraph fi that merge the dot on the "i" with the "f." however, if the language is set to turkish 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.
font-smooth - CSS: Cascading Style Sheets
for those of you not on a macos system, here is a screenshot (the live version appears later on): html <p>without font smoothing</p> <p class="smoothed">with font smoothing</p> css html { background-color: black; color: white; font-size: 3rem; } p { text-align: center; } .smoothed { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } result specifications not part of a...
font-variant-east-asian - CSS: Cascading Style Sheets
edanimation typediscrete formal syntax normal | [ <east-asian-variant-values> || <east-asian-width-values> || ruby ]where <east-asian-variant-values> = [ jis78 | jis83 | jis90 | jis04 | simplified | traditional ]<east-asian-width-values> = [ full-width | proportional-width ] examples setting east asian glyph variants this example require font "yu gothic" installed in your os, other fonts may not support opentype features.
font-variant-numeric - CSS: Cascading Style Sheets
two values are possible: proportional-nums activating the set of figures where numbers are not all of the same size.
gap (grid-gap) - CSS: Cascading Style Sheets
WebCSSgap
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.
grid-template-areas - CSS: Cascading Style Sheets
those areas are not associated with any particular grid item, but can be referenced from the grid-placement properties grid-row-start, grid-row-end, grid-column-start, grid-column-end, and their shorthands grid-row, grid-column, and grid-area.
hanging-punctuation - CSS: Cascading Style Sheets
allow-end a stop or comma at the end of a line hangs if it does not otherwise fit prior to justification.
initial-letter - CSS: Cascading Style Sheets
negative values are not allowed.
initial - CSS: Cascading Style Sheets
WebCSSinitial
see also use unset to set a property to its inherited value if it inherits, or to its initial value if not.
letter-spacing - CSS: Cascading Style Sheets
user agents may not further increase or decrease the inter-character space in order to justify text.
line-height-step - CSS: Cascading Style Sheets
the line box in <h1> does not fit into one step unit and thus occupies two, but it is still centered within the two step unit.
line-height - CSS: Cascading Style Sheets
</div> <!-- the first <h1> line-height is calculated from its own font-size (30px × 1.1) = 33px --> <!-- the second <h1> line-height results from the red div's font-size (15px × 1.1) = 16.5px, probably not what you want --> css .green { line-height: 1.1; border: solid limegreen; } .red { line-height: 1.1em; border: solid red; } h1 { font-size: 30px; } .box { width: 18em; display: inline-block; vertical-align: top; font-size: 15px; } result specifications specification status comment css level 2 (revision 1)the definition of 'line-height' in t...
list-style-image - CSS: Cascading Style Sheets
note: this property is applied to list items, i.e.
mask-border-outset - CSS: Cascading Style Sheets
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.
mask-border-repeat - CSS: Cascading Style Sheets
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.
mask-border-source - CSS: Cascading Style Sheets
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 prefixed border mask properties supported in chromium), so you can get an idea of the effect.
mask-border - CSS: Cascading Style Sheets
ound; -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/fd08a3134c.png") /* source */ 30 fill / /* slice */ 20px / /* width */ 1px /* outset */ round; /* repeat */ } result specifications specification status comment css masking module level 1the definition of 'mask-border...
mask-clip - CSS: Cascading Style Sheets
WebCSSmask-clip
no-clip the painted content is not clipped.
mask-position - CSS: Cascading Style Sheets
note that the position can be set outside of the element's box.
mask - CSS: Cascading Style Sheets
WebCSSmask
le><linear-color-stop> = <color> <color-stop-length>?<linear-color-hint> = <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 masking an image .target { mask: url(#c1) luminance; } .anothertarget { mask: url(resources.svg#c1) 50px 30px/10px 10px repeat-x exclude; } specifications specification status comment css masking module level 1the definition of 'mask' in that specification.
min-height - CSS: Cascading Style Sheets
if the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as 0.computed valuethe percentage as specified or the absolute lengthanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> ...
<number> - CSS: Cascading Style Sheets
WebCSSnumber
4.01 positive fraction -456.8 negative fraction 0.0 zero +0.0 zero, with a leading + -0.0 zero, with a leading - .60 fractional number without a leading zero 10e3 scientific notation -3.4e-2 complicated scientific notation invalid numbers 12.
object-position - CSS: Cascading Style Sheets
note: the position can be set so that the replaced element is drawn outside its box.
offset-anchor - CSS: Cascading Style Sheets
note that the 3-value position syntax does not work for any usage of <position>, except for in background(-position).
offset-rotate - CSS: Cascading Style Sheets
note: early versions of the spec called this property motion-rotation.
offset - CSS: Cascading Style Sheets
WebCSSoffset
note: early versions of the spec called this property motion.
outline-color - CSS: Cascading Style Sheets
note that browsers are not required to support this value; if they don't, this keyword is considered invalid.
overscroll-behavior-y - CSS: Cascading Style Sheets
underlying elements will not scroll.
padding - CSS: Cascading Style Sheets
WebCSSpadding
note: padding creates extra space within an element.
paint() - CSS: Cascading Style Sheets
WebCSSpaint
specifications specification status comment css painting api level 1the definition of 'paint notation' in that specification.
perspective - CSS: Cascading Style Sheets
their z-axis coordinates are greater than the value of the perspective css property — are not drawn.
radial-gradient() - CSS: Cascading Style Sheets
note: early implementations of this function included other keywords (cover and contain) as synonyms of the standard farthest-corner and closest-side, respectively.
<ratio> - CSS: Cascading Style Sheets
WebCSSratio
the <ratio> css data type, used for describing aspect ratios in media queries, denotes the proportion between two unitless values.
repeat() - CSS: Cascading Style Sheets
WebCSSrepeat
auto-fill if the grid container has a definite or maximal size in the relevant axis, then the number of repetitions is the largest possible positive integer that does not cause the grid to overflow its grid container.
resize - CSS: Cascading Style Sheets
WebCSSresize
resize does not apply to the following: inline elements block elements for which the overflow property is set to visible formal definition initial valuenoneapplies toelements with overflow other than visible, and optionally replaced elements representing images or videos, and iframesinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | both | horizontal | vertical | block | in...
row-gap (grid-row-gap) - CSS: Cascading Style Sheets
WebCSSrow-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.
ruby-align - CSS: Cascading Style Sheets
formal definition initial valuespace-aroundapplies toruby bases, ruby annotations, ruby base containers, ruby annotation containersinheritedyescomputed valueas specifiedanimation typediscrete formal syntax start | center | space-between | space-around examples ruby aligned at the start of the base text html <ruby> <rb>this is a long text to check</rb> <rp>(</rp><rt>short ruby</rt><rp>)</rp> </ruby> css ruby { ruby-align: start; } result ruby aligne...
scroll-snap-align - CSS: Cascading Style Sheets
syntax /* keyword values */ scroll-snap-align: none; scroll-snap-align: start end; /* when two values set first is block, second inline */ scroll-snap-align: center; /* global values */ scroll-snap-align: inherit; scroll-snap-align: initial; scroll-snap-align: unset; values none the box does not define a snap position in that axis.
scroll-snap-destination - CSS: Cascading Style Sheets
-destination: 25px 0; } .destination50 { scroll-snap-destination: 50px 0; } .scrollcontainer > div { width: 100px; height: 100px; display: inline-block; line-height: 100px; text-align: center; font-size: 50px; } .scrollcontainer > div:nth-child(even) { background-color: #87ea87; } .scrollcontainer > div:nth-child(odd) { background-color: #87ccea; } result specifications not part of any standard.
scroll-snap-stop - CSS: Cascading Style Sheets
always the scroll container must not "pass over" a possible snap position; and must snap to the first of this elements' snap positions.
scroll-snap-type - CSS: Cascading Style Sheets
specifying any precise animations or physics used to enforce those snap points is not covered by this property but instead left up to the user agent.
scrollbar-color - CSS: Cascading Style Sheets
note: user agents must apply any scrollbar-color value set on the root element to the viewport.
shape-margin - CSS: Cascading Style Sheets
itial value0applies tofloatsinheritednopercentagesrefer to the width of the containing blockcomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea length, percentage or calc(); formal syntax <length-percentage>where <length-percentage> = <length> | <percentage> examples adding a margin to a polygon html <section> <div class="shape"></div> we are not quite sure of any one thing in biology; our knowledge of geology is relatively very slight, and the economic laws of society are uncertain to every one except some individual who attempts to set them forth; but before the world was fashioned the square on the hypotenuse was equal to the sum of the squares on the other two sides of a right triangle, and it will be so after this world is dead; and ...
<string> - CSS: Cascading Style Sheets
WebCSSstring
note: html entities (such as &nbsp; or &#8212;) cannot be used in a css <string>.
tab-size - CSS: Cascading Style Sheets
WebCSStab-size
note that white-space is set to pre to prevent the tabs from collapsing.
text-combine-upright - CSS: Cascading Style Sheets
] 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.
text-decoration-line - CSS: Cascading Style Sheets
conforming user agents may simply not blink the text.
text-decoration-style - CSS: Cascading Style Sheets
if the specified decoration has a specific semantic meaning, like a line-through line meaning that some text has been deleted, authors are encouraged to denote this meaning using an html tag, like <del> or <s>.
text-decoration-thickness - CSS: Cascading Style Sheets
note: the property used to be called text-decoration-width, but was updated in 2019 to text-decoration-thickness.
text-emphasis-position - CSS: Cascading Style Sheets
the informative table below summarizes the preferred emphasis mark positions for chinese, mongolian and japanese: preferred emphasis mark and ruby position language preferred position illustration horizontal vertical japanese over right korean mongolian chinese under right note: the text-emphasis-position cannot be set, and therefore are not reset either, using the text-emphasis shorthand property.
text-indent - CSS: Cascading Style Sheets
each-line indentation affects the first line of the block container as well as each line after a forced line break, but does not affect lines after a soft wrap break.
text-shadow - CSS: Cascading Style Sheets
if not specified, it defaults to 0.
text-underline-position - CSS: Cascading Style Sheets
the live example looks like this: setting text-underline-position globally because the text-underline-position property inherits and is not reset by the text-decoration shorthand property, it may be appropriate to set its value at a global level.
perspective() - CSS: Cascading Style Sheets
this transformation is not a linear transformation in ℝ3, and can't be represented using a cartesian-coordinate matrix.
skew() - CSS: Cascading Style Sheets
if not defined, its default value is 0, resulting in a purely horizontal skewing.
skewX() - CSS: Cascading Style Sheets
note: skewx(a) is equivalent to skew(a).
translate() - CSS: Cascading Style Sheets
cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 a translation is not a linear transformation in ℝ2 and can't be represented using a cartesian-coordinate matrix.
translate3d() - CSS: Cascading Style Sheets
a translation is not a linear transformation in ℝ3 and can't be represented using a cartesian-coordinate matrix.
transform-origin - CSS: Cascading Style Sheets
offsets that are not explicitly defined are reset to their corresponding initial values.
transition-delay - CSS: Cascading Style Sheets
syntax /* <time> values */ transition-delay: 3s; transition-delay: 2s, 4ms; /* global values */ transition-delay: inherit; transition-delay: initial; transition-delay: unset; values <time> denotes the amount of time to wait between a property's value changing and the start of the transition effect.
transition-duration - CSS: Cascading Style Sheets
syntax /* <time> values */ transition-duration: 6s; transition-duration: 120ms; transition-duration: 1s, 15s; transition-duration: 10s, 30s, 230ms; /* global values */ transition-duration: inherit; transition-duration: initial; transition-duration: unset; values <time> is a <time> denoting the amount of time the transition from the old value of a property to the new value should take.
transition-property - CSS: Cascading Style Sheets
note: the set of properties that can be animated is subject to change.
transition-timing-function - CSS: Cascading Style Sheets
whether the transition holds temporarily at 0%, 20%, 40%, 60% and 80%, on the 20%, 40%, 60%, 80% and 100%, or makes 5 stops between the 0% and 100% along the transition, or makes 5 stops including the 0% and 100% marks (on the 0%, 25%, 50%, 75%, and 100%) depends on which of the following jump terms is used: jump-start denotes a left-continuous function, so that the first jump happens when the transition begins; jump-end denotes a right-continuous function, so that the last jump happens when the animation ends; jump-none there is no jump on either end.
Used value - CSS: Cascading Style Sheets
note: the getcomputedstyle() dom api returns the resolved value, which may either be the computed value or the used value, depending on the property.
CSS: Cascading Style Sheets
WebCSS
now it's time to look at how to place your boxes in the right place concerning the viewport, and one another.
Demos of open web technologies
n garden css floating logo "mozilla" paperfold css blockout rubik's cube pure css slides planetarium (source code) loader with blend modes text reveal with clip-path ambient shadow with custom properties luminiscent vial css-based single page application (source code) transformations impress.js (source code) games ioquake3 (source code) kai 'opua (source code) web apis notifications api html5 notifications (source code) web audio api web audio fireworks oscope.js - javascript oscilloscope html5 web audio showcase (source code) html5 audio visualizer (source code) graphical filter editor and visualizer (source code) file api slide my text - presentation from plain text files web workers web worker fractals photo editor coral generator ray...
math:highest() - EXSLT
WebEXSLTmathhighest
note: ???
math:min() - EXSLT
WebEXSLTmathmin
note: syntax math:min(nodeset) parameters nodeset the node-set whose lowest value is to be returned.
regexp:replace() - EXSLT
WebEXSLTregexpreplace
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes regexp:replace() replaces the portions of a string that match a given regular expression with the contents of another string.
Regular expressions (regexp) - EXSLT
WebEXSLTregexp
regexp:match()regexp:match() performs regular expression matching on a string, returning the submatches found as a result.regexp:replace()regexp:replace() replaces the portions of a string that match a given regular expression with the contents of another string.regexp:test()regexp:test() tests to see whether a string matches a specified regular expression.
set:leading() - EXSLT
WebEXSLTsetleading
note: if the first node in nodeset2 isn't contained in nodeset1, an empty set is returned.
set:trailing() - EXSLT
WebEXSLTsettrailing
note: if the first node in nodeset2 isn't contained in nodeset1, an empty set is returned.
Sets (set) - EXSLT
WebEXSLTset
in other words, it returns a node-set whose nodes are in one node-set but not in the other.set:distinct()set:distinct() returns a subset of the nodes in the specified node-set, returning only nodes with unique string values.set:has-same-node()set:has-same-node() determines whether two node-sets have any nodes in common.set:intersection()set:intersection() returns the intersection of two node-sets.
Guide to Web APIs - Developer guides
WebGuideAPI
information api ppage visibility apipayment request apiperformance apiperformance timeline apipermissions apipointer eventspointer lock apiproximity events push api rresize observer apiresource timing apisserver sent eventsservice workers apistoragestorage access apistreams ttouch eventsuurl apivvibration apivisual viewport wweb animationsweb audio apiweb authentication apiweb crypto apiweb notificationsweb storage apiweb workers apiwebglwebrtcwebvttwebxr device apiwebsockets api ...
Touch events (Mozilla experimental) - Developer guides
the stream id is unique until the moztouchup event occurs; after that, the value may be recycled for another series of events.
XHTML - Developer guides
WebGuideHTMLXHTML
by henri sivonen xhtml is not for beginners by lachlan hunt ...
Parsing and serializing XML - Developer guides
note: there is in fact an htmldocument interface as well, but it is not necessarily an independent type.
Optimization and performance - Developer guides
the most notable tools are listed below.
The Unicode Bidirectional Text Algorithm - Developer guides
there are two sets of control characters; one set opens the override, and another restores the original directionality.
HTML attribute: crossorigin - HTML: Hypertext Markup Language
by default (that is, when the attribute is not specified), cors is not used at all.
Block-level elements - HTML: Hypertext Markup Language
elements the following is a complete list of all html "block-level" elements (although "block-level" is not technically defined for elements that are new in html5).
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
as soon as you draw into a canvas any data that was loaded from another origin without cors approval, the canvas becomes tainted.
<code>: The Inline Code element - HTML: Hypertext Markup Language
WebHTMLElementcode
example a paragraph of text that includes <code>: <p>the function <code>selectall()</code> highlights all the text in the input field so the user can, for example, copy or delete the text.</p> the output generated by this html looks like this: notes to represent multiple lines of code, wrap the <code> element within a <pre> element.
<dt>: The Description Term element - HTML: Hypertext Markup Language
WebHTMLElementdt
the end tag may be omitted if this element is immediately followed by another <dt> or a <dd> element, or if there is no more content in the parent element.
<frameset> - HTML: Hypertext Markup Language
WebHTMLElementframeset
note: because the use of frames is now discouraged in favor of using <iframe>, this element is not typically used by modern web sites.
<hr>: The Thematic Break (Horizontal Rule) element - HTML: Hypertext Markup Language
WebHTMLElementhr
tag omission it must have start tag, but must not have an end tag.
manifest - HTML: Hypertext Markup Language
WebHTMLElementhtmlmanifest
note: manifest-based caching mechanism has been deprecated.
<image>: The obsolete Image element - HTML: Hypertext Markup Language
WebHTMLElementimage
do not use this!
<main> - HTML: Hypertext Markup Language
WebHTMLElementmain
usage notes the content of a <main> element should be unique to the document.
<map> - HTML: Hypertext Markup Language
WebHTMLElementmap
the value of the name attribute must not be a compatibility-caseless match for the value of the name attribute of another <map> element in the same document.
<nav>: The Navigation Section element - HTML: Hypertext Markup Language
WebHTMLElementnav
usage notes it's not necessary for all links to be contained in a <nav> element.
<nobr>: The Non-Breaking Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementnobr
this element was never standard html and was not widely implemented, so you shouldn't use it.
<noframes>: The Frame Fallback element - HTML: Hypertext Markup Language
WebHTMLElementnoframes
<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.
<object> - HTML: Hypertext Markup Language
WebHTMLElementobject
if not specified, the default is the base uri of the current document.
<pre>: The Preformatted Text element - HTML: Hypertext Markup Language
WebHTMLElementpre
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.
<q>: The Inline Quotation element - HTML: Hypertext Markup Language
WebHTMLElementq
implicit aria role no corresponding role permitted aria roles any dom interface htmlquoteelement usage note: most modern browsers will automatically add quotation marks around text inside a <q> element.
<rt>: The Ruby Text element - HTML: Hypertext Markup Language
WebHTMLElementrt
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.
<slot> - HTML: Hypertext Markup Language
WebHTMLElementslot
margin-left: 16px; font-style: italic } </style> <details> <summary> <code class="name">&lt;<slot name="element-name">need name</slot>&gt;</code> <i class="desc"><slot name="description">need description</slot></i> </summary> <div class="attributes"> <h4>attributes</h4> <slot name="attributes"><p>none</p></slot> </div> </details> <hr> </template> note: you can see this complete example in action at element-details (see it running live).
<small>: the side comment element - HTML: Hypertext Markup Language
WebHTMLElementsmall
recommendation notes although the <small> element, like the <b> and <i> elements, may be perceived to violate the principle of separation between structure and presentation, all three are valid in html5.
<spacer> - HTML: Hypertext Markup Language
WebHTMLElementspacer
example <span>just a text node</span> <spacer type="horizontal" size="10"></spacer> <span>just another text node</span> <spacer type="block" width="10" height="10"></spacer> specification not part of any specification.
<span> - HTML: Hypertext Markup Language
WebHTMLElementspan
the html <span> element is a generic inline container for phrasing content, which does not inherently represent anything.
<strike> - HTML: Hypertext Markup Language
WebHTMLElementstrike
usage note: this element is deprecated in html 4 and xhtml 1, and obsoleted in html5.
itemid - HTML: Hypertext Markup Language
note: the whatwg definition specifies that an itemid must be a url.
title - HTML: Hypertext Markup Language
html <div title="cooltip"> <p>hovering here will show “cooltip”.</p> <p title="">hovering here will show nothing.</p> </div> result accessibility concerns use of the title attribute is highly problematic for: people using touch-only devices people navigating with keyboards people navigating with assistive technology such as screen readers or magnifiers people experiencing fine motor control impairment people with cognitive concerns this is due to inconsistent browser support, compounded by...
x-ms-format-detection - HTML: Hypertext Markup Language
links created through format detection do not appear in the dom.
Basics of HTTP - HTTP
choosing between www and non-www urls this article provides guidance on how to choose whether to use a www-prefixed domain or not, along with the consequences of that choice.
Reason: invalid token ‘xyz’ in CORS header ‘Access-Control-Allow-Headers’ - HTTP
if the client user agent finds among the comma-delineated values provided by the header any header name it does not recognize, this error occurs.
Reason: invalid token ‘xyz’ in CORS header ‘Access-Control-Allow-Methods’ - HTTP
if any of the specified values are not recognized by the client user agent, this error occurs.
Reason: missing token ‘xyz’ in CORS header ‘Access-Control-Allow-Headers’ from CORS preflight channel - HTTP
this error occurs when attempting to preflight a header that is not expressly allowed (that is, it's not included in the list specified by the access-control-allow-headers header sent by the server).
Reason: CORS header 'Access-Control-Allow-Origin' missing - HTTP
the response to the cors request is missing the required access-control-allow-origin header, which is used to determine whether or not the resource can be accessed by content operating within the current origin.
List of default Accept values - HTTP
note that all browsers add the */* mime type to cover all cases.
Accept-CH-Lifetime - HTTP
note: client hints are accessible only on secure origins (via tls).
Access-Control-Allow-Headers - HTTP
note that the authorization header can't be wildcarded and always needs to be listed explicitly.
Access-Control-Allow-Origin - HTTP
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".
Access-Control-Expose-Headers - HTTP
note that the authorization header can't be wildcarded and always needs to be listed explicitly.
Allow - HTTP
WebHTTPHeadersAllow
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.
Alt-Svc - HTTP
WebHTTPHeadersAlt-Svc
use of the persist=1 parameter ensures that the entry is not deleted through such changes.
Clear-Site-Data - HTTP
a directive that does not include the double quotes is invalid.
Content-Location - HTTP
indicating the url of a transaction's result say you have a <form> for sending money to another user of a site.
CSP: block-all-mixed-content - HTTP
if the former is set, the latter does nothing, so set one directive or the other – not both, unless you want to force https on older browsers that do not force it after a redirect to http.
CSP: referrer - HTTP
examples content-security-policy: referrer "none"; specifications not part of any specification.
CSP: report-to - HTTP
csp version 1 directive type reporting directive this directive is not supported in the <meta> element.
Cookie2 - HTTP
WebHTTPHeadersCookie2
the obsolete cookie2 http request header used to advise the server that the user agent understands "new-style" cookies, but nowadays user agents will use the cookie header instead, not this one.
Cross-Origin-Resource-Policy - HTTP
note: due to a bug in chrome, setting cross-origin-resource-policy can break pdf rendering, preventing visitors from being able to read past the first page of some pdfs.
DPR - HTTP
WebHTTPHeadersDPR
note: client hints are accessible only on secure origins (via tls).
Date - HTTP
WebHTTPHeadersDate
note that date is listed in the forbidden header names in the fetch spec - so this code will not send date header: fetch('https://httpbin.org/get', { 'headers': { 'date': (new date()).toutcstring() } }) header type general header forbidden header name yes syntax date: <day-name>, <day> <month> <year> <hour>:<minute>:<second> gmt directives <day-name> one of "mon", "tue", "wed", "thu", "fri", "sat", or "sun" (case-sensitive).
Device-Memory - HTTP
note: client hints are accessible only on secure origins (via tls).
Early-Data - HTTP
the early-data header is not set by the originator of the request (i.e., a browser).
Feature-Policy: accelerometer - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: ambient-light-sensor - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: autoplay - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: battery - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: document-domain - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: encrypted-media - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: gyroscope - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: layout-animations - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: legacy-image-formats - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: magnetometer - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: midi - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: oversized-images - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: payment - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: picture-in-picture - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: publickey-credentials-get - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: sync-xhr - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: unoptimized-images - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: usb - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: vibrate - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
web-share - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
Feature-Policy: xr-spatial-tracking - HTTP
the feature is not allowed in cross-origin documents in nested browsing contexts.
If-Modified-Since - HTTP
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.
If-Unmodified-Since - HTTP
the if-unmodified-since request http header makes the request conditional: the server will send back the requested resource, or accept it in the case of a post or another non-safe method, only if it has not been last modified after the given date.
Origin - HTTP
WebHTTPHeadersOrigin
note: the origin header is not set on fetch requests with a method of head or get (this behavior was corrected in firefox 65 — see bug 1508661).
Proxy-Authorization - HTTP
note: base64 encoding does not mean encryption or hashing!
Public-Key-Pins - HTTP
note: public key pinning mechanism was deprecated in favor of certificate transparency and expect-ct header.
Range - HTTP
WebHTTPHeadersRange
if the ranges are invalid, the server returns the 416 range not satisfiable error.
Sec-Fetch-Site - HTTP
header type fetch metadata request header forbidden header name yes, since it has prefix sec- cors-safelisted response header cors-safelisted request header syntax sec-fetch-site: cross-site sec-fetch-site: same-origin sec-fetch-site: same-site sec-fetch-site: none values cross-site same-origin same-site none this request does not relate to any context like site, origin, or frame.
Sec-Fetch-User - HTTP
the sec-fetch-user fetch metadata header indicates whether or not a navigation request was triggered by a user activation.
Server-Timing - HTTP
for example, you could only show metrics to authenticated users and nothing to the public.
TE - HTTP
WebHTTPHeadersTE
note that chunked is always acceptable for http/1.1 recipients and you don't have to specify "chunked" using the te header.
User-Agent - HTTP
note that platform can consist of multiple "; "-separated tokens.
WWW-Authenticate - HTTP
this does not relate to the encoding of the realm string.
X-Forwarded-Host - HTTP
examples x-forwarded-host: id42.example-cdn.com specifications not part of any current specification.
DELETE - HTTP
WebHTTPMethodsDELETE
ponse has body may safe no idempotent yes cacheable no allowed in html forms no syntax delete /file.html http/1.1 example request delete /file.html http/1.1 responses if a delete method is successfully applied, there are several response status codes possible: a 202 (accepted) status code if the action will likely succeed but has not yet been enacted.
HEAD - HTTP
WebHTTPMethodsHEAD
a response to a head method should not have a body.
PUT - HTTP
WebHTTPMethodsPUT
request has body yes successful response has body no safe no idempotent yes cacheable no allowed in html forms no syntax put /new.html http/1.1 example request put /new.html http/1.1 host: example.com content-type: text/html content-length: 16 <p>new file</p> responses if the target resource does not have a current representation and the put request successfully creates one, then the origin server must inform the user agent by sending a 201 (created) response.
HTTP resources and specifications - HTTP
rfc 6797 http strict transport security (hsts) proposed standard upgrade insecure requests upgrade insecure requests candidate recommendation content security policy 1.0 content security policy 1.0 csp 1.1 and csp 3.0 doesn't extend the http standard obsolete microsoft document specifying legacy document modes* defines x-ua-compatible note rfc 5689 http extensions for web distributed authoring and versioning (webdav) these extensions of the web, as well as carddav and caldav, are out-of-scope for http on the web.
200 OK - HTTP
WebHTTPStatus200
the successful result of a put or a delete is often not a 200 ok but a 204 no content (or a 201 created when the resource is uploaded for the first time).
205 Reset Content - HTTP
WebHTTPStatus205
status 205 reset content specifications specification title rfc 7231, section 6.3.6: 205 reset content hypertext transfer protocol (http/1.1): semantics and content compatibility notes browser behavior differs if this response erroneously includes a body on persistent connections see 204 no content for more detail.
301 Moved Permanently - HTTP
WebHTTPStatus301
even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents align with it - you can still find this type of bugged software out there.
303 See Other - HTTP
WebHTTPStatus303
the hypertext transfer protocol (http) 303 see other redirect status response code indicates that the redirects don't link to the newly uploaded resources, but to another page (such as a confirmation page or an upload progress page).
401 Unauthorized - HTTP
WebHTTPStatus401
the http 401 unauthorized client error status response code indicates that the request has not been applied because it lacks valid authentication credentials for the target resource.
407 Proxy Authentication Required - HTTP
WebHTTPStatus407
the http 407 proxy authentication required client error status response code indicates that the request has not been applied because it lacks valid authentication credentials for a proxy server that is between the browser and the server that can access the requested resource.
408 Request Timeout - HTTP
WebHTTPStatus408
note: some servers merely shut down the connection without sending this message.
410 Gone - HTTP
WebHTTPStatus410
note: a 410 response is cacheable by default.
411 Length Required - HTTP
WebHTTPStatus411
note: by specification, when sending data in a series of chunks, the content-length header is omitted and at the beginning of each chunk you need to add the length of the current chunk in hexadecimal format.
417 Expectation Failed - HTTP
WebHTTPStatus417
the http 417 expectation failed client error response code indicates that the expectation given in the request's expect header could not be met.
422 Unprocessable Entity - HTTP
WebHTTPStatus422
important: the client should not repeat this request without modification.
428 Precondition Required - HTTP
WebHTTPStatus428
when a precondition header is not matching the server side state, the response should be 412 precondition failed.
500 Internal Server Error - HTTP
WebHTTPStatus500
usually, this indicates the server cannot find a better 5xx error code to response.
502 Bad Gateway - HTTP
WebHTTPStatus502
note: a gateway might refer to different things in networking and a 502 error is usually not something you can fix, but requires a fix by the web server or the proxies you are trying to get access through.
506 Variant Also Negotiates - HTTP
WebHTTPStatus506
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.
507 Insufficient Storage - HTTP
WebHTTPStatus507
it indicates that a method could not be performed because the server cannot store the representation needed to successfully complete the request.
HTTP
WebHTTP
http is a stateless protocol, meaning that the server does not keep any data (state) between two requests.
JavaScript language resources - JavaScript
es.next features are more correctly called proposals, because, by definition, the specification has not been finalized yet.
About the JavaScript reference - JavaScript
for the most part, this reference attempts to be environment-agnostic and does not target a web browser environment.
The legacy Iterator protocol - JavaScript
the deprecated firefox-only iterator protocol firefox, prior to version 26 implemented another iterator protocol that is similar to the standard es2015 iterator protocol.
TypeError: invalid Array.prototype.sort argument - JavaScript
message typeerror: argument is not a function object (edge) typeerror: invalid array.prototype.sort argument (firefox) error type typeerror what went wrong?
SyntaxError: invalid regular expression flag "x" - JavaScript
the javascript exception "invalid regular expression flag" occurs when the flags, defined after the second slash in regular expression literal, are not one of g, i, m, s, u, or y.
ReferenceError: can't access lexical declaration`X' before initialization - JavaScript
message referenceerror: use before delaration (edge) referenceerror: can't access lexical declaration `x' before initialization (firefox) referenceerror: 'x' is not defined (chrome) error type referenceerror what went wrong?
TypeError: can't redefine non-configurable property "x" - JavaScript
message typeerror: cannot modify non-writable property {x} (edge) typeerror: can't redefine non-configurable property "x" (firefox) typeerror: cannot redefine property: "x" (chrome) error type typeerror what went wrong?
TypeError: cyclic object value - JavaScript
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?
Warning: String.x is deprecated; use String.prototype.x instead - JavaScript
examples deprecated syntax var num = 15; string.replace(num, /5/, '2'); standard syntax var num = 15; string(num).replace(/5/, '2'); shim the following is a shim to provide support to non-supporting browsers: /*globals define*/ // assumes all supplied string instance methods already present // (one may use shims for these if not available) (function() { 'use strict'; var i, // we could also build the array of methods with the following, but the // getownpropertynames() method is non-shimable: // object.getownpropertynames(string).filter(function(methodname) { // return typeof string[methodname] === 'function'; // }); methods = [ 'contains', 'substring', 'tolowercase', 'touppercase',...
ReferenceError: deprecated caller or arguments usage - JavaScript
message typeerror: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context (edge) warning: referenceerror: deprecated caller usage (firefox) warning: referenceerror: deprecated arguments usage (firefox) typeerror: 'callee' and 'caller' cannot be accessed in strict mode.
SyntaxError: "0"-prefixed octal literals and octal escape seq. are deprecated - JavaScript
message syntaxerror: octal numeric literals and escape characters not allowed in strict mode (edge) syntaxerror: "0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead error type syntaxerror in strict mode only.
TypeError: setting getter-only property "x" - JavaScript
message typeerror: assignment to read-only properties is not allowed in strict mode (edge) typeerror: setting getter-only property "x" (firefox) typeerror: cannot set property "prop" of #<object> which has only a getter (chrome) error type typeerror in strict mode only.
RangeError: invalid date - JavaScript
message rangeerror: invalid date (edge) rangeerror: invalid date (firefox) rangeerror: invalid time value (chrome) rangeerror: provided date is not in valid range (chrome) error type rangeerror what went wrong?
SyntaxError: missing ) after argument list - JavaScript
th.pi); // syntaxerror: missing ) after argument list you can correct the log call by adding the "+" operator: console.log('pi: ' + math.pi); // "pi: 3.141592653589793" unterminated strings console.log('"java" + "script" = \"' + 'java' + 'script\"); // syntaxerror: missing ) after argument list here javascript thinks that you meant to have ); inside the string and ignores it, and it ends up not knowing that you meant the ); to end the function console.log.
SyntaxError: missing ) after condition - JavaScript
if (3 > math.pi) { console.log("wait what?"); } misused is keyword if you are coming from another programming language, it is also easy to add keywords that don't mean the same or have no meaning at all in javascript.
RangeError: repeat count must be non-negative - JavaScript
it must be between 0 and less than positive infinity and cannot be a negative number.
SyntaxError: missing variable name - JavaScript
check to ensure the previous lines / declaration does not end with a comma instead of a semi-colon.
RangeError: precision is out of range - JavaScript
ses 77.1234.toexponential(-1); // rangeerror 77.1234.toexponential(101); // rangeerror 2.34.tofixed(-100); // rangeerror 2.34.tofixed(1001); // rangeerror 1234.5.toprecision(-1); // rangeerror 1234.5.toprecision(101); // rangeerror valid cases 77.1234.toexponential(4); // 7.7123e+1 77.1234.toexponential(2); // 7.71e+1 2.34.tofixed(1); // 2.3 2.35.tofixed(1); // 2.4 (note that it rounds up in this case) 5.123456.toprecision(5); // 5.1235 5.123456.toprecision(2); // 5.1 5.123456.toprecision(1); // 5 ...
TypeError: Reduce of empty array with no initial value - JavaScript
var ints = [0, -1, -2, -3, -4, -5]; ints.filter(x => x > 0) // removes all elements .reduce((x, y) => x + y, 0) // the initial value is the neutral element of the addition another way would be two to handle the empty case, either before calling reduce, or in the callback after adding an unexpected dummy initial value.
SyntaxError: "x" is a reserved identifier - JavaScript
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.
Warning: unreachable code after return statement - JavaScript
warnings will not be shown for semicolon-less returns if these statements follow it: throw break var function examples invalid cases function f() { var x = 3; x += 4; return x; // return exits the function immediately x -= 3; // so this line will never run; it is unreachable } function f() { return // this is treated like `return;` 3 + 4; // so the function returns, and this li...
arguments.length - JavaScript
*/) { base = number(base); for (var i = 1; i < arguments.length; i++) { base += number(arguments[i]); } return base; } note the difference between function.length and arguments.length specifications specification ecmascript (ecma-262)the definition of 'arguments exotic objects' in that specification.
AggregateError() constructor - JavaScript
syntax new aggregateerror(errors[, message]) parameters errors an iterable of errors, may not actually be error instances.
Array.prototype.pop() - JavaScript
objects which do not contain a length property reflecting the last in a series of consecutive, zero-based numerical properties may not behave in any meaningful manner.
Array.prototype.reverse() - JavaScript
objects which do not contain a length property reflecting the last in a series of consecutive, zero-based numerical properties may not behave in any meaningful manner.
Array.prototype.shift() - JavaScript
objects which do not contain a length property reflecting the last in a series of consecutive, zero-based numerical properties may not behave in any meaningful manner.
ArrayBuffer() constructor - JavaScript
compatibility notes starting with ecmascript 2015, arraybuffer constructors require to be constructed with a new operator.
ArrayBuffer.prototype.byteLength - JavaScript
the value is established when the array is constructed and cannot be changed.
ArrayBuffer.prototype.slice() - JavaScript
description the slice() method copies up to, but not including, the byte indicated by the end parameter.
Atomics.add() - JavaScript
exceptions throws a typeerror, if typedarray is not one of the allowed integer types.
Atomics.and() - JavaScript
exceptions throws a typeerror, if typedarray is not one of the allowed integer types.
Atomics.exchange() - JavaScript
exceptions throws a typeerror, if typedarray is not one of the allowed integer types.
Atomics.load() - JavaScript
exceptions throws a typeerror, if typedarray is not one of the allowed integer types.
Atomics.or() - JavaScript
exceptions throws a typeerror, if typedarray is not one of the allowed integer types.
Atomics.store() - JavaScript
exceptions throws a typeerror, if typedarray is not one of the allowed integer types.
Atomics.sub() - JavaScript
exceptions throws a typeerror, if typedarray is not one of the allowed integer types.
Atomics.xor() - JavaScript
exceptions throws a typeerror, if typedarray is not one of the allowed integer types.
BigInt() constructor - JavaScript
note: bigint() is not used with the new operator.
BigInt.prototype.toLocaleString() - JavaScript
chinese decimal console.log(bigint.tolocalestring('zh-hans-cn-u-nu-hanidec')); // → 一二三,四五六,七八九,一二三,四五六,七八九 // when requesting a language that may not be supported, such as // balinese, include a fallback language, in this case indonesian console.log(bigint.tolocalestring(['ban', 'id'])); // → 123.456.789.123.456.789 using options the results provided by tolocalestring can be customized using the options argument: var bigint = 123456789123456789n; // request a currency format console.log(bigint.tolocalestring('de-de', { style: 'currency'...
Boolean.prototype.toSource() - JavaScript
examples native function for the built-in boolean object, tosource returns the following string indicating that the source code is not available: function boolean() { [native code] } specifications not part of any standard.
Boolean.prototype.toString() - JavaScript
description the boolean object overrides the tostring method of the object object; it does not inherit object.prototype.tostring().
Boolean.prototype.valueOf() - JavaScript
this method is usually called internally by javascript and not explicitly in code.
DataView.prototype.buffer - JavaScript
the value is established when the dataview is constructed and cannot be changed.
DataView.prototype.byteOffset - JavaScript
the value is established when an dataview is constructed and cannot be changed.
DataView - JavaScript
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.
Date.prototype[@@toPrimitive] - JavaScript
if the tostring property does not exist, it tries to call the valueof method and if the valueof does not exist either, [@@toprimitive]() throws a typeerror.
Date.prototype.getDay() - JavaScript
var xmas95 = new date('december 25, 1995 23:15:30'); var weekday = xmas95.getday(); console.log(weekday); // 1 note: if needed, the full name of a day ("monday" for example) can be obtained by using intl.datetimeformat with an options parameter.
Date.prototype.getMonth() - JavaScript
var xmas95 = new date('december 25, 1995 23:15:30'); var month = xmas95.getmonth(); console.log(month); // 11 note: if needed, the full name of a month ("january" for example) can be obtained by using intl.datetimeformat() with an options parameter.
Date.prototype.getTime() - JavaScript
you can use this method to help assign a date and time to another date object.
Date.prototype.getUTCMilliseconds() - JavaScript
not to be confused with unix epoch time.
Date.prototype.getYear() - JavaScript
because getyear() does not return full years ("year 2000 problem"), it is no longer used and has been replaced by the getfullyear() method.
Date.now() - JavaScript
engines which have not been updated to support this method can work around the absence of this method using the following shim: if (!date.now) { date.now = function now() { return new date().gettime(); }; } examples reduced time precision to offer protection against timing attacks and fingerprinting, the precision of date.now() might get rounded depending on browser settings.
Date.prototype.setFullYear() - JavaScript
description if you do not specify the monthvalue and datevalue parameters, the values returned from the getmonth() and getdate() methods are used.
Date.prototype.setHours() - JavaScript
description if you do not specify the minutesvalue, secondsvalue, and msvalue parameters, the values returned from the getminutes(), getseconds(), and getmilliseconds() methods are used.
Date.prototype.setMinutes() - JavaScript
description if you do not specify the secondsvalue and msvalue parameters, the values returned from getseconds() and getmilliseconds() methods are used.
Date.prototype.setMonth() - JavaScript
description if you do not specify the dayvalue parameter, the value returned from the getdate() method is used.
Date.prototype.setSeconds() - JavaScript
description if you do not specify the msvalue parameter, the value returned from the getmilliseconds() method is used.
Date.prototype.setTime() - JavaScript
description use the settime() method to help assign a date and time to another date object.
Date.prototype.setUTCFullYear() - JavaScript
description if you do not specify the monthvalue and dayvalue parameters, the values returned from the getutcmonth() and getutcdate() methods are used.
Date.prototype.setUTCHours() - JavaScript
description if you do not specify the minutesvalue, secondsvalue, and msvalue parameters, the values returned from the getutcminutes(), getutcseconds(), and getutcmilliseconds() methods are used.
Date.prototype.setUTCMinutes() - JavaScript
description if you do not specify the secondsvalue and msvalue parameters, the values returned from getutcseconds() and getutcmilliseconds() methods are used.
Date.prototype.setUTCMonth() - JavaScript
description if you do not specify the dayvalue parameter, the value returned from the getutcdate() method is used.
Date.prototype.setUTCSeconds() - JavaScript
description if you do not specify the msvalue parameter, the value returned from the getutcmilliseconds() method is used.
Date.prototype.setYear() - JavaScript
because setyear() does not set full years ("year 2000 problem"), it is no longer used and has been replaced by the setfullyear() method.
Date.prototype.toGMTString() - JavaScript
note: togmtstring() is deprecated and should no longer be used.
Date.prototype.toSource() - JavaScript
examples native function for the built-in date object, tosource() returns the following string indicating that the source code is not available: function date() { [native code] } specifications not part of any standard.
Date.prototype.toTimeString() - JavaScript
the totimestring() method is especially useful because compliant engines implementing ecma-262 may differ in the string obtained from tostring() for date objects, as the format is implementation-dependent; simple string slicing approaches may not produce consistent results across multiple engines.
Date.prototype.valueOf() - JavaScript
this method is usually called internally by javascript and not explicitly in code.
Error.prototype.columnNumber - JavaScript
examples using columnnumber var e = new error('could not parse input'); throw e; console.log(e.columnnumber) // 0 specifications not part of any standard.
Error.prototype.fileName - JavaScript
examples using filename var e = new error('could not parse input'); throw e; // e.filename could look like "file:///c:/example.html" specifications not part of any standard.
Error.prototype.message - JavaScript
examples throwing a custom error var e = new error('could not parse input'); // e.message is 'could not parse input' throw e; specifications specification ecmascript (ecma-262)the definition of 'error.prototype.message' in that specification.
FinalizationRegistry.prototype.unregister() - JavaScript
notes when a target object has been reclaimed, it is no longer registered in the registry.
Function.length - JavaScript
*/ console.log((function(...args) {}).length); // 0, rest parameter is not counted console.log((function(a, b = 1, c) {}).length); // 1, only parameters before the first one with // a default value is counted specifications specification ecmascript (ecma-262)the definition of 'function.length' in that specification.
Generator.prototype.throw() - JavaScript
this is equivalent of not specifying the done property altogether.
Generator - JavaScript
constructor this object cannot be instantiated directly.
InternalError() constructor - JavaScript
the line number of the code that caused the exception examples creating a new internalerror new internalerror("engine failure"); specifications not part of any standard.
InternalError - JavaScript
specifications not part of any standard.
Intl.Collator.prototype.compare() - JavaScript
note that the function is bound to the collator from which it was obtained, so it can be passed directly to array.prototype.sort().
Intl.Collator.prototype.resolvedOptions() - JavaScript
if the implementation does not support these properties, they are omitted.
Intl.Collator - JavaScript
examples using collator the following example demonstrates the different potential results for a string occurring before, after, or at the same level as another: console.log(new intl.collator().compare('a', 'c')); // → a negative value console.log(new intl.collator().compare('c', 'a')); // → a positive value console.log(new intl.collator().compare('a', 'a')); // → 0 note that the results shown in the code above can vary between browsers and browser versions.
Intl.DateTimeFormat - JavaScript
most arabic 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'...
Intl.Locale.prototype.collation - JavaScript
do not use.
Intl.NumberFormat.prototype.format() - JavaScript
note that the function is bound to the numberformat from which it was obtained, so it can be passed directly to array.prototype.map.
Intl.NumberFormat.prototype.formatToParts() - JavaScript
examples comparing format and formattoparts numberformat outputs localized, opaque strings that cannot be manipulated directly: var number = 3500; var formatter = new intl.numberformat('de-de', { style: 'currency', currency: 'eur' }); formatter.format(number); // "3.500,00 €" however, in many user interfaces there is a desire to customize the formatting of this string.
Intl.NumberFormat - JavaScript
chinese decimal console.log(new intl.numberformat('zh-hans-cn-u-nu-hanidec').format(number)); // → 一二三,四五六.七八九 // when requesting a language that may not be supported, such as // balinese, include a fallback language, in this case indonesian console.log(new intl.numberformat(['ban', 'id']).format(number)); // → 123.456,789 using options the results can be customized using the options argument: var number = 123456.789; // request a currency format console.log(new intl.numberformat('de-de', { style: 'currency', currency: 'eur' }).format(numbe...
Intl.RelativeTimeFormat.prototype.format() - JavaScript
this allows to not always have to use numeric values in the output.
Intl.RelativeTimeFormat.prototype.formatToParts() - JavaScript
if a "part" came from numberformat, it will have a unit property which indicates the unit being formatted; literals which are part of the larger frame will not have this property.
Intl.RelativeTimeFormat.prototype.resolvedOptions() - JavaScript
the "auto" value allows to not always have to use numeric values in the output.
Intl.getCanonicalLocales() - JavaScript
examples using getcanonicallocales intl.getcanonicallocales('en-us'); // ["en-us"] intl.getcanonicallocales(['en-us', 'fr']); // ["en-us", "fr"] intl.getcanonicallocales('en_us'); // rangeerror:'en_us' is not a structurally valid language tag specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.getcanonicallocales' in that specification.
Map.prototype.delete() - JavaScript
return value true if an element in the map object existed and has been removed, or false if the element does not exist.
Map.prototype.has() - JavaScript
the has() method returns a boolean indicating whether an element with the specified key exists or not.
Map.prototype.size - JavaScript
a set accessor function for size is undefined; you can not change this property.
Math.E - JavaScript
property attributes of math.e writable no enumerable no configurable no description because e is a static property of math, you always use it as math.e, rather than as a property of a math object you created (math is not a constructor).
Math.LN10 - JavaScript
property attributes of math.ln10 writable no enumerable no configurable no description because ln10 is a static property of math, you always use it as math.ln10, rather than as a property of a math object you created (math is not a constructor).
Math.LN2 - JavaScript
property attributes of math.ln2 writable no enumerable no configurable no description because ln2 is a static property of math, you always use it as math.ln2, rather than as a property of a math object you created (math is not a constructor).
Math.LOG10E - JavaScript
property attributes of math.log10e writable no enumerable no configurable no description because log10e is a static property of math, you always use it as math.log10e, rather than as a property of a math object you created (math is not a constructor).
Math.LOG2E - JavaScript
property attributes of math.log2e writable no enumerable no configurable no description because log2e is a static property of math, you always use it as math.log2e, rather than as a property of a math object you created (math is not a constructor).
Math.PI - JavaScript
property attributes of math.pi writable no enumerable no configurable no description because pi is a static property of math, you always use it as math.pi, rather than as a property of a math object you created (math is not a constructor).
Math.SQRT1_2 - JavaScript
property attributes of math.sqrt1_2 writable no enumerable no configurable no description because sqrt1_2 is a static property of math, you always use it as math.sqrt1_2, rather than as a property of a math object you created (math is not a constructor).
Math.SQRT2 - JavaScript
property attributes of math.sqrt2 writable no enumerable no configurable no description because sqrt2 is a static property of math, you always use it as math.sqrt2, rather than as a property of a math object you created (math is not a constructor).
Math.abs() - JavaScript
description because abs() is a static method of math, you always use it as math.abs(), rather than as a method of a math object you created (math is not a constructor).
Math.acos() - JavaScript
because acos() is a static method of math, you always use it as math.acos(), rather than as a method of a math object you created (math is not a constructor).
Math.asin() - JavaScript
because asin() is a static method of math, you always use it as math.asin(), rather than as a method of a math object you created (math is not a constructor).
Math.asinh() - JavaScript
description because asinh() is a static method of math, you always use it as math.asinh(), rather than as a method of a math object you created (math is not a constructor).
Math.atanh() - JavaScript
description because atanh() is a static method of math, you always use it as math.atanh(), rather than as a method of a math object you created (math is not a constructor).
Math.cbrt() - JavaScript
description because cbrt() is a static method of math, you always use it as math.cbrt(), rather than as a method of a math object you created (math is not a constructor).
Math.cos() - JavaScript
because cos() is a static method of math, you always use it as math.cos(), rather than as a method of a math object you created (math is not a constructor).
Math.cosh() - JavaScript
description because cosh() is a static method of math, you always use it as math.cosh(), rather than as a method of a math object you created (math is not a constructor).
Math.exp() - JavaScript
description because exp() is a static method of math, you always use it as math.exp(), rather than as a method of a math object you created (math is not a constructor).
Math.expm1() - JavaScript
description because expm1() is a static method of math, you always use it as math.expm1(), rather than as a method of a math object you created (math is not a constructor).
Math.log() - JavaScript
because log() is a static method of math, you always use it as math.log(), rather than as a method of a math object you created (math is not a constructor).
Math.log10() - JavaScript
because log10() is a static method of math, you always use it as math.log10(), rather than as a method of a math object you created (math is not a constructor).
Math.log1p() - JavaScript
because log1p() is a static method of math, you always use it as math.log1p(), rather than as a method of a math object you created (math is not a constructor).
Math.pow() - JavaScript
if the base is negative and the exponent is not an integer, the result is nan.
Math.round() - JavaScript
note that this differs from many languages' round() functions, which often round this case to the next integer away from zero, instead giving a different result in the case of negative numbers with a fractional part of exactly 0.5.
Math.sin() - JavaScript
because sin() is a static method of math, you always use it as math.sin(), rather than as a method of a math object you created (math is not a constructor).
Math.sinh() - JavaScript
description because sinh() is a static method of math, you always use it as math.sinh(), rather than as a method of a math object you created (math is not a constructor).
Math.sqrt() - JavaScript
because sqrt() is a static method of math, you always use it as math.sqrt(), rather than as a method of a math object you created (math is not a constructor).
Math.tan() - JavaScript
because tan() is a static method of math, you always use it as math.tan(), rather than as a method of a math object you created (math is not a constructor).
Math.tanh() - JavaScript
description because tanh() is a static method of math, you always use it as math.tanh(), rather than as a method of a math object you created (math is not a constructor).
Math.trunc() - JavaScript
because trunc() is a static method of math, you always use it as math.trunc(), rather than as a method of a math object you created (math is not a constructor).
Number.EPSILON - JavaScript
you do not have to create a number object to access this static property (use number.epsilon).
Number.MAX_SAFE_INTEGER - JavaScript
this field does not exist in old browsers.
Number.MIN_VALUE - JavaScript
property attributes of number.min_value writable no enumerable no configurable no description the min_value property is the number closest to 0, not the most negative number, that javascript can represent.
Number.NEGATIVE_INFINITY - JavaScript
note, however, that isfinite would be more appropriate in such a case.
Number.POSITIVE_INFINITY - JavaScript
note, however, that isfinite would be more appropriate in such a case.
Number.isFinite() - JavaScript
return value a boolean indicating whether or not the given value is a finite number.
Number.isInteger() - JavaScript
return value a boolean indicating whether or not the given value is an integer.
Number.isNaN() - JavaScript
polyfill the following works because nan is the only value in javascript which is not equal to itself.
Number.prototype.valueOf() - JavaScript
description this method is usually called internally by javascript and not explicitly in web code.
Object.prototype.__defineGetter__() - JavaScript
this method should not be used since better alternatives exist.
Object.prototype.__lookupGetter__() - JavaScript
description if a getter has been defined for an object's property, it's not possible to reference the getter function through that property, because that property refers to the return value of that function.
Object.prototype.__lookupSetter__() - JavaScript
description if a setter has been defined for an object's property, it was not possible to reference the setter function through that property, because that property refers to the return value of that function.
Object.fromEntries() - JavaScript
{ 0: "a", 1: "b", 2: "c" } object transformations with object.fromentries, its reverse method object.entries(), and array manipulation methods, you are able to transform objects like this: const object1 = { a: 1, b: 2, c: 3 }; const object2 = object.fromentries( object.entries(object1) .map(([ key, val ]) => [ key, val * 2 ]) ); console.log(object2); // { a: 2, b: 4, c: 6 } please do not add polyfills on mdn pages.
Object.getOwnPropertySymbols() - JavaScript
note that object.getownpropertynames() itself does not contain the symbol properties of an object and only the string properties.
Object.getPrototypeOf() - JavaScript
object.getprototypeof('foo'); // typeerror: "foo" is not an object (es5 code) object.getprototypeof('foo'); // string.prototype (es2015 code) specifications specification ecmascript (ecma-262)the definition of 'object.getprototypeof' in that specification.
Object.prototype.toLocaleString() - JavaScript
this function is provided to give objects a generic tolocalestring method, even though not all may use it.
Object.values() - JavaScript
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.
Promise.allSettled() - JavaScript
it is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise.
Promise.race() - JavaScript
); // "two" // both fulfill, but p2 is faster }); var p3 = new promise(function(resolve, reject) { settimeout(() => resolve('three'), 100); }); var p4 = new promise(function(resolve, reject) { settimeout(() => reject(new error('four')), 500); }); promise.race([p3, p4]) .then(function(value) { console.log(value); // "three" // p3 is faster, so it fulfills }, function(reason) { // not called }); var p5 = new promise(function(resolve, reject) { settimeout(() => resolve('five'), 500); }); var p6 = new promise(function(resolve, reject) { settimeout(() => reject(new error('six')), 100); }); promise.race([p5, p6]) .then(function(value) { // not called }, function(error) { console.log(error.message); // "six" // p6 is faster, so it rejects }); specifications ...
Promise.reject() - JavaScript
examples using the static promise.reject() method promise.reject(new error('fail')).then(function() { // not called }, function(error) { console.error(error); // stacktrace }); specifications specification ecmascript (ecma-262)the definition of 'promise.reject' in that specification.
handler.construct() - JavaScript
const p = new proxy({}, { construct: function(target, argumentslist, newtarget) { return {}; } }); new p(); // typeerror is thrown, "p" is not a constructor specifications specification ecmascript (ecma-262)the definition of '[[construct]]' in that specification.
handler.ownKeys() - JavaScript
if the target object is not extensible, then the result list must contain all the keys of the own properties of the target object and no other values.
handler.setPrototypeOf() - JavaScript
interceptions this trap can intercept these operations: object.setprototypeof() reflect.setprototypeof() invariants if the following invariants are violated, the proxy will throw a typeerror: if target is not extensible, the prototype parameter must be the same value as object.getprototypeof(target).
Proxy.revocable() - JavaScript
it can be any sort of object, including a native array, a function, or even another proxy.
RangeError() constructor - JavaScript
the rangeerror() constructor creates an error when a value is not in the set or range of allowed values.
ReferenceError() constructor - JavaScript
examples catching a referenceerror try { let a = undefinedvariable } catch (e) { console.log(e instanceof referenceerror) // true console.log(e.message) // "undefinedvariable is not defined" console.log(e.name) // "referenceerror" console.log(e.filename) // "scratchpad/1" console.log(e.linenumber) // 2 console.log(e.columnnumber) // 6 console.log(e.stack) // "@scratchpad/2:2:7\n" } creating a referenceerror try { throw new referenceerror('hello', 'somefile.js', 10) } cat...
ReferenceError - JavaScript
examples catching a referenceerror try { let a = undefinedvariable } catch (e) { console.log(e instanceof referenceerror) // true console.log(e.message) // "undefinedvariable is not defined" console.log(e.name) // "referenceerror" console.log(e.filename) // "scratchpad/1" console.log(e.linenumber) // 2 console.log(e.columnnumber) // 6 console.log(e.stack) // "@scratchpad/2:2:7\n" } creating a referenceerror try { throw new referenceerror('hello', 'somefile.js', 10) } cat...
Reflect.apply() - JavaScript
exceptions a typeerror, if the target is not callable.
Reflect.get() - JavaScript
exceptions a typeerror, if target is not an object.
Reflect.getPrototypeOf() - JavaScript
exceptions a typeerror, if target is not an object.
Reflect.ownKeys() - JavaScript
exceptions a typeerror, if target is not an object.
RegExp.prototype[@@replace]() - JavaScript
if pattern argument is not a regexp object, string.prototype.replace() doesn't call this method, nor creates a regexp object.
RegExp.prototype.compile() - JavaScript
flags if specified, flags can have any combination of the following values: g global match i ignore case m multiline; treat beginning and end characters (^ and $) as working over multiple lines (i.e., match the beginning or end of each line (delimited by \n or \r), not only the very beginning or end of the whole input string) y sticky; matches only from the index indicated by the lastindex property of this regular expression in the target string (and does not attempt to match from any later indexes).
RegExp.input ($_) - JavaScript
description the input property is static, it is not a property of an individual regular expression object.
RegExpInstance.lastIndex - JavaScript
if lastindex is equal to the length of the string and if the regular expression does not match the empty string, then the regular expression mismatches input, and lastindex is reset to 0.
RegExp.prototype.toString() - JavaScript
description the regexp object overrides the tostring() method of the object object; it does not inherit object.prototype.tostring().
Set.prototype.size - JavaScript
a set accessor function for size is undefined; you cannot change this property.
SharedArrayBuffer() constructor - JavaScript
note that sharedarraybuffer was disabled by default in all major browsers on 5 january, 2018 in response to spectre.
SharedArrayBuffer.prototype.byteLength - JavaScript
the value is established when the shared array is constructed and cannot be changed.
SharedArrayBuffer.prototype.slice() - JavaScript
slice extracts up to but not including end.
String.prototype.big() - JavaScript
usage note: the <big> element has been removed in html5 and shouldn't be used anymore.
String.prototype.codePointAt() - JavaScript
var first = string.charcodeat(index); var second; if ( // check if it’s the start of a surrogate pair first >= 0xd800 && first <= 0xdbff && // high surrogate size > index + 1 // there is a next code unit ) { second = string.charcodeat(index + 1); if (second >= 0xdc00 && second <= 0xdfff) { // low surrogate // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae return (first - 0xd800) * 0x400 + second - 0xdc00 + 0x10000; } } return first; }; if (defineproperty) { defineproperty(string.prototype, 'codepointat', { 'value': codepointat, 'configurable': true, 'writable': true }); } else { string.prototype.codepointat = codepointat; ...
String.prototype.concat() - JavaScript
if the arguments are not of the type string, they are converted to string values before concatenating.
String.prototype.fontcolor() - JavaScript
usage note: the <font> element has been removed in html5 and shouldn't be used anymore.
String.prototype.fontsize() - JavaScript
usage note: the <font> element has been removed in html5 and shouldn't be used anymore.
String.fromCharCode() - JavaScript
description this method returns a string and not a string object.
String.prototype.link() - JavaScript
the link() method creates a string representing the code for an <a> html element to be used as a hypertext link to another url.
String.prototype.padStart() - JavaScript
the padstart() method pads the current string with another string (multiple times, if needed) until the resulting string reaches the given length.
String.prototype.search() - JavaScript
an unsuccessful search (-1) let str = "hey jude" let re = /[a-z]/g let redot = /[.]/g console.log(str.search(re)) // returns 4, which is the index of the first capital letter "j" console.log(str.search(redot)) // returns -1 cannot find '.' dot punctuation specifications specification ecmascript (ecma-262)the definition of 'string.prototype.search' in that specification.
String.prototype.toLowerCase() - JavaScript
tolowercase() does not affect the value of the string str itself.
String.prototype.toString() - JavaScript
description the string object overrides the tostring() method of the object object; it does not inherit object.prototype.tostring().
String.prototype.trimEnd() - JavaScript
trimend() or trimright() do not affect the value of the string itself.
String.prototype.trimStart() - JavaScript
trimleft() or trimstart() do not affect the value of the string itself.
String.prototype.valueOf() - JavaScript
this method is usually called internally by javascript and not explicitly in code.
Symbol.prototype[@@toPrimitive] - JavaScript
the hint argument is not used.
Symbol.asyncIterator - JavaScript
o"; yield "async"; yield "iteration!"; } }; (async () => { for await (const x of myasynciterable) { console.log(x); // expected output: // "hello" // "async" // "iteration!" } })(); when creating an api, remember that async iterables are designed to represent something iterable — like a stream of data or a list —, not to completely replace callbacks and events in most situations.
Symbol.keyFor() - JavaScript
examples using keyfor var globalsym = symbol.for('foo'); // create a new global symbol symbol.keyfor(globalsym); // "foo" var localsym = symbol(); symbol.keyfor(localsym); // undefined // well-known symbols are not symbols registered // in the global symbol registry symbol.keyfor(symbol.iterator) // undefined specifications specification ecmascript (ecma-262)the definition of 'symbol.keyfor' in that specification.
Symbol.split - JavaScript
property attributes of symbol.split writable no enumerable no configurable no examples custom reverse split class reversesplit { [symbol.split](string) { const array = string.split(' '); return array.reverse(); } } console.log('another one bites the dust'.split(new reversesplit())); // expected output: [ "dust", "the", "bites", "one", "another" ] specifications specification ecmascript (ecma-262)the definition of 'symbol.split' in that specification.
SyntaxError - JavaScript
it is thrown when the javascript engine encounters tokens or token order that does not conform to the syntax of the language when parsing code.
TypeError() constructor - JavaScript
the typeerror() constructor creates a new error when an operation could not be performed, typically (but not exclusively) when a value is not of the expected type.
TypedArray.prototype.buffer - JavaScript
the value is established when the typedarray is constructed and cannot be changed.
TypedArray.prototype.byteOffset - JavaScript
the value is established when a typedarray is constructed and cannot be changed.
TypedArray.prototype.every() - JavaScript
every does not mutate the typed array on which it is called.
TypedArray.prototype.fill() - JavaScript
end index (not included).
TypedArray.prototype.join() - JavaScript
// https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join if (!uint8array.prototype.join) { object.defineproperty(uint8array.prototype, 'join', { value: array.prototype.join }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable.
TypedArray.of() - JavaScript
description some subtle distinctions between array.of() and typedarray.of(): if the this value passed to typedarray.of is not a constructor, typedarray.of will throw a typeerror, where array.of defaults to creating a new array.
TypedArray.prototype.sort() - JavaScript
let numbers = new uint8array([40, 1, 5, 200]); numbers.sort(); // uint8array [ 1, 5, 40, 200 ] // unlike plain arrays, a compare function is not required // to sort the numbers numerically.
WeakMap.prototype.clear() - JavaScript
syntax wm.clear(); examples using the clear method var wm = new weakmap(); var obj = {}; wm.set(obj, 'foo'); wm.set(window, 'bar'); wm.has(obj); // true wm.has(window); // true wm.clear(); wm.has(obj) // false wm.has(window) // false specifications not part of any standard.
WeakMap.prototype.delete() - JavaScript
false if the key is not found in the weakmap or if the key is not an object.
WeakMap.prototype.has() - JavaScript
the has() method returns a boolean indicating whether an element with the specified key exists in the weakmap object or not.
WeakRef.prototype.deref() - JavaScript
notes see the notes on weakrefs section of the weakref page for some important notes.
WeakSet.prototype.add() - JavaScript
examples using add var ws = new weakset(); ws.add(window); // add the window object to the weakset ws.has(window); // true // weakset only takes objects as arguments ws.add(1); // results in "typeerror: invalid value used in weak set" in chrome // and "typeerror: 1 is not a non-null object" in firefox specifications specification ecmascript (ecma-262)the definition of 'weakset.prototype.add' in that specification.
WeakSet.prototype.clear() - JavaScript
syntax ws.clear(); examples using the clear method var ws = new weakset(); ws.add(window); ws.has(window); // true ws.clear(); ws.has(window); // false specifications not part of any standard.
WeakSet.prototype.delete() - JavaScript
false if the key is not found in the weakmap or if the key is not an object.
WeakSet.prototype.has() - JavaScript
the has() method returns a boolean indicating whether an object exists in a weakset or not.
WebAssembly.Global - JavaScript
webassembly.instantiatestreaming(fetch('global.wasm'), { js: { global } }) .then(({instance}) => { asserteq("getting initial value from wasm", instance.exports.getglobal(), 0); global.value = 42; asserteq("getting js-updated value from wasm", instance.exports.getglobal(), 42); instance.exports.incglobal(); asserteq("getting wasm-updated value from js", global.value, 43); }); note: you can see the example running live on github; see also the source code.
WebAssembly.compileStreaming() - JavaScript
exceptions if buffersource is not a typed array, a typeerror is thrown.
decodeURIComponent() - JavaScript
examples decoding a cyrillic url component decodeuricomponent('javascript_%d1%88%d0%b5%d0%bb%d0%bb%d1%8b'); // "javascript_шеллы" catching errors try { var a = decodeuricomponent('%e0%a4%a'); } catch(e) { console.error(e); } // urierror: malformed uri sequence decoding query parameters from a url decodeuricomponent cannot be used directly to parse query parameters from a url.
globalThis - JavaScript
} with globalthis available, the additional search for the global across environments is not necessary anymore: if (typeof globalthis.settimeout !== 'function') { // no settimeout in this environment!
isFinite() - JavaScript
description isfinite is a top-level function and is not associated with any object.
Bitwise XOR (^) - JavaScript
the bitwise xor operator (^) returns a 1 in each bit position for which the corresponding bits of either but not both operands are 1s.
Less than (<) - JavaScript
strings are converted based on the values they contain, and are converted as nan if they do not contain numeric values.
Strict equality (===) - JavaScript
the most notable difference between this operator and the equality (==) operator is that if the operands are of different types, the == operator attempts to convert them to the same type before comparing.
Unsigned right shift (>>>) - JavaScript
9 (base 10): 00000000000000000000000000001001 (base 2) -------------------------------- 9 >>> 2 (base 10): 00000000000000000000000000000010 (base 2) = 2 (base 10) however, this is not the case for negative numbers.
new.target - JavaScript
normally, the left-hand side of the dot is the object on which property access is performed, but here, new is not an object.
continue - JavaScript
description in contrast to the break statement, continue does not terminate the execution of the loop entirely: instead, in a while loop, it jumps back to the condition.
while - JavaScript
note: use the break statement to stop a loop before condition evaluates to true.
background_color - Web app manifests
note: the background_color member is only meant to improve the user experience while the main stylesheet is loading from the network or the storage media; it is not used by the user agent as the background-color css property when the progressive web app stylesheet is available.
dir - Web app manifests
WebManifestdir
the dir member can be set to one of the following values: auto — text direction is determined by the user agent ltr — left to right rtl — right to left the directionality-capable members are: name short_name description note: if the value is omitted or set to auto, the browser will use the unicode bidirectional algorithm to make a best guess about the text's direction.
iarc_rating_id - Web app manifests
note: the same code can be shared across multiple participating storefronts, as long as the distributed product remains the same (i.e., doesn’t serve totally different code paths on different storefronts).
icons - Web app manifests
the purpose of this member is to allow a user agent to quickly ignore images with media types it does not support.
related_applications - Web app manifests
note: developer can specify that the native applications are preferred over the web application by setting prefer_related_applications to true.
short_name - Web app manifests
type string mandatory no the short_name member is a string that represents the name of the web application displayed to the user if there is not enough space to display name (e.g., as a label for an icon on the phone home screen).
start_url - Web app manifests
note: the start_url member is purely advisory, and a user agent may ignore it or allow the user to alter it at install time or afterwards.
Values - MathML
7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) (bug 650530) negativeveryverythinmathspace -1/18em negativeverythinmathspace -2/18em negativethinmathspace -3/18em negativemediummathspace -4/18em negativethickmathspace -5/18em negativeverythickmathspace -6/18em negativeveryverythickmathspace -7/18em note: namedspace binding is deprecated in mathml3 and has been removed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) (bug 673759).
<mi> - MathML
WebMathMLElementmi
that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography.
<mmultiscripts> - MathML
in addition you are able to use <none/> as a placeholder for empty scripts (not for the base).
<mn> - MathML
WebMathMLElementmn
that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography.
<mspace> - MathML
WebMathMLElementmspace
note that some common attributes like mathcolor, mathvariant or dir have no effect on <mspace>.
<mtable> - MathML
WebMathMLElementmtable
note: the <mtable> element resets the displaystyle attribute to false.
MathML
mathematical markup language (mathml) is a dialect of xml for describing mathematical notation and capturing both its structure and content.
Digital video concepts - Web media technologies
yuv data representation because the image is represented using more detail in greyscale than in color, the values of y', u, and v are not typically stored together, one sample per pixel, the way rgb images are stored in memory.
Media type and format guide: image, audio, and video content - Web media technologies
WebMediaFormats
web video codec guide this article provides basic information about the video codecs supported by the major browsers, as well as some that are not commonly supported but that you might still run into.
Lazy loading - Web Performance
one of the methods we can use to tackle this problem is to shorten the critical rendering path length by lazy loading resources that are not critical for the first render to happen.
Understanding latency - Web Performance
we can determine the amount of latency by measuring the speed with which the data moves from one network location to another.
Using dns-prefetch - Web Performance
you can safely use them together like so: <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin> <link 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.
PWA developer guide - Progressive web apps (PWAs)
using service workers to run offline description alerting the user using notifications description creating a web app from an existing site description advanced topics pushing data from the server to your web application some description resource management description integration with the host device description security and privacy description gaming topics for web app developers description polishing web apps web api equivalents for common nativ...
Web API reference - Web technology reference
WebReferenceAPI
network information api, web notifications.
Web technology reference
obviously, browsers do not display them, since they are used to interpret the content of the page.
SVG Conditional Processing Attributes - SVG: Scalable Vector Graphics
the svg conditional processing attributes are all the attributes that can be specified on some svg elements to control whether or not the element on which it appears should be rendered.
SVG Event Attributes - SVG: Scalable Vector Graphics
WebSVGAttributeEvents
all event attribute are not animatable.
alphabetic - SVG: Scalable Vector Graphics
only one element is using this attribute: <font-face> usage notes value <number> default value 0 animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'alphabetic' in that specification.
amplitude - SVG: Scalable Vector Graphics
four elements are using this attribute: <fefunca>, <fefuncb>, <fefuncg>, and <fefuncr> usage notes value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the definition of 'amplitude' in that specification.
arabic-form - SVG: Scalable Vector Graphics
only one element is using this attribute: <glyph> context notes value initial | medial | terminal | isolated default value isolated animatable no initial this value indicates that the glyph represents the initial form.
ascent - SVG: Scalable Vector Graphics
WebSVGAttributeascent
if the attribute is not specified, the effect is as if the attribute were set to the difference between the units-per-em value and the vert-origin-y value for the corresponding font.
attributeName - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"> <rect x="50" y="50" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="5s" repeatcount="indefinite"/> </rect> </svg> usage notes value <name> default value none animatable no <name> this value indicates the name of the css property or attribute of the target element to be animated.
attributeType - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"> <rect x="50" y="50" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="5s" repeatcount="indefinite"/> </rect> </svg> usage notes value css | xml | auto default value auto animatable no css this value specifies that the value of attributename is the name of a css property defined as animatable.
azimuth - SVG: Scalable Vector Graphics
WebSVGAttributeazimuth
<fedistantlight azimuth="0" /> </fediffuselighting> </filter> <filter id="distantlight2"> <fediffuselighting> <fedistantlight azimuth="240" /> </fediffuselighting> </filter> <circle cx="100" cy="100" r="80" style="filter: url(#distantlight1);" /> <circle cx="100" cy="100" r="80" style="filter: url(#distantlight2); transform: translatex(240px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'azimuth' in that specification.
baseFrequency - SVG: Scalable Vector Graphics
th="100%" height="100%"> <feturbulence basefrequency="0.025" /> </filter> <filter id="noise2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.05" /> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#noise1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#noise2); transform: translatex(220px);" /> </svg> usage notes value <number-optional-number> default value 0 animatable yes <number-optional-number> if two numbers are provided, the first one represents the base frequency in the horizontal direction and the second one the base frequency in the vertical direction.
bbox - SVG: Scalable Vector Graphics
WebSVGAttributebbox
only one element is using this attribute: <font-face> usage notes value <string> default value none animatable no <string> a comma-separated list of exactly four numbers specifying, in order, the lower left x, lower left y, upper right x, and upper right y of the bounding box for the complete font.
bias - SVG: Scalable Vector Graphics
WebSVGAttributebias
usage notes value <number> default value 0 animatable yes one application of bias is when it is desirable to have 0.5 gray value be the zero response of the filter.
by - SVG: Scalable Vector Graphics
WebSVGAttributeby
four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="100" height="100"> <animate attributename="width" fill="freeze" by="50" dur="3s"/> </rect> </svg> usage notes value see below default value none animatable no the exact value type for this attribute depends on the value of the attribute that will be animated.
clip-rule - SVG: Scalable Vector Graphics
/> </g> whereas the following fragment of code will not cause an evenodd clipping rule to be applied because the clip-rule is specified on the referencing element, not on the object defining the clipping shape: <g> <clippath id="myclip"> <path d="..." /> </clippath> <rect clip-path="url(#myclip)" clip-rule="evenodd" ...
clip - SVG: Scalable Vector Graphics
WebSVGAttributeclip
<svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- auto clipping --> <svg x="0" width="10" height="10" clip="auto"> <circle cx="5" cy="5" r="4" stroke="green" /> </svg> <!-- rect(top, right, bottom, left) clipping --> <svg x="10" width="10" height="10" clip="rect(1, 9, 8, 2)"> <circle cx="5" cy="5" r="4" stroke="green" /> </svg> </svg> usage notes warning: this property is deprecated.
diffuseConstant - SVG: Scalable Vector Graphics
"0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" diffuseconstant="2"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the definition of 'diffuseconstant' in that specification.
divisor - SVG: Scalable Vector Graphics
WebSVGAttributedivisor
x="1 2 0 0 0 0 0 0 -1" divisor="8"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix1);"/> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix2); transform:translatex(220px);"/> </svg> usage notes value <number> default value sum of all values in kernelmatrix or 1 if sum is 0 animatable yes <number> this value defines the divisor.
exponent - SVG: Scalable Vector Graphics
funcg type="gamma" exponent="5"/> <fefuncb type="gamma" exponent="5"/> </fecomponenttransfer> </filter> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer1);" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 1 animatable yes <number> if the type attribute of the component element is set to gamma, this value specifies the exponent of the gamma function specifications specification status comment filter effects module level 1the definition of 'exponent' in that specification.
filterUnits - SVG: Scalable Vector Graphics
only one element is using this attribute: <filter> usage notes value userspaceonuse | objectboundingbox default value objectboundingbox animatable yes userspaceonuse x, y, width and height represent values in the current coordinate system that results from taking the current user coordinate system in place at the time when the <filter> element is referenced (i.e., the user coordinate system for the element referencing the <filter> element via a filter attribute).
format - SVG: Scalable Vector Graphics
WebSVGAttributeformat
two elements are using this attribute: <altglyph> and <glyphref> context notes value <string> default value none animatable no <string> this value specifies the format of the given font.
fr - SVG: Scalable Vector Graphics
WebSVGAttributefr
lgradient id="gradient2" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="25%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> </defs> <circle cx="100" cy="100" r="100" fill="url(#gradient1)" /> <circle cx="100" cy="100" r="100" fill="url(#gradient2)" style="transform: translatex(240px);" /> </svg> usage notes value <length> default value 0 animatable none example <svg viewbox="0 0 120 120" width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgr...
from - SVG: Scalable Vector Graphics
WebSVGAttributefrom
four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" height="100"> <animate attributename="width" fill="freeze" from="100" to="150" dur="3s"/> </rect> </svg> usage notes value see below default value none animatable no the exact value type for this attribute depends on the value of the attribute that will be animated.
fx - SVG: Scalable Vector Graphics
WebSVGAttributefx
algradient id="gradient2" cx="0.5" cy="0.5" r="0.5" fx="0.75" fy="0.35" fr="5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> </defs> <circle cx="100" cy="100" r="100" fill="url(#gradient1)" /> <circle cx="100" cy="100" r="100" fill="url(#gradient2)" style="transform: translatex(240px);" /> </svg> usage notes value <length> default value coincides with the presentational value of cx for the element whether the value for cx was inherited or not.
fy - SVG: Scalable Vector Graphics
WebSVGAttributefy
algradient id="gradient2" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.75" fr="5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> </defs> <circle cx="100" cy="100" r="100" fill="url(#gradient1)" /> <circle cx="100" cy="100" r="100" fill="url(#gradient2)" style="transform: translatex(240px);" /> </svg> usage notes value <length> default value coincides with the presentational value of cy for the element whether the value for cy was inherited or not.
g1 - SVG: Scalable Vector Graphics
WebSVGAttributeg1
two elements are using this attribute: <hkern> and <vkern> context notes value <name># default value none animatable no <name># this value indicates a comma-separated sequence of glyph names (i.e., values that match glyph-name attributes on <glyph> elements) which identify a set of possible first glyphs in the kerning pair.
g2 - SVG: Scalable Vector Graphics
WebSVGAttributeg2
two elements are using this attribute: <hkern> and <vkern> context notes value <name># default value none animatable no <name># this value indicates a comma-separated sequence of glyph names (i.e., values that match glyph-name attributes on <glyph> elements) which identify a set of possible second glyphs in the kerning pair.
glyphRef - SVG: Scalable Vector Graphics
two elements are using this attribute: <altglyph> and <glyphref> usage notes value <string> default value none animatable yes <string> this value represents the glyph identifier.
gradientTransform - SVG: Scalable Vector Graphics
ansform="skewx(20) translate(-35, 0)"> <stop offset="0%" stop-color="darkblue" /> <stop offset="50%" stop-color="skyblue" /> <stop offset="100%" stop-color="darkblue" /> </radialgradient> <rect x="0" y="0" width="200" height="200" fill="url(#gradient1)" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient2)" style="transform: translatex(220px);" /> </svg> usage notes default value identity transform value <transform-list> animatable yes <transform-list> a list of transformation functions specifying some additional transformation from the gradient coordinate system onto the target coordinate system.
hanging - SVG: Scalable Vector Graphics
WebSVGAttributehanging
only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the alignment coordinate for the glyphs.
ideographic - SVG: Scalable Vector Graphics
only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the alignment coordinate for the glyphs.
intercept - SVG: Scalable Vector Graphics
pe="linear" intercept="0.1"/> <fefuncb type="linear" intercept="0.8"/> </fecomponenttransfer> </filter> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer1);" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'intercept' in that specification.
k - SVG: Scalable Vector Graphics
WebSVGAttributek
two elements are using this attribute: <hkern> and <vkern> context notes value <number> default value none animatable no <number> this value indicates the amount for decreasing the spacing between the two glyphs in the kerning pair.
k1 - SVG: Scalable Vector Graphics
WebSVGAttributek1
ator="arithmetic" k1="10" k2="0" k3="0" k4="0" /> </filter> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite1);" /> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'k1' in that specification.
k2 - SVG: Scalable Vector Graphics
WebSVGAttributek2
ator="arithmetic" k1="1" k2="10" k3="0" k4="0" /> </filter> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite1);" /> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'k2' in that specification.
k3 - SVG: Scalable Vector Graphics
WebSVGAttributek3
ator="arithmetic" k1="1" k2="0" k3="10" k4="0" /> </filter> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite1);" /> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'k3' in that specification.
k4 - SVG: Scalable Vector Graphics
WebSVGAttributek4
or="arithmetic" k1="10" k2="0" k3="0" k4="0.3" /> </filter> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite1);" /> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'k4' in that specification.
keyPoints - SVG: Scalable Vector Graphics
ightgrey" stroke-width="2" fill="none" id="motionpath"/> <circle cx="10" cy="110" r="3" fill="lightgrey"/> <circle cx="110" cy="10" r="3" fill="lightgrey"/> <circle r="5" fill="red"> <animatemotion dur="3s" repeatcount="indefinite" keypoints="0;0.5;1" keytimes="0;0.15;1" calcmode="linear"> <mpath xlink:href="#motionpath"/> </animatemotion> </circle> </svg> usage notes value <number> [; <number>]* ;?
keyTimes - SVG: Scalable Vector Graphics
120 120" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="10" r="10"> <animate attributename="cx" dur="4s" repeatcount="indefinite" values="60 ; 110 ; 60 ; 10 ; 60" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> <animate attributename="cy" dur="4s" repeatcount="indefinite" values="10 ; 60 ; 110 ; 60 ; 10" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> </circle> </svg> usage notes value <number> [ ; <number> ]* ;?
lang - SVG: Scalable Vector Graphics
WebSVGAttributelang
<svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <text lang="en-us">this is some english text</text> </svg> usage notes value <language-tag> default value none animatable no <language-tag> this value specifies the language used for the element.
lengthAdjust - SVG: Scalable Vector Graphics
</text> </g> </svg> usage notes value spacing | spacingandglyphs default value spacing animatable yes specifications specification status comment scalable vector graphics (svg) 2the definition of 'lengthadjust' in that specification.
lighting-color - SVG: Scalable Vector Graphics
" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" lighting-color="blue"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting2); transform: translatex(220px);" /> </svg> usage notes value color default value white animatable yes specifications specification status comment filter effects module level 1the definition of 'lighting-color' in that specification.
limitingConeAngle - SVG: Scalable Vector Graphics
="100%"> <fediffuselighting diffuseconstant="2"> <fespotlight x="10" y="10" z="50" pointsatx="100" pointsaty="100" limitingconeangle="40" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#spotlight1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#spotlight2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'limitingconeangle' in that specification.
markerHeight - SVG: Scalable Vector Graphics
only one element is using this attribute: <marker> usage notes value <length-percentage> | <number> default value 3 animatable yes <length-percentage> this value defines either an absolute or a relative height of the marker.
markerUnits - SVG: Scalable Vector Graphics
usage notes value userspaceonuse | strokewidth default value strokewidth animatable yes userspaceonuse this value specifies that the markerwidth and markerunits attributes and the contents of the <marker> element represent values in the current user coordinate system in place for the graphic object referencing the marker (i.e., the user coordinate system for the element referencing the <marker> element via a marker, marker-start, marker-mid, or marker-end property).
markerWidth - SVG: Scalable Vector Graphics
only one element is using this attribute: <marker> usage notes value <length-percentage> | <number> default value 3 animatable yes <length-percentage> this value defines either an absolute or a relative width of the marker.
mathematical - SVG: Scalable Vector Graphics
only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the alignment coordinate for the glyphs.
max - SVG: Scalable Vector Graphics
WebSVGAttributemax
tp://www.w3.org/2000/svg"> <circle cx="60" cy="10" r="10"> <animate attributename="cx" dur="4s" max="6s" repeatcount="indefinite" values="60 ; 110 ; 60 ; 10 ; 60" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> <animate attributename="cy" dur="4s" max="6s" repeatcount="indefinite" values="10 ; 60 ; 110 ; 60 ; 10" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> </circle> </svg> usage notes value <clock-value> default value none animatable no <clock-value> specifies the length of the maximum value of the active duration, measured in local time.
min - SVG: Scalable Vector Graphics
WebSVGAttributemin
tp://www.w3.org/2000/svg"> <circle cx="60" cy="10" r="10"> <animate attributename="cx" dur="4s" min="2s" repeatcount="indefinite" values="60 ; 110 ; 60 ; 10 ; 60" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> <animate attributename="cy" dur="4s" min="2s" repeatcount="indefinite" values="10 ; 60 ; 110 ; 60 ; 10" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> </circle> </svg> usage notes value <clock-value> default value 0 animatable no <clock-value> specifies the length of the minimum value of the active duration, measured in local time.
mode - SVG: Scalable Vector Graphics
WebSVGAttributemode
rcegraphic" in2="floodfill" mode="color-dodge"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#blending1);"/> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#blending2); transform:translatex(220px);"/> </svg> usage notes value <blend-mode> default value normal animatable yes for a description of the values, see <blend-mode>.
numOctaves - SVG: Scalable Vector Graphics
eturbulence basefrequency="0.025" numoctaves="1" /> </filter> <filter id="noise2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" numoctaves="3" /> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#noise1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#noise2); transform: translatex(220px);" /> </svg> usage notes value <integer> default value 1 animatable yes <integer> defines the number of octaves.
onclick - SVG: Scalable Vector Graphics
WebSVGAttributeonclick
ern>, <polygon>, <polyline>, <radialgradient>, <rect>, <script>, <set>, <stop>, <style>, <svg>, <switch>, <symbol>, <text>, <textpath>, <title>, <tref>, <tspan>, <use>, <view> html, body, svg { height: 100%; margin: 0; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <circle cx="100" cy="100" r="100" onclick="alert('you have clicked the circle.')" /> </svg> usage notes value <anything> default value none animatable no specifications specification status comment scalable vector graphics (svg) 2the definition of 'onclick' in that specification.
operator - SVG: Scalable Vector Graphics
the parts of the destination graphic that do not overlap with the source graphic stay untouched.
orientation - SVG: Scalable Vector Graphics
only one element is using this attribute: <glyph> usage notes value h | v default value none (meaning glyph can be used for both text directions) animatable yes h this value indicates that the glyph is only used for a horizontal text direction.
origin - SVG: Scalable Vector Graphics
WebSVGAttributeorigin
only one element is using this attribute: <animatemotion> context notes value default default value default animatable no specifications specification status comment svg animations level 2the definition of 'origin' in that specification.
panose-1 - SVG: Scalable Vector Graphics
only one element is using this attribute: <font-face> usage notes value <integer>{10} default value 0 0 0 0 0 0 0 0 0 0 animatable no <integer>{10} this value specifies a panose-1 number and consists of ten decimal integers, separated by whitespace.
patternTransform - SVG: Scalable Vector Graphics
note: as of svg2, it is also allowed to use the css transform property.
pointsAtX - SVG: Scalable Vector Graphics
lighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fespotlight x="60" y="60" z="50" pointsatx="400" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting2); transform: translatex(220px);" /> </svg> usage notes default value 0 value <number> animatable yes specifications specification status comment filter effects module level 1the definition of 'pointsatx' in that specification.
pointsAtY - SVG: Scalable Vector Graphics
lighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fespotlight x="60" y="60" z="50" pointsaty="400" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting2); transform: translatex(220px);" /> </svg> usage notes default value 0 value <number> animatable yes specifications specification status comment filter effects module level 1the definition of 'pointsaty' in that specification.
pointsAtZ - SVG: Scalable Vector Graphics
ighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fespotlight x="100" y="100" z="50" pointsatz="80" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting2); transform: translatex(220px);" /> </svg> usage notes default value 0 value <number> animatable yes specifications specification status comment filter effects module level 1the definition of 'pointsatz' in that specification.
preserveAlpha - SVG: Scalable Vector Graphics
0 0 0 0 -2" preservealpha="false"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix1);"/> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix2); transform:translatex(220px);"/> </svg> usage notes default value false value true | false animatable yes true this value indicates that the convolution will only apply to the color channels.
primitiveUnits - SVG: Scalable Vector Graphics
only one element is using this attribute: <filter> usage notes value userspaceonuse | objectboundingbox default value userspaceonuse animatable yes userspaceonuse this value indicates that any length values within the filter definitions represent values in the current user coordinate system in place at the time when the <filter> element is referenced (i.e., the user coordinate system for the element referencing the <filter> element via a filter attribute).
r - SVG: Scalable Vector Graphics
WebSVGAttributer
value <length> | <percentage> default value 0 animatable yes note: starting with svg2, r is a geometry property meaning this attribute can also be used as a css property for circles.
radius - SVG: Scalable Vector Graphics
WebSVGAttributeradius
usage notes value <number-optional-number> default value 0 animatable yes specifications specification status comment filter effects module level 1the definition of 'radius' in that specification.
repeatCount - SVG: Scalable Vector Graphics
box="0 0 220 150" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="5"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="indefinite"/> </rect> </svg> usage notes value <number> | indefinite default value none animatable no <number> this value specifies the number of iterations.
repeatDur - SVG: Scalable Vector Graphics
iewbox="0 0 220 150" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatdur="5s"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatdur="indefinite"/> </rect> </svg> usage notes value <clock-value> | indefinite default values none animatable no <clock-value> this value specifies the duration in presentation time to repeat the animation.
result - SVG: Scalable Vector Graphics
WebSVGAttributeresult
p://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> usage notes value <filter-primitive-reference> default value none animatable yes <filter-primitive-reference> this value is a <custom-ident> and defines the name for the filter primitive.
scale - SVG: Scalable Vector Graphics
WebSVGAttributescale
ight="140%"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50"/> </filter> <circle cx="100" cy="100" r="80" style="filter: url(#displacementfilter);""/> <circle cx="100" cy="100" r="80" style="filter: url(#displacementfilter2); transform: translatex(240px);""/> </svg> usage notes value <number> default value none animatable yes <number> this value defines the scale factor for the displacement.
seed - SVG: Scalable Vector Graphics
WebSVGAttributeseed
00%"> <feturbulence basefrequency="0.025" seed="0" /> </filter> <filter id="noise2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" seed="100" /> </filter> <rect x="0" y="0" width="200" height="200" style="filter:url(#noise1);" /> <rect x="0" y="0" width="200" height="200" style="filter:url(#noise2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes example <svg width="200" height="200" viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feturbulence basefrequency="0.05" seed="1000" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelsel...
side - SVG: Scalable Vector Graphics
WebSVGAttributeside
w3.org/2000/svg"> <text> <textpath href="#circle1" side="left">text left from the path</textpath> </text> <text> <textpath href="#circle2" side="right">text right from the path</textpath> </text> <circle id="circle1" cx="100" cy="100" r="70" fill="transparent" stroke="silver"/> <circle id="circle2" cx="320" cy="100" r="70" fill="transparent" stroke="silver"/> </svg> usage notes value left | right default value left animatable yes left this value places the text on the left side of the path (relative to the path direction).
slope - SVG: Scalable Vector Graphics
WebSVGAttributeslope
only one element is using this attribute: <font-face> usage notes value <number> default value 0 animatable no <number> this value indicates the vertical stroke angle of the font.
spacing - SVG: Scalable Vector Graphics
WebSVGAttributespacing
only one element is using this attribute: <textpath> usage notes value auto | exact default value exact animatable yes auto this value indicates that the user agent should use text-on-a-path layout algorithms to adjust the spacing between typographic characters in order to achieve visually appealing results.
specularConstant - SVG: Scalable Vector Graphics
0%" height="100%"> <fespecularlighting in="sourcegraphic" specularconstant="0.8"> <fepointlight x="60" y="60" z="20" /> </fespecularlighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#specularlighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#specularlighting2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the definition of 'specularconstant' in that specification.
stdDeviation - SVG: Scalable Vector Graphics
"-30%" y="-30%" width="160%" height="160%"> <fegaussianblur stddeviation="10" /> </filter> <circle cx="100" cy="100" r="50" style="filter: url(#gaussianblur1);" /> <circle cx="100" cy="100" r="50" style="filter: url(#gaussianblur2); transform: translatex(140px);" /> <circle cx="100" cy="100" r="50" style="filter: url(#gaussianblur3); transform: translatex(280px);" /> </svg> usage notes value <number-optional-number> default value 0 animatable yes <number-optional-number> if two numbers are provided, the first number represents a standard deviation value along the x-axis.
stemh - SVG: Scalable Vector Graphics
WebSVGAttributestemh
only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the horizontal stem width of the font.
stitchTiles - SVG: Scalable Vector Graphics
noise2); transform: translate(220px, 0);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise2); transform: translate(320px, 0);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise2); transform: translate(220px, 100px);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise2); transform: translate(320px, 100px);" /> </svg> usage notes value nostitch | stitch default value nostitch animatable yes nostitch this value indicates that no attempt is made to achieve smooth transitions at the border of tiles which contain a turbulence function.
string - SVG: Scalable Vector Graphics
WebSVGAttributestring
only one element is using this attribute: <font-face-format> usage notes value <anything> default value none animatable no <anything> this value specifies a list of formats that are supported by the font referenced by the parent <font-face-uri> element.
stroke-miterlimit - SVG: Scalable Vector Graphics
note: as a presentation attribute stroke-miterlimit can be used as a css property.
stroke-width - SVG: Scalable Vector Graphics
00% } <svg viewbox="0 0 30 10" xmlns="http://www.w3.org/2000/svg"> <!-- default stroke width: 1 --> <circle cx="5" cy="5" r="3" stroke="green" /> <!-- stroke width as a number --> <circle cx="15" cy="5" r="3" stroke="green" stroke-width="3" /> <!-- stroke width as a percentage --> <circle cx="25" cy="5" r="3" stroke="green" stroke-width="2%" /> </svg> usage notes value <length> | <percentage> default value 1px animatable yes note: a percentage value is always computed as a percentage of the normalized viewbox diagonal length.
tabindex - SVG: Scalable Vector Graphics
html, body, svg { height: 100%; } <?xml version="1.0"?> <svg viewbox="0 0 260 260" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="60" r="15" tabindex="1" /> <circle cx="60" cy="160" r="30" tabindex="3" /> <circle cx="160" cy="60" r="30" tabindex="2" /> <circle cx="160" cy="160" r="60" tabindex="4" /> </svg> usage notes value valid integer default value none animatable no valid integer relative order of the element for the purposes of sequential focus navigation.
tableValues - SVG: Scalable Vector Graphics
="table" tablevalues="1 0"/> <fefuncb type="table" tablevalues="1 0"/> </fecomponenttransfer> </filter> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer1);" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer2); transform: translatex(220px);" /> </svg> usage notes value <list-of-numbers> default value empty list resulting in identity transfer animatable yes <list-of-numbers> this value holds a comma- and/or space-separated list of <number>s, which define a lookup table for the color component transfer function.
targetX - SVG: Scalable Vector Graphics
WebSVGAttributetargetX
only one element is using this attribute: <feconvolvematrix> usage notes value <integer> default value floor(orderx / 2) animatable yes <integer> this value indicates the positioning in horizontal direction of the convolution matrix relative to a given target pixel in the input image.
targetY - SVG: Scalable Vector Graphics
WebSVGAttributetargetY
only one element is using this attribute: <feconvolvematrix> usage notes value <integer> default value floor(ordery / 2) animatable yes <integer> this value indicates the positioning in vertical direction of the convolution matrix relative to a given target pixel in the input image.
u1 - SVG: Scalable Vector Graphics
WebSVGAttributeu1
two elements are using this attribute: <hkern> and <vkern> context notes value [ <character> | <urange> ]# default value none animatable no [ <character> | <urange> ]# this value indicates a comma-separated sequence of unicode characters and/or ranges of unicode characters, which identify a set of possible first glyphs in a kerning pair.
u2 - SVG: Scalable Vector Graphics
WebSVGAttributeu2
two elements are using this attribute: <hkern> and <vkern> context notes value [ <character> | <urange> ]# default value none animatable no [ <character> | <urange> ]# this value indicates a comma-separated sequence of unicode characters and/or ranges of unicode characters, which identify a set of possible second glyphs in a kerning pair.
unicode-range - SVG: Scalable Vector Graphics
only one element is using this attribute: <font-face> usage notes value <urange># default value none animatable no <urange># this value is a comma-separated list of iso 10646 characters possibly covered by the glyphs in the font.
v-alphabetic - SVG: Scalable Vector Graphics
only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'v-alphabetic' in that specification.
v-hanging - SVG: Scalable Vector Graphics
only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the alignment coordinate for the glyphs to achieve hanging baseline alignment.
v-ideographic - SVG: Scalable Vector Graphics
only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the alignment coordinate for the glyphs.
v-mathematical - SVG: Scalable Vector Graphics
only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the alignment coordinate for the glyphs.
values - SVG: Scalable Vector Graphics
WebSVGAttributevalues
for type="luminancetoalpha", values is not applicable.
version - SVG: Scalable Vector Graphics
WebSVGAttributeversion
<svg version="1.1" viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="80" height="80"/> </svg> usage notes value <number> default value none animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'version' in that specification.
vert-origin-x - SVG: Scalable Vector Graphics
only one element is using this attribute: <font> usage notes value <number> default value half of horiz-adv-x value animatable no <number> this value indicates the x-coordinate of the origin of a glyph for vertically oriented text.
vert-origin-y - SVG: Scalable Vector Graphics
only one element is using this attribute: <font> usage notes value <number> default value ascent value animatable no <number> this value indicates the y-coordinate of the origin of a glyph for vertically oriented text.
viewTarget - SVG: Scalable Vector Graphics
only one element is using this attribute: <view> usage notes value <xml-name> default value none animatable no <xml-name> this value specifies the name of the object associated with the view.
x-height - SVG: Scalable Vector Graphics
only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the height of lowercase glyphs.
xChannelSelector - SVG: Scalable Vector Graphics
vg" x="0" y="0" width="100%" height="100%" result="abc"/> <fedisplacementmap in2="abc" in="sourcegraphic" scale="30" xchannelselector="b"/> </filter> <text x="10" y="60" font-size="50" filter="url(#displacementfilter)">some displaced text</text> <text x="10" y="120" font-size="50" filter="url(#displacementfilter2)">some displaced text</text> </svg> usage notes value r | g | b | a default value a animatable yes r this keyword specifies that the red color channel of the input image defined in in2 will be used to displace the pixels of the input image defined in in along the x-axis.
xlink:show - SVG: Scalable Vector Graphics
only one element is using this attribute: <a> usage notes value new | replace | embed | other | none default value replace animatable no new this value specifies that the referenced resource is opened in a new window or tab.
xlink:title - SVG: Scalable Vector Graphics
note: new content should use a <title> child element rather than a xlink:title attribute.
xlink:type - SVG: Scalable Vector Graphics
twentytwo elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, and <use> usage notes value simple default value simple animatable no simple this value specifies that the referred resource is a simple link.
xml:base - SVG: Scalable Vector Graphics
usage notes value <iri> default value none animatable no <iri> this value specifies the base iri of the element.
xml:lang - SVG: Scalable Vector Graphics
<svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <text xml:lang="en-us">this is some english text</text> </svg> usage notes value <language-tag> default value none animatable no <language-tag> this value specifies the language used for the element.
yChannelSelector - SVG: Scalable Vector Graphics
vg" x="0" y="0" width="100%" height="100%" result="abc"/> <fedisplacementmap in2="abc" in="sourcegraphic" scale="30" ychannelselector="b"/> </filter> <text x="10" y="60" font-size="50" filter="url(#displacementfilter)">some displaced text</text> <text x="10" y="120" font-size="50" filter="url(#displacementfilter2)">some displaced text</text> </svg> usage notes value r | g | b | a default value a animatable yes r this keyword specifies that the red color channel of the input image defined in in2 will be used to displace the pixels of the input image defined in in along the y-axis.
zoomAndPan - SVG: Scalable Vector Graphics
<svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" zoomandpan="disable"> <filter id="diffuselighting" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" zoomandpan="1"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting);" /> </svg> usage notes value disable | magnify default value magnify animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'zoomandpan' in that specification.
SVG Attribute reference - SVG: Scalable Vector Graphics
WebSVGAttribute
xlink attributes xlink:href, xlink:type, xlink:role, xlink:arcrole, xlink:title, xlink:show, xlink:actuate presentation attributes note that all svg presentation attributes can be used as css properties.
Compatibility sources - SVG: Scalable Vector Graphics
orded 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 ...
<altGlyph> - SVG: Scalable Vector Graphics
WebSVGElementaltGlyph
value type: <iri> ; default value: none; animatable: no global attributes core attributes most notably: id lang styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, document element event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, fill, fill-opacity...
<animate> - SVG: Scalable Vector Graphics
WebSVGElementanimate
.org/2000/svg"> <rect width="10" height="10"> <animate attributename="rx" values="0;5;0" dur="10s" repeatcount="indefinite" /> </rect> </svg> attributes animation attributes animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill animation value attributes calcmode, values, keytimes, keysplines, from, to, by other animation attributes most notably: attributename, additive, accumulate animation event attributes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes this element implements the svganimateelement interface.
<animateColor> - SVG: Scalable Vector Graphics
it provides no features not already available by using the <animate> element.
<discard> - SVG: Scalable Vector Graphics
WebSVGElementdiscard
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.
<feColorMatrix> - SVG: Scalable Vector Graphics
an identity matrix looks like this: r g b a w r' | 1 0 0 0 0 | g' | 0 1 0 0 0 | b' | 0 0 1 0 0 | a' | 0 0 0 1 0 | in it, every new value is exactly 1 times its old value, with nothing else added.
<feConvolveMatrix> - SVG: Scalable Vector Graphics
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.
<feDropShadow> - SVG: Scalable Vector Graphics
value type: <number>; default value: 2; animatable: yes global attributes core attributes most notably: id styling attributes class, style filter primitive attributes height, in, result, x, y, width presentation attributes most notably: flood-color, flood-opacity usage notes categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <script>, <set> specifications specification status comment filter eff...
<feMergeNode> - SVG: Scalable Vector Graphics
the femergenode takes the result of another filter to be processed by its parent <femerge>.
<script> - SVG: Scalable Vector Graphics
WebSVGElementscript
value type: <url> ; default value: none; animatable: no global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesnonepermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<script>' in that specification.
<stop> - SVG: Scalable Vector Graphics
WebSVGElementstop
value type: <opacity>; default value: 1; animatable: yes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes presentation attributes most notably: color, display, stop-color, stop-opacity, visibility usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:<animate>, <animatecolor>, <set> specifications specification s...
<style> - SVG: Scalable Vector Graphics
WebSVGElementstyle
value type: <string>; default value: none; animatable: no global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesnonepermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<style>' in that specification.
SVG element reference - SVG: Scalable Vector Graphics
WebSVGElement
altglyphitem>, <glyph>, <glyphref>, <textpath>, <text>, <tref>, <tspan> text content child elements <altglyph>, <textpath>, <tref>, <tspan> uncategorized elements <clippath>, <color-profile>, <cursor>, <filter>, <foreignobject>, <hatchpath>, <meshpatch>, <meshrow>, <script>, <style>, <view> obsolete and deprecated elements warning: these are old svg elements which are deprecated and should not be used.
Linking - SVG: Scalable Vector Graphics
WebSVGLinking
however, target does not work with mozilla's implementation of the svg <a> element in firefox 1.5.
Example - SVG: Scalable Vector Graphics
// warning: pseudo-physics -- not really // governed by any /real/ physical principles.
Other Resources - SVG: Scalable Vector Graphics
here is a list of additional resources on svg: mozilla svg resources svg.org svgbasics tutorials w3c svg homepage svg wiki http://wiki.svg.org/index.php?title=..._configuration i moved this from the other resources category, not sure why it's in other resources -nickolay http://developer.mozilla.org/en/docs...%28external%29 ...
SVG animation with SMIL - SVG: Scalable Vector Graphics
this new element is necessary because we are not animating a simple attribute like x which is just a number.
SVG Filters Tutorial - SVG: Scalable Vector Graphics
svg filter example <defs> <filter id="drop-shadow"> <fegaussianblur in="sourcealpha" stddeviation="3"/> </filter> </defs> <g id="ghost" style="filter: url(#drop-shadow);"/> <!--ghost drawing in here--> </g> this above example will not produced the desired output.
Texts - SVG: Scalable Vector Graphics
WebSVGTutorialTexts
it must be a child of a text element or another tspan element.
SVG Tutorial - SVG: Scalable Vector Graphics
WebSVGTutorial
another good introduction to svg is provided by the w3c's svg primer.
Referer header: privacy and security concerns - Web security
even if security is not compromised, the information may not be something the user wants shared.
Tutorials
now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another.
HTML Imports - Web Components
firefox will not ship html imports in its current form.
XML Index - XML: Extensible Markup Language
WebXMLIndex
this means, unlike other markup languages, xml is not predefined so you must define your own tags.
xml:base - XML: Extensible Markup Language
WebXMLxml:base
ily: zapfdingbats_ghr; fill: #161615; } ]]></style> <text x="647" y="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.
XML: Extensible Markup Language
WebXML
this means, unlike other markup languages, xml is not predefined so you must define your own tags.
descendant-or-self - XPath
attribute and namespace nodes are not included - the parent of an attribute node is an element node, but attribute nodes are not the children of their parents.
descendant - XPath
WebXPathAxesdescendant
attribute and namespace nodes are not included - the parent of an attribute node is an element node, but attribute nodes are not the children of their parents.
namespace - XPath
WebXPathAxesnamespace
(not supported) the namespace axis indicates all the nodes that are in scope for the context node.
boolean - XPath
notes a number evaluates to false if it is positive or negative zero or nan.
false - XPath
WebXPathFunctionsfalse
notes this function is useful part of a comparison: <xsl:if test="boolean((1 &gt; 2) = false())"> the expression evaluates as true </xsl:if> defined xpath 1.0 4.3 gecko support supported.
id - XPath
WebXPathFunctionsid
notes the dtd of the xml document determines what attribute is an id.
last - XPath
WebXPathFunctionslast
notes this is often used with the position() function to determine if a particular node is the last in a node-set.
local-name - XPath
notes the local name is the local part of an expanded-name.
name - XPath
WebXPathFunctionsname
notes the qname is the node's qualified name, including its namespace prefix and its local name.
namespace-uri - XPath
notes if the given node does not have a specified namespace, the returned string will be an empty string.
position - XPath
notes note that a node's position in a context is not zero-based.
round - XPath
WebXPathFunctionsround
notes -0.5 rounds to negative zero.
string - XPath
returns a string notes if the object is a node-set, the string value of the first node in the set is returned.
sum - XPath
WebXPathFunctionssum
notes (none) defined xpath 1.0 4.3 gecko support supported.
system-property - XPath
notes xsl:version, a number giving the version of xslt implemented by the processor; for xslt processors implementing the version of xslt specified by this document, this is the number 1.0 xsl:vendor, a string identifying the vendor of the xslt processor xsl:vendor-url, a string containing a url identifying the vendor of the xslt processor; typically this is the host page (home page) of the vend...
Common XSLT Errors - XSLT: Extensible Stylesheet Language Transformations
missing features there are some features in the xslt 1.0 specification which firefox unfortunately does not yet support.
<xsl:apply-templates> - XSLT: Extensible Stylesheet Language Transformations
if this attribute is not set, all child nodes of the current node are selected.
<xsl:attribute-set> - XSLT: Extensible Stylesheet Language Transformations
the names of the contributing sets must be separated with whitespace characters and must not directly or indirectly embed themselves.
<xsl:attribute> - XSLT: Extensible Stylesheet Language Transformations
you cannot set the related namespace prefix with this element.
<xsl:copy> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementcopy
it does not copy any children or attributes of the current node.
<xsl:decimal-format> - XSLT: Extensible Stylesheet Language Transformations
nan specifies the string used when the value is not a number.
<xsl:if> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementif
if the value is true, the template is processed; if it is not, no action is taken.
<xsl:import> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementimport
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:import> element is a top-level element that serves to import the contents of one stylesheet into another stylesheet.
<xsl:include> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementinclude
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:include> element merges the contents of one stylesheet with another.
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
however, the value needs to be an xpath expression and not a string, so {$myorder} is used.
Introduction - XSLT: Extensible Stylesheet Language Transformations
they are not available in netscape 7.0x however are available in netscape 7.1.
Exported WebAssembly functions - WebAssembly
it is worth noting that these are real javascript functions, in addition to being wrappers for webassembly functions.