Search completed in 1.37 seconds.
Cached compose window FAQ
seth spitzer (sspitzer@mozilla.org) what is the "cached" com
pose window?
... instead of destroying the mail com
pose window on send (or close) just to create a new one the next time, mozilla mail will "cache" the com
pose window on send (or close), and use that instead.
... back 0.9.7, we hit a wall with the com
pose window.
...And 17 more matches
XRViewerPose - Web APIs
the webxr device api interface xrviewer
pose represents the
pose (the position and orientation) of a viewer's point of view on the scene.
... each xrviewer
pose can have multiple views to represent, for example, the slight separation between the left and right eye.
... properties in addition to the properties inherited from xr
pose, xrviewer
pose includes the following: views read only an array of xrview objects, one for each viewpoint on the scene which is needed to represent the scene to the user.
...And 12 more matches
Event.composed - Web APIs
the read-only com
posed 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.
... syntax const iscom
posed = event.com
posed; value a boolean which is true if the event will cross from the shadow dom into the standard dom after reaching the shadow root.
... (that is, the first node in the shadow dom in which the event began to propagate.) all ua-dispatched ui events are com
posed (click/touch/mouseover/copy/paste, etc.).
...And 10 more matches
Event.composedPath() - Web APIs
the com
posedpath() method of the event interface returns the event’s path which is an array of the objects on which listeners will be invoked.
... syntax var com
posed = event.com
posedpath(); parameters none.
... examples in our com
posed-com
posed-path example (see it live), we define two trivial custom elements, <open-shadow> and <closed-shadow>, both of which take the contents of their text attribute and insert them into the element's shadow dom as the text content of a <p> element.
...And 5 more matches
XRFrame.getViewerPose() - Web APIs
the getviewer
pose() method, a member of the xrframe interface, returns a xrviewer
pose object which describes the viewer's
pose (position and orientation) relative to the specified reference space.
... see the get
pose() method for a way to calculate a
pose that represents the difference between two spaces.
... syntax var xrviewer
pose = xrframe.getviewer
pose(referencespace); parameters referencespace an xrreferencespace object specifying the space to use as the reference point or base for the computation of the viewer's current
pose.
...And 5 more matches
XRPose - Web APIs
xr
pose is a webxr api interface representing a position and orientation in the 3d space, relative to the xrspace within which it resides.
... the xrspace—which is either an xrreferencespace or an xrboundedreferencespace—defines the coordinate system used for the
pose and, in the case of an xrviewer
pose, its underlying views.
... to obtain the xr
pose for the xrspace used as the local coordinate system of an object, call xrframe.get
pose(), specifying that local xrspace and the space to which you wish to convert: the
pose = xrframe.get
pose(localspace, basespace); the
pose for a viewer (or camera) is represented by the xrviewer
pose subclass of xr
pose.
...And 4 more matches
XRViewerPose.views - Web APIs
the read-only xrviewer
pose property views returns an array which contains every xrview which must be rendered in order to fully represent the scene from the viewpoint defined by the viewer
pose.
... syntax let viewlist = xrviewer
pose.views; value an array of xrview objects, one for each view available as part of the scene for the current viewer
pose.
... examples in this example—part of the code to render an xrframe, getviewer
pose() is called to get an xrviewer
pose using the same reference space the code is using as its base reference space.
...And 3 more matches
Access-Control-Expose-Headers - HTTP
the access-control-ex
pose-headers response header indicates which headers can be ex
posed as part of the response by listing their names.
... by default, only the 7 cors-safelisted response headers are ex
posed: cache-control content-language content-length content-type expires last-modified pragma if you want clients to be able to access other headers, you have to list them using the access-control-ex
pose-headers header.
... header type response header forbidden header name no syntax access-control-ex
pose-headers: <header-name>, <header-name>, ...
...And 3 more matches
XRFrame.getPose() - Web APIs
the xrframe method get
pose() returns the relative position and orientation—the
pose—of one xrspace to that of another space.
... syntax var xr
pose = xrframe.get
pose(space, basespace); parameters space an xrspace specifying the space for which to obtain an xr
pose describing the item's position and orientation.
... basespace an xrspace to use as the base or origin for the pur
poses of computing the relative position and orientation.
...And 2 more matches
XRPose.transform - Web APIs
the transform read-only attribute of the xr
pose interface is a xrrigidtransform object providing the position and orientation of the
pose relative to the base xrspace as specified when the
pose was obtained by calling xrframe.get
pose().
... syntax let
posetransform = xr
pose.transform; value an xrrigidtransform which provides the position and orientation of the xr
pose relative to the xrframe to which this xr
pose is aligned.
... this is the same
pose that's returned by the frame's get
pose() method.
...And 2 more matches
XRPose.emulatedPosition - Web APIs
the emulatedposition read-only attribute of the xr
pose 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.
... syntax let emulated = xr
pose.emulatedposition; value a boolean which is true if the
pose's position is computed based on estimates or is derived from sources other than direct sensor data.
... specifications specification status comment webxr device apithe definition of 'xr
pose.emulatedposition' in that specification.
Index - Web APIs
a timeline is a source of time values for synchronization pur
poses, and is an animationtimeline-based object.
... 228 baseaudiocontext.createanalyser() api, audiocontext, baseaudiocontext, method, reference, web audio api, createanalyser the createanalyser() method of the baseaudiocontext interface creates an analysernode, which can be used to ex
pose audio time and frequency data and create data visualisations.
... 357 body.body api, body, experimental, fetch, property, reference, streams the body read-only property of the body mixin is a simple getter used to ex
pose a readablestream of the body contents.
...And 67 more matches
WebIDL bindings
adding webidl bindings to a class to add a webidl binding for interface myinterface to a class mozilla::dom::myinterface that's sup
posed to implement that interface, you need to do the following: if your interface doesn't inherit from any other interfaces, inherit from nswrappercache and hook up the class to the cycle collector so it will trace the wrapper cache properly.
...returning null from getparentobject is allowed in situations in which it's ok to associate the resulting object with a random global object for security pur
poses; this is not usually ok for things that are ex
posed to web content.
... ex
pose whatever methods the interface needs on mozilla::dom::myinterface.
...And 25 more matches
Embedding the editor
note here that i use the term 'com
poser' to mean an html-savvy com
pose widget that does rich text editing, and 'editor' to mean a plain text editor (as well as the underlying technology for com
poser).
...com
poser embedded in a xul application developers need to embed com
poser widgets in their xul applications, by using the <editor> tag as we do today.
...com
poser embedded in a native application in this application, the <iframe> on which the editor lives is embedded directly in the native application; this is equivalent to embedding the browser via nsiwebbrowser, but instead having an editable document.
...And 24 more matches
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
poses once your reference space or spaces are established for the various key objects in the scene, you will have times when you need to describe another position relative to the origin of a particular reference space.
... this is done using
poses.
... a
pose, simply put, describes a position and orientation relative to the origin of the reference space from which it was created.
...And 22 more matches
Index - Archive of obsolete content
46 indexed-db add-on sdk ex
poses the indexeddb api to add-ons.
... 507 enabling the pro
posed method for accessing jetpack features that are still in development and may be added in the future is inspired by python's future module.
... in python, you can call 508 enabling experimental jetpack features the pro
posed method for accessing jetpack features that are still in development and may be added in the future is inspired by python's future module.
...And 19 more matches
PKCS #11 Netscape Trust Objects - Network Security Services
trust objects a trust object describes a level of trust in a certificate for a given usage or pur
pose.
... conceptually a trust object contains the following: certificate reference pur
pose + level of trust (multiple) pur
pose + level of trust a trust object ultimately denotes a level of trust in a certificate.
... the trust is expressed for a specific pur
pose (or usage).
...And 17 more matches
Architecture - Accessibility
mozilla ex
poses a document containment hierarchy with text and embedded objects.
...however in accessibility hierarchies such as atk and iaccessible2, text is not ex
posed in leaf nodes as it is in a w3c dom.
... the text is actually ex
posed via a special text interface in the parent of the text nodes.
...And 14 more matches
Key Values - Web APIs
gdk_key_codeinput (0xff37) qt::key_codeinput (0x01001137) "com
pose" the com
pose key.
...enables single candidate mode (as op
posed to multi-candidate mode); in this mode, only one candidate is displayed at a time.
... gdk_key_singlecandidate (0xff3c) qt::key_singlecandidate (0x0100113c) [1] on the x window system, the com
pose key is called the multi key.
...And 13 more matches
Inputs and input sources - Web APIs
you can easily obtain the target ray corresponding to the targetrayspace from within the drawing handler for a given frame using xrframe's get
pose() method.
... the returned xr
pose's transform is the transform corresponding to the target ray.
... thus, for an input controller primaryinput: let targetray
pose = frame.session.get
pose(primaryinput.targetrayspace, viewerrefspace); let targetrayorigin = targetray
pose.transform.position; let targetrayvector = targetray
pose.transform.orientation; with this, you now have the point from which the targeting ray is emitted (targetrayorigin) and the direction in which it's pointing (targetrayvector), given in the viewer's reference space (viewerrefspace).
...And 13 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
5 api codingscripting, glossary, infrastructure an api (application programming interface) is a set of features and rules that exist inside a software program (the application) enabling interaction with it through software - as op
posed to a human user interface.
... 7 arpa glossary, infrastructure .arpa (address and routing parameter area) is a top-level domain used for internet infrastructure pur
poses, especially reverse dns lookup (i.e., find the domain name for a given ip address).
... 41 brotli brotli, glossary, reference, web performance, compression brotli is a general-pur
pose lossless compression algorithm.
...And 11 more matches
Gecko info for Windows accessibility vendors
dom: document object model this is the w3c's specification for how web content is ex
posed to javascript and other languages.
... anything that is focusable or conveys important information about the structure of the document is ex
posed in the msaa tree of iaccessibles.
... document structure ex
posed in msaa tree bstr roles are used for important roles that have not been defined by microsoft.
...And 11 more matches
Rendering and the WebXR frame animation callback - Web APIs
this is due to early displays using the ac electrical grid's current flow waveform, which cycles 60 times per second in the united states (50 in europe), for timing pur
poses.
...while this diagram exaggerates the effect in some respects for illustrative pur
poses, the concept is the same.
... frames,
poses, views, and framebuffers once you have an xrframe representing the state of the scene at a moment in time, you need to determine the positions of objects within the scene relative to the viewer so that you can render them.
...And 11 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
msaa is sup
posed to be the "right way" for accessibility aids to get information, but sometimes the hacks are more effective.
... msaa provides information in several different ways: a com interface (iaccessible) that allows applications to ex
pose the tree of data nodes that make up each window in the user interface currently being interacted with and custom interface extensions via interfaces via queryinterface and queryservice.
...you will have to ex
pose interfaces that contain more info than msaa does.
...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 ex
pose a single loader object containing all of the api functions described in this document.
...this feature may be used in a few different ways: to ex
pose an api that doesn't have a js file with an implementation or is written in an incompatible format such as jsm: let { loader } = require('toolkit/loader'); let loader = loader({ modules: { // require('net/utils') will get netutil.jsm 'net/utils': cu.import('resource:///modules/netutil.jsm', {}) } }); each loader instance comes with a set of built-in pseudo modules that are descri...
...for example in the sdk, the loader is loaded at bootstrap as a jsm module but is then ex
posed as a pseudo-module to avoid the overhead of subsequent loads: let loadermodule = cu.import('resource://gre/modules/commonjs/toolkit/loader.js'); let loader = loadermodule.loader({ modules: { // overlay `toolkit/loader` so that `require('toolkit/loader')` // will return our `loadermodule`.
...And 10 more matches
Gecko object attributes
object attributes list aria attributes all aria attributes used on dom element (i.e., any attribute prefixed by 'aria-') are ex
posed as object attributes; name is preserved except the 'aria-' prefix is cut.
... applied to: any role xml-roles if a dynamic content accessibility role string is used, it is ex
posed here.
... applied to: grid, heading, listitem, row, tablist ex
posed in aria: aria-level posinset if this item is in a group, what is the item number within the group, where the size is defined by the setsize attribute.
...And 10 more matches
Text labels and names - Accessibility
there are many situations in which a control, dialog, or other website feature should be given a descriptive name or label to allow users of assistive technologies to understand what its pur
pose is and to be able to understand and operate it correctly.
...failure to do so makes an image map hard to use for users of assistive technology — they need alternative text to be able to understand the pur
pose of an image.
... see also <area> h24: providing text alternatives for the area elements of image maps dialogs should be labeled for any container whose contents act as a dialog box (for example, a modal dialog asking the user to make a choice or respond to an action being taken), give it a descriptive label or name, so that assistive technology users can easily discover what its pur
pose is.
...And 10 more matches
JSAPI User Guide
it also makes it easy for each application to ex
pose some of its own objects and functions to javascript code.
... browsers ex
pose dom objects.
... your application will ex
pose objects that are relevant for the kind of scripts you want to write.
...And 9 more matches
Animated PNG graphics
for pur
poses of chunk descriptions, an unsigned int shall be a 32-bit unsigned integer in network byte order limited to the range 0 to (2^32)-1; an unsigned short shall be a 16-bit unsigned integer in network byte order with the range 0 to (2^16)-1; and a byte shall be an 8-bit unsigned integer with the range 0 to (2^8)-1.
...the pur
pose of this number is to detect (and optionally correct) sequence errors in an animated png, since the png specification does not im
pose ordering restrictions on ancillary chunks.
... 24 dis
pose_op byte type of frame area disposal to be done after rendering this frame.
...And 9 more matches
Mozilla accessibility architecture
accessibility apis on each operating system have built-in assumptions about what is the most important information, and how an accessibility server like mozilla should use the api's programmatic interfaces to ex
pose this information to an accessibility client (the assistive technology).
...for example, they all ex
pose an accessible name, or text representation, of each object, and they all use an enumerated integer value from a finite list, to ex
pose the role of an object.
...the shared code makes itself available to the toolkit-specific code via generic xpcom interfaces that return information about objects we want to ex
pose.
...And 8 more matches
Overview of Mozilla embedding APIs
the service manager ex
poses all of the available xpcom services - each service represents a global object which provides some piece of functionality.
...much of the gecko functionality is ex
posed through a component called the nswebbrowser.
...the webbrowser ex
poses a set of interfaces which allow the embedding application to control activity and respond to changes within this client area.
...And 8 more matches
Index
notes: 16 cached com
pose window faq seth spitzer (sspitzer@mozilla.org) what is the "cached" com
pose window?
... instead of destroying the mail com
pose window on send (or close) just to create a new one the next time, mozilla mail will "cache" the com
pose window on send (or close), and use that instead.
... back 0.9.7, we hit a wall with the com
pose window.
...And 8 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
the methods used to validate an identity vary depending on the policies of a given ca-just as the methods to validate other forms of identification vary depending on who is issuing the id and the pur
pose for which it will be used.
...for the pur
poses of this discussion, the digital signature associated with some data can be thought of as evidence provided by the client to the server.
... the client unlocks the private-key database, retrieves the private key for the user's certificate, and uses that private key to digitally sign some data that has been randomly generated for this pur
pose on the basis of input from both the client and the server.
...And 7 more matches
Mozilla DOM Hacking Guide
the array sclassinfodata, defined in nsdomclassinfo.cpp, maps each dom class to its helper class and to the interfaces that are ex
posed to javascript.
...the first argument passed to ns_define_classinfo_data_with_name, _class, is used for debug pur
poses.
...(bug 90757) static jsclass sdomconstructorprotoclass: xpconnect fu to ex
pose the dom objects constructors to javascript.
...And 7 more matches
Starting WebLock
when a gecko application starts up, registered components are created and notified via the general-pur
pose observer interface nsiobserver.
... the next step is to ex
pose additional functionality to gecko applications and other clients to query and control the weblock component.
...in this section, we enumerate the basic functionality the component should ex
pose and create the single interface that organizes and provides this functionality.
...And 6 more matches
Mozilla internal string guide
for the pur
pose of this document, we will refer to the 16-bit string classes in class documentation.
...nsa[c]string is the base of the string classes (since it im
poses fewer requirements) and ns[c]string is a class derived from it.
...nsliteral[c]string is trivially constructible and destructible, and therefore does not emit construction/destruction code when stored in statics, as op
posed to the other string classes.
...And 6 more matches
Index
this can be used for various diagnostic pur
poses.
... 36 components.utils.exportfunction api, add-ons, components, extensions, language bindings, method, mozilla, non-standard, reference, webextensions, xpcom this function provides a safe way to ex
pose a function from a privileged scope to a less-privileged scope.
...startindex() and endindex() are indices with respect to the text ex
posed by iaccessibletext.
...And 6 more matches
nsIFile
filesizeoflink print64 this attribute ex
poses the size of the symbolic link referenced by this nsifile.
... lastmodifiedtime print64 this attribute ex
poses the time when the file referenced by this nsifile was last modified.
... lastmodifiedtimeoflink print64 this attribute ex
poses the time when the symbolic link referenced by this nsifile was last modified.
...And 6 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
then references are obtained to the four <div> blocks into which we'll output the current contents of each of the key matrices for informational pur
poses while our scene is running.
...its job is to obtain the viewer's reference space, compute how much movement needs to be applied to any animated objects given the amount of time that's elapsed since the last frame, and then to render each of the views specified by the viewer's xr
pose.
... let lastframetime = 0; function drawframe(time, frame) { let session = frame.session; let adjustedrefspace = xrreferencespace; let
pose = null; animationframerequestid = session.requestanimationframe(drawframe); adjustedrefspace = applyviewercontrols(xrreferencespace);
pose = frame.getviewer
pose(adjustedrefspace); if (
pose) { let gllayer = session.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); logglerror("bindframebuffer"); gl.clearcolor(0, 0, 0, 1.0); gl.cleardepth(1.0); // clear everything gl.clear(gl.color_buffer_bit | gl.depth_buffer_bit); logglerror("glclear"); const deltatime = (time - lastframetime) * 0.001; // convert to seconds lastframetime = time; for (let view of
pose.vi...
...And 6 more matches
Accessibility documentation index - Accessibility
aria live regions fill this gap and provide a way to programmatically ex
pose dynamic content changes in a way that can be announced by assistive technologies.
...addition of aria semantics only ex
poses extra information to a browser's accessibility api, and does not affect a page's dom.
...the aria-hidden attribute can either ex
pose or hide non-interactive content from the accessibility api.
...And 6 more matches
HTTP resources and specifications - HTTP
specification title status rfc 7230 hypertext transfer protocol (http/1.1): message syntax and routing pro
posed standard rfc 7231 hypertext transfer protocol (http/1.1): semantics and content pro
posed standard rfc 7232 hypertext transfer protocol (http/1.1): conditional requests pro
posed standard rfc 7233 hypertext transfer protocol (http/1.1): range requests pro
posed standard rfc 7234 hypertext transfer protocol (http/1.1): caching pro
posed stan...
...dard rfc 5861 http cache-control extensions for stale content informational rfc 8246 http immutable responses pro
posed standard rfc 7235 hypertext transfer protocol (http/1.1): authentication pro
posed standard rfc 6265 http state management mechanism defines cookies pro
posed standard draft spec cookie prefixes ietf draft draft spec same-site cookies ietf draft draft spec deprecate modification of 'secure' cookies from non-secure origins ietf draft rfc 2145 use and interpretation of http version numbers informational rfc 6585 additional http status codes pro
posed standard rfc 7538 the hypertext transfer protocol status code 308 (permanent redirec...
...t) pro
posed standard rfc 7725 an http status code to report legal obstacles on the standard track rfc 2397 the "data" url scheme pro
posed standard rfc 3986 uniform resource identifier (uri): generic syntax internet standard rfc 5988 web linking defines the link header pro
posed standard experimental spec hypertext transfer protocol (http) keep-alive header informational (expired) draft spec http client hints ietf draft rfc 7578 returning values from forms: multipart/form-data pro
posed standard rfc 6266 use of the content-disposition header field in the hypertext transfer protocol (http) pro
posed standard rfc 2183 communicating presentation information in int...
...And 6 more matches
Accessible Toolkit Checklist
ex
pose your ui - a way for assistive technologies such as screen readers, screen magnifiers and voice dictation software to understand your software.
... msaa support: ex
pose window with role_dialog, unless it's already the standard dialog window class #32770.
...ex
pose status bars with role_statusbar, unless they already use the standard window class msctls_statusbar32.
...And 5 more matches
Introduction to the File and Directory Entries API - Web APIs
big concepts before you start using the file and directory entries api, you need to understand a few concepts: the file and directory entries api is a virtual representation of a file system the file and directory entries api can use different storage types browsers im
pose storage quota the file and directory entries api has asynchronous and synchronous versions when using the asynchronous api, always use the error callbacks the file and directory entries api interacts with other apis the file and directory entries api is case-sensitive the file and directory entries api is a virtual representation of a file system the api doesn't give you access to the loca...
... browsers im
pose storage quotas to prevent a web app from using up the entire disk, browsers might im
pose a quota for each app and allocate storage among web apps.
... restrictions for security reasons, browsers im
pose restrictions on file access.
...And 5 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
for example, if the object is facing an object located at (3, 1, -2)—that is, three meters to the right, one meter up, and two meters away from the origin point—the result is: [31-2]\left [ \begin{matrix} 3 \\ 1 \\ -2 \end{matrix} \right ] this can also be represented as an array: let directionvector = [3, 1, -2]; for the pur
poses of performing operations involving both the coordinates and the facing direction vector, the vector needs to include the w component.
... composing multiple transforms if your camera needs to be performing multiple transforms simultaneously, such as zooming and panning at the same time, you can multiply the transform matrices together to com
pose them into a single matrix that applies both changes at once.
... this information includes the xrviewer
pose describing the position and facing direction of the viewer within the scene as well as a list of xrview objects, each representing one perspective on the scene.
...And 5 more matches
XRView - Web APIs
transform read only an xrrigidtransform which describes the current position and orientation of the viewpoint in relation to the xrreferencespace specified when getviewer
pose() was called on the xrframe being rendered.
... 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 getviewer
pose() method to get the xrviewer
pose representing (in essence) the position of the viewer's head.
... all positions and orientations within the views for a given xrviewer
pose are specified in the reference space that was passed to xrframe.getviewer
pose(); this is called the viewer reference space.
...And 5 more matches
ARIA annotations - Accessibility
aria annotations features the aria attributes providing these new abilities are as follows: aria-description="" — provides a detailed description of an html element, as op
posed to the brief label provided by aria-label.
... role="mark" — semantically denotes html elements containing text that is marked/highlighted for reference pur
poses.
... role="suggestion" — semantically denotes a single pro
posed change to an editable document.
...And 5 more matches
Value definition syntax - CSS: Cascading Style Sheets
bold [ thin && <length> ] this example matches the following values: bold thin 2vh bold 0 thin bold thin 3.5em but not: thin bold 3em, as bold is juxta
posed with the component defined by the brackets, it must appear before it.
...all juxta
posed components are mandatory and should appear in the exact order.
... but not: smaller, as bold is juxta
posed, and must appear before any smaller keyword.
...And 5 more matches
Details of the object model - JavaScript
inheriting properties sup
pose you create the mark object as a workerbee with the following statement: var mark = new workerbee; when javascript sees the new operator, it creates a new generic object and implicitly sets the value of the internal property [[prototype]] to the value of workerbee.prototype and passes this new object as the value of the this keyword to the workerbee constructor function.
...here's the new definition for the engineer constructor: function engineer(name, projs, mach) { this.base = workerbee; this.base(name, 'engineering', projs); this.machine = mach || ''; } sup
pose you create a new engineer object as follows: var jane = new engineer('doe, jane', ['navigator', 'javascript'], 'belau'); javascript follows these steps: the new operator creates a generic object and sets its __proto__ property to engineer.prototype.
...you can use any legal property name; base is simply evocative of its pur
pose.
...And 5 more matches
Interacting with page scripts - Archive of obsolete content
this guide describes: how to share objects between content scripts and page scripts how to send messages between content scripts and page scripts sharing objects with page scripts there are two possible cases here: a content script might want to access an object defined by a page script a content script might want to ex
pose an object to a page script access objects defined by page scripts to access page script objects from content scripts, you can use the global unsafewindow object.
... ex
pose objects to page scripts until firefox 30, you could use unsafewindow to perform the reverse procedure, and make objects defined in content scripts available to page scripts: // content-script.js unsafewindow.contentscriptobject = {"greeting" : "hello from add-on"}; // page-script.js var button = document.getelementbyid("show-content-script-var"); button.addeventlistener("click", function()...
...clicking "i will not work" fails, and the following message is logged: permission denied to access property 'greeting' ex
pose 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.
...And 4 more matches
JavaScript Daemons Management - Archive of obsolete content
for a fast overview on the code pro
posed here you can git clone https://github.com/madmurphy/daemon.js.git.
...t.length; nletter < nlen; nletter++) { ospan = document.createelement("span"); ospan.textcontent = stext[nletter]; oletter = { "elem": ospan, "parent": this }; aletters.push(oletter); oletter.pos = math.random() * 50; oletter.elem.style.position = "relative"; this.appendchild(ospan); } } var nmaxdist = 25, aletters = [], stext = "do you feel lucky, punk?", orecom
pose = new daemon(document.createelement("p"), perform, 33, 30, prepare); onload = function () { orecom
pose.owner.id = "perform-me"; document.body.appendchild(orecom
pose.owner); orecom
pose.play(); }; </script> <style type="text/css"> body { font-family: monospace, sans-serif; background: #dddddd; overflow: hidden; } #perform-me { margin: 50px; font-size: 20px; line-height: 20px; ...
...} </style> </head> <body> <h1>new daemon(<em>@thisobject</em>, <em>@callback</em>[, <em>@rate</em>, <em>@length</em>, <em>@init</em>, <em>@onstart</em>])</h1> <p><button onclick="orecom
pose.skipto(11);">skipto(11)</button> <button onclick="orecom
pose.makesteps(29);">makesteps(29)</button> <button onclick="orecom
pose.fixposition(-13);">fixposition(-13)</button> <button onclick="orecom
pose.play();">play</button> <button onclick="orecom
pose.turn();">turn</button> <button onclick="orecom
pose.pause();">pause</button> <button onclick="orecom
pose.reverseplay();">reverseplay</button> <button onclick="orecom
pose.reversals = 2;alert('changed');">two reversals</button> <button onclick="orecom
pose.makeloop();alert('changed');">makeloop</button> <button onclick="orecom
pose.unmakeloop();alert('changed');...
...And 4 more matches
JXON - Archive of obsolete content
note: if you are interested to address only some parts of an xml document (and are not starting in javascript/json for templating pur
poses), use xpath instead of converting the whole document into json.
... the algorithms pro
posed here (see: #1, #2, #3, #4) will consider only the following types of nodes and their attributes: document (only as function argument), documentfragment (only as function argument), element, text (never as function argument), cdatasection (never as function argument), attr (never as function argument).
... reverse algorithms it is possible to reverse the algorithms pro
posed here in order to build a new xml document starting from a javascript objects tree.
...And 4 more matches
The Implementation of the Application Object Model - Archive of obsolete content
pur
pose - the pur
pose of this document is two-fold.
...when the remote file is subsequently downloaded, these local annotations are sucked in and superim
posed on top of the structure described by the file.
...it does not make sense to confuse or obscure the pur
pose of html by adding in a whole slew of new functionality that hasnothing to do with the display of web pages.
...And 4 more matches
Handling common HTML and CSS problems - Learn web development
the trouble with html and css some of the trouble with html and css lies with the fact that both languages are fairly simple, and often developers don't take them seriously, in terms of making sure the code is well-crafted, efficient, and semantically describes the pur
pose of the features on the page.
...for example, you might use a css framework and find that one of the class names it uses clashes with one you've already used for a different pur
pose.
... or you might find that html generated by some kind of third party api (generating ad banners, for example) includes a class name or id that you are already using for a different pur
pose.
...And 4 more matches
Handling common JavaScript problems - Learn web development
so the code falls over as soon as we try to access a property of jsonobj (which as you might expect, is sup
posed to be a json object).
... this is sup
posed to be fetched from an external .json file using the following xmlhttprequest call: let requesturl = 'https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json'; let request = new xmlhttprequest(); request.open('get', requesturl); request.send(); let superheroes = request.response; populateheader(superheroes); showheroes(superheroes); but this fails.
...as a quick example, the geolocation api (which ex
poses available location data for the device the web browser is running on) has a main entry point for its use — a geolocation property available on the global navigator object.
...And 4 more matches
Index
softoken is an nss module that ex
poses most freebl functionality as a pkcs#11 module.
... most of the time certificates and keys are sup
posed to be stored in the nss database.
... when using hashing, encryption, and decryption functions, it is possible to stream data (as op
posed to operating on a large buffer).
...And 4 more matches
Embedded Dialog API
gecko can use the latter to
pose dialogs built from xul.
...advanced windowing api embedding applications concerned with ensuring that dialogs
posed by gecko are consistent in appearance and behaviour with dialogs
posed directly by the application itself face a choice.
...however, it's nearly accurate to claim that the majority of all dialogs and alerts
posed by gecko do reside in a single generic component, nsipromptservice (nsipromptservice).
...And 4 more matches
nsIExternalProtocolService
method overview boolean externalprotocolhandlerexists(in string aprotocolscheme); astring getapplicationdescription(in autf8string ascheme); nsihandlerinfo getprotocolhandlerinfo(in acstring aprotocolscheme); nsihandlerinfo getprotocolhandlerinfofromos(in acstring aprotocolscheme, out boolean afound); boolean isex
posedprotocol(in string aprotocolscheme); void loaduri(in nsiuri auri, [optional] in nsiinterfacerequestor awindowcontext); void loadurl(in nsiuri aurl); void setprotocolhandlerdefaults(in nsihandlerinfo ahandlerinfo, in boolean aoshandlerexists); methods externalprotocolhandlerexists() check whether a handler for a specific protocol exists.
...isex
posedprotocol() check whether a handler for a specific protocol is "ex
posed" as a visible feature of the current application.
... an ex
posed protocol handler is one that can be used in all contexts.
...And 4 more matches
Cognitive accessibility - Accessibility
this provides access to people with cognitive disabilities by enabling them to focus on the main pur
pose of the content.
...people with cognitive disabilities, limited short-term memory, and reading disabilities all benefit from being able to identify the pur
pose of content this way.
...poorly phrased link text may confuse users as to its pur
pose or destination.
...And 4 more matches
String.prototype.normalize() - JavaScript
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 com
posed and decom
posed forms note that the length of the normalized form under "nfd" is 2.
... that's because "nfd" gives you the decom
posed version of the canonical form, in which single code points are split into multiple combining ones.
... the decom
posed canonical form for "ñ" is "\u006e\u0303".
...And 4 more matches
Index - Archive of obsolete content
the pur
pose of this article is not to describe these items in any great detail but to define what they are in simple terms.
... 4 accessibility/xul accessibility reference accessibility, xul this table is designed to show how to ex
pose text properly for various xul element types.
... 947 template and tree listeners xul, xul_template_guide there are several listeners (or observers) used during the template build process, each used for different pur
poses.
...And 3 more matches
Adobe Flash - Archive of obsolete content
in particular, the macromedia® flash™ plugin ex
poses certain plugin functionality for access via javascript.
... detecting the right flash plugin (and browser) adobe flash has ex
posed the scriptability feature in netscape gecko browsers since flash 6r49 and later.
...every plugin ex
poses a description string that typically includes the plugin's name and version number.
...And 3 more matches
LiveConnect Overview - Archive of obsolete content
for example, sup
pose the redwood corporation uses a java package called redwood to contain various java classes that it implements.
...(although this functionality (along with some others) had been broken in gecko 1.9 (see bug 391642) as the mozilla-specific liveconnect code had not been maintained inside mozilla, with java 6 update 11 and 12 building support for reliance on mozilla's implementation of the generic (and cross-browser) npapi plugin code, this has again been fixed.) for example, sup
pose you are using the java forname method to assign the name of a java class to a variable called theclass.
...accessing javascript with jsobject for example, sup
pose you are working with the java class called javadog.
...And 3 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
rhino is a java implementation of javascript which is commonly embedded in java applications to ex
pose scripting capability.
... listing 4 - demonstration of server and client context <script runat="server"> function ex
posed() { return "ex
posed to the browser"; } function notex
posed() { return "can't see me!"; } </script> <script runat="client"> alert( ex
posed() ); alert( notex
posed() ); </script> there are two blocks of scripts defined, one with runat set to server and the other set to client.
... add a statement inside the server-side script block to ex
pose a particular server-side function to the browser.
...And 3 more matches
Windows Media in Netscape - Archive of obsolete content
in a code snippet: if (window.activexobject && navigator.useragent.indexof('windows') != -1) { // ie for windows object instantiation -- use of activexobject } else if(window.geckoactivexobject) { // netscape 7.1 object instantiation --use of geckoactivexobject } else if(navigator.mimetypes) { // plugin architecture, such as in netscape 4x - 7.02 and opera browsers } since ie for mac also ex
poses window.activexobject it is wise to determine if the browser in question is on windows.
...while the progid cannot be used to create a windows media player object that ex
poses all its properties and methods, it is useful for rapid detections.
...unlike using the progid as an argument, using wmplayer.ocx.7 as an argument to both these apis creates a fully usable reference to the windows media player 7 or 9 control, with all the methods and properties ex
posed to javascript.
...And 3 more matches
What’s in the head? Metadata in HTML - Learn web development
objective: to learn about the html head, its pur
pose, the most important items it can contain, and what effect it can have on the html document.
...some content management systems have facilities to automatically extract page author information and make it available for such pur
poses.
...for example, the keyword <meta> element (<meta name="keywords" content="fill, in, your, keywords, here">) — which is sup
posed to provide keywords for search engines to determine relevance of that page for different search terms — is ignored by search engines, because spammers were just filling the keyword list with hundreds of keywords, biasing results.
...And 3 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
now we will see how components can also ex
pose methods and variables.
...it just takes an import and a short directive like use:selectonfocus that clearly depicts its pur
pose.
...the child component could get a reference to the <h2> node using bind:this={dom_node} and ex
pose it to the outside using two-way data binding.
...And 3 more matches
Mozilla's Section 508 Compliance
the following is provided for informational pur
poses only and is not a legally binding voluntary product accessibility template (vpat).
...the focus shall be programmatically ex
posed so that assistive technology can track focus and focus changes.
...we ex
pose focus programmatically via msaa (windows) and atk (linux/unix).
...And 3 more matches
Python binding for NSS
python also provides an abstraction of common operating system services but because nss and nspr are tightly bound python-nss ex
poses elements of nspr.
... design goals nss and nspr are c language api's which python-nss "wraps" and ex
poses to python programs.
... every module, class, function, and method has associated documentation and is ex
posed via the standard python methodology.
...And 3 more matches
Index
230 js_definefunction jsapi reference, spidermonkey js_definefunction ex
poses a c/c++ function to scripts by defining a new method on an existing javascript object.
... 285 js_getcontextprivate jsapi reference, spidermonkey each jscontext has two fields of type void * which the application may use for any pur
pose.
...these fields are not directly ex
posed to scripts.
...And 3 more matches
Accessibility Inspector - Firefox Developer Tools
the accessibility inspector provides a means to access important information ex
posed to assistive technologies on the current page via the accessibility tree, allowing you to check what's missing or otherwise needs attention.
... here we are mainly talking about exposing information to people with visual disabilities — this is done via the accessibility apis available inside web browsers, which ex
pose information on what roles the different elements on your page play (e.g., are they just text, or are they buttons, links, form elements, etc.?).
... semantic dom elements have roles assigned to them by default that hint at what their pur
pose is.
...And 3 more matches
Working with the History API - Web APIs
example of pushstate() method sup
pose http://mozilla.org/foo.html executes the following javascript: let stateobj = { foo: "bar", } history.pushstate(stateobj, "page 2", "bar.html") this will cause the url bar to display http://mozilla.org/bar.html, but won't cause the browser to load bar.html or even check that bar.html exists.
... sup
pose now that the user navigates to http://google.com, then clicks the back button.
...because firefox saves state objects to the user's disk so they can be restored after the user restarts the browser, we im
pose a size limit of 640k characters on the serialized representation of a state object.
...And 3 more matches
WebXR Device API - Web APIs
accessing the webxr api to gain access to the webxr api within the context of a given window, use the navigator.xr property, which returns an xrsystem object through which the entire webxr device api is then ex
posed.
... navigator.xr read only this property, added to the navigator interface, returns the xrsystem object through which the webxr api is ex
posed.
... xr
pose describes a position and orientation in space relative to an xrspace.
...And 3 more matches
Using the aria-hidden attribute - Accessibility
the aria-hidden attribute can either ex
pose or hide non-interactive content from the accessibility api.
... using aria-hidden="false" will not re-ex
pose the element to assistive technology if any of its parents specify aria-hidden="true".
... values false (default) the element is ex
posed to the accessibility api.
...And 3 more matches
<isindex> - HTML: Hypertext Markup Language
in this thread, different type of solutions are pro
posed.
...the user fills in the fields, clicks ok, and the query results come up in the table of contents window." a thread about isindex in november 1992, kevin hoadley questioned the need for an isindex element and pro
posed to drop it.
... he pro
posed to have instead an input element (idea supported by steve putz).
...And 3 more matches
HTML elements reference - HTML: Hypertext Markup Language
<nav> the html <nav> element represents a section of a page whose pur
pose is to provide navigation links, either within the current document or to other documents.
...important for accessibility and seo, these elements identify the pur
pose or structure of that content.
... <mark> the html mark text element (<mark>) represents text which is marked or highlighted for reference or notation pur
poses, due to the marked passage's relevance or importance in the enclosing context.
...And 3 more matches
HTML documentation index - HTML: Hypertext Markup Language
its pur
pose is to identify the element when linking (using a fragment identifier), scripting, or styling (with css).
...this attribute and the <style> element have mainly the pur
pose of allowing for quick styling, for example for testing pur
poses.
... 57 <acronym> element, html, html:flow content, obsolete, reference, web the html acronym element (<acronym>) allows authors to clearly indicate a sequence of characters that com
pose an acronym or abbreviation for a word.
...And 3 more matches
Content Processes - Archive of obsolete content
a content process was sup
posed to run all the code associated with a single tab.
... conversely, an add-on process was sup
posed to run all the code associated with a single add-on.
... sup
pose we have two event emitters in different processes, and we want them to be able to emit events to each other.
...And 2 more matches
content/symbiont - Archive of obsolete content
this trait is com
posed from the loader and worker traits.
... var { symbiont } = require('sdk/content/content'); var thing = symbiont.resolve({ constructor: '_init' }).com
pose({ constructor: function thing(options) { // `getmyframe` returns the host application frame in which // the page is loaded.
... contentscriptoptions object read-only value ex
posed to content scripts under self.options property.
...And 2 more matches
dev/panel - Archive of obsolete content
you can use the class utility function: const { panel } = require("dev/panel"); const { class } = require("sdk/core/heritage"); const mypanel = class({ extends: panel, label: "my panel", tooltip: "my new devtool", icon: "./my-devtool.png", url: "./my-devtool.html", setup: function(options) { // my setup goes here }, dis
pose: function() { // my teardown goes here }, onready: function() { // i can send messages to // the panel document here } }); alternatively, you can use the extend function: const { extend } = require("sdk/core/heritage"); function mypanel() {}; mypanel.prototype = extend(panel.prototype, { label: "my panel", tooltip: "...", ....
... optional dis
pose function a function that will be called when the panel is about to be destroyed.
...uire("dev/toolbox"); const { class } = require("sdk/core/heritage"); // define the panel constructor const mypanel = class({ extends: panel, label: "my panel", tooltip: "my new devtool's panel", icon: "./my-icon.png", url: "./my-panel.html", // when the panel is created, // take a reference to the debuggee setup: function(options) { this.debuggee = options.debuggee; }, dis
pose: function() { this.debuggee = null; }, onready: function() { // in this function you can communicate // with the panel document } }); // export the constructor exports.mypanel = mypanel; // create a new tool, initialized // with the new constructor const mytool = new tool({ panels: { mypanel: mypanel } }); panel document environment the panel document loaded from the url p...
...And 2 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
eference 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 in /usr/lib/thunderbird-5/default/pref ) for the record/history pur
pose ...
...it was apparently sup
posed to increase the load of the binary for a feature not used by lots of individuals.
...although it was corrected in mozilla mainstream: mozilla/extensions/pref/autoconfig/src/nsldapsyncquery.cpp 1.7.2.1 by late 2004, it is still present in thunderbird 1.0.2 at least :-(, so i applied the workaround i pro
posed in that bug report (start_pos += 1;).
...And 2 more matches
Source code directories overview - Archive of obsolete content
it is a living document which is (sup
posed to be) updated monthly according to changes in the mozilla source tree.
...although not required, these common names are typically used for a common pur
pose.
... content was split off from layout and contains objects as they are ex
posed to the dom.
...And 2 more matches
Menu - Archive of obsolete content
no menuitem constructor is ex
posed, because jetpack automatically boxes simple javascript objects into menuitem objects.
... xulid string the id of the menuitem's backing xul element, ex
posed for the benefit of advanced developers.
... menu bar menus jetpack.menu when you need to ex
pose functionality through a menu but no menu in particular, do the right thing by using jetpack.menu, the "jetpack menu." jetpack.menu is a jetpack.menu object corresponding to a menu or region within a menu that jetpack sets aside for features.
...And 2 more matches
Elements - Archive of obsolete content
button - the button attribute im
poses a filter on the handler.
... modifiers - the modifiers attribute im
poses a filter on key and mouse handlers.
... keycode - the keycode attribute im
poses a filter on key handlers.
...And 2 more matches
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
you can use this page if all you really want is a button for some special pur
pose.
...> <rdf:seq about="chrome://messenger/content/addressbook/addressbook.xul"> <rdf:li>chrome://custombutton/content/button.xul</rdf:li> </rdf:seq> </rdf:li> <!-- message --> <rdf:li> <rdf:seq about="chrome://messenger/content/messagewindow.xul"> <rdf:li>chrome://custombutton/content/button.xul</rdf:li> </rdf:seq> </rdf:li> <!-- message com
pose --> <rdf:li> <rdf:seq about="chrome://messenger/content/messengercom
pose/messengercom
pose.xul"> <rdf:li>chrome://custombutton/content/button.xul</rdf:li> </rdf:seq> </rdf:li> <!-- mail --> <rdf:li> <rdf:seq about="chrome://messenger/content/messenger.xul"> <rdf:li>chrome://custombutton/content/button.xul</rdf:li> </rdf:seq> </rdf:li> ...
... <!-- com
poser --> <rdf:li> <rdf:seq about="chrome://editor/content/editor.xul"> <rdf:li>chrome://custombutton/content/button.xul</rdf:li> </rdf:seq> </rdf:li> <!-- chat --> <rdf:li> <rdf:seq about="chrome://chatzilla/content/chatzilla.xul"> <rdf:li>chrome://custombutton/content/button.xul</rdf:li> </rdf:seq> </rdf:li> <!-- calendar --> <rdf:li> <rdf:seq about="chrome://calendar/content/calendar.xul"> <rdf:li>chrome://custombutton/content/button.xul</rdf:li> </rdf:seq> </rdf:li> </rdf:seq> </rdf:rdf> optionally customize the file by changing the displayname, description and author attributes.
...And 2 more matches
Using the Editor from XUL - Archive of obsolete content
editor creation so let's trace through the process of editor creation when bringing up the com
poser window.
... something, somewhere, tells mozilla to open the com
poser window.
...we are currently only able to have one editor per com
poser window; in future, relaxing this restriction would allow us to edit all the subdocuments in a frameset at the same time.
...And 2 more matches
RFE to the XForms API - Archive of obsolete content
these are xforms dom and xforms interfaces that are ex
posed by xforms dom.
...for example, every visual xforms element ex
poses the nsixformsdelegate interface.
... if you need some additional functionality that shouldn't be ex
posed from the xforms element directly, then you should think which interface of the xforms element is more appropriate to ex
pose it.
...And 2 more matches
WAI-ARIA basics - Learn web development
an important point about wai-aria attributes is that they don't affect anything about the web page, except for the information ex
posed by the browser's accessibility apis (where screenreaders get their information from).
... this last point is key — to use a screenreader in the first place, your operating system needs to run browsers that have the necessary accessibility apis in place to ex
pose the information screenreaders need to do their job.
... next, you need to worry about whether the browsers in question support aria features and ex
pose them via their apis, but also whether screenreaders recognise that information and present it to their users in a useful way.
...And 2 more matches
Test your skills: Selectors - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
...And 2 more matches
Images in HTML - Learn web development
so for example, if your image is called dinosaur.jpg, and it sits in the same directory as your html page, you could embed the image like so: <img src="dinosaur.jpg"> if the image was in an images subdirectory, which was inside the same directory as the html page (which google recommends for seo/indexing pur
poses), then you'd embed it like this: <img src="images/dinosaur.jpg"> and so on.
...its value is sup
posed to be a textual description of the image, for use in situations where the image cannot be seen/displayed or takes a long time to render because of a slow internet connection.
... for example, our above code could be modified like so: <img src="images/dinosaur.jpg" alt="the head and torso of a dinosaur skeleton; it has a large head with long sharp teeth"> the easiest way to test your alt text is to pur
posely misspell your filename.
...And 2 more matches
Index - Learn web development
there are a large number of these, and they often serve quite specific pur
poses.
... 136 how css is structured beginner, css, html, learn, selectors, structure, comments, properties, shorthand, values, whitespace now that you are beginning to understanding the pur
pose and use of css, let's examine the structure of css.
...that's the whole pur
pose of the cheatsheet, to give you some quick accurate ready to use code snippets for common usages.
...And 2 more matches
Basic math in JavaScript — numbers and operators - Learn web development
but for the pur
poses of this course, we'll just worry about number values.
...you can test this by typing in the following: typeof mynumber; to fix the calculation, you can do this: number(mynumber) + 3; arithmetic operators arithmetic operators are the basic operators that we use to do sums in javascript: operator name pur
pose example + addition adds two numbers together.
... first try entering some simple examples of your own, such as 10 + 7 9 * 8 60 % 3 you can also try declaring and initializing some numbers inside variables, and try using those in the sums — the variables will behave exactly like the values they hold for the pur
poses of the sum.
...And 2 more matches
Accessibility API cross-reference
we find that it uses very similar naming conventions as java accessibility, and for those pur
poses the two to be nearly the same.
... checkbutton check_box check_box checkbox or switch <input type=checkbox> pretty obvious what this is for clock n/a n/a timer <time> column of cells in a table - how would the user specifically point to this, as op
posed to the column header or cells?
... complementary <aside> n/a but <div> or even <p> have been suggested for this pur
pose a widget that may contain navigable descendants or owned children.
...And 2 more matches
Mozilla’s UAAG evaluation report
this evaluation does not cover mailnews or com
poser.
...(p1) p the following line can be added to a user's prefs.js file to control blinking: user_pref("browser.blink_allowed", false); bug 89144 has been filed to ex
pose this pref in the ui.
...(p2) vg preferences, advanced, scripts & windows - allow scripts to "open unrequested windows" we do not have a strategy to "alert the user and allow the user to open it on demand" we do not have ex
posed prefs for all of our popup control options.
...And 2 more matches
MathML Accessibility in Mozilla
in bug 1175269 and bug 1001641, we relied on the webkit's nsaccessibility mathml tree to ex
pose the main constructions.
...at the moment, it is recommended to use a nightly build to ensure that the accessible tree expected by orca is correctly ex
posed.
... abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz not ex
posed to orca.
...And 2 more matches
PKCS11 Implement
general-pur
pose functions c_initialize the nss calls c_initialize on startup or when it loads a new module.
... multipur
pose tokens provide the full range of cryptographic services.
...future releases of nss will also support multipur
pose tokens that are fips-140 compliant.
...And 2 more matches
An Overview of XPCOM
the http component in gecko doesn't ex
pose private classes it uses as separate components.
... the "stuff" that's internal to the component stays internal, and isn't ex
posed to xpcom.
...in this "semi-encapsulated" situation, the only part of the class that is ex
posed is a well-defined list of callable methods (i.e., the interface).
...And 2 more matches
imgIContainer
kdontanimmode 1 klooponceanimmode 2 kdis
poseclearall -1 "disposal" method indicates how the image should be handled before the subsequent image is displayed.
... obsolete since gecko 2.0 kdis
posenotspecified 0 leave frame, let new frame draw() on top.
... obsolete since gecko 2.0 kdis
posekeep 1 leave frame, let new frame draw() on top.
...And 2 more matches
CustomEvent - Web APIs
the customevent interface represents events initialized by an application for any pur
pose.
... event.com
posed read only a boolean indicating whether or not the event can bubble across the boundary between the shadow dom and the regular dom.
...some other browsers are starting to support it for web compatibility pur
poses.
...And 2 more matches
Event - Web APIs
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 pur
poses.
... event.com
posed read only a boolean indicating whether or not the event can bubble across the boundary between the shadow dom and the regular dom.
...some other browsers are starting to support it for web compatibility pur
poses.
...And 2 more matches
Timing element visibility with the Intersection Observer API - Web APIs
it turns out that one of the most common uses of flash or other script in advertising on the web is to record how long each ad is visible, for the pur
pose of billing and payment of revenues.
...we have no margins to extend or contract the intersection root's rectangle; we want to match the boundaries of the document's viewport exactly for intersection pur
poses.
...we need a one second refresh since we're displaying timers in all visible ads for the pur
poses of this example.
...And 2 more matches
NavigatorID - Web APIs
this property is kept only for compatibility pur
poses.
...this property is kept only for compatibility pur
poses.
...this property is kept only for compatibility pur
poses.
...And 2 more matches
Window.open() - Web APIs
an offset is universally implemented by browser manufacturers (it is 29 pixels in ie6 sp2 with the default theme) and its pur
pose is to help users to notice new windows opening.
...the pur
pose of the return false in the code is to cancel default action of the link: if the onclick event handler is executed, then there is no need to execute the default action of the link.
...since your users are the ones who are sup
posed to use such windows (and not you, being the web author), the best is to avoid interfering with their habits and preferences.
...And 2 more matches
XRInputSourceEvent.frame - Web APIs
instead, the xrframe specified by the frame property is simply a method to provide access to the get
pose() method, which you can use to get the relative positions of the objects in the scene at the time the event occurred.
... however, since the event frame isn't an animation frame, there is no viewer
pose available to represent the viewer's current point of view; the results of calling getviewer
pose() will be an xrviewer
pose with an empty views list.
... examples this code shows a handler for the selectstart event which gets the target ray's
pose from the frame, mapping the
pose representing the ray (event.inputsource.targetrayspace) to the overall reference space myrefspace.
...And 2 more matches
XRSession: selectend event - Web APIs
after checking to ensure that the received event is a tracked-pointer event (the only kind we handle here), the target ray's
pose is obtained using get
pose().
... if the target ray
pose was fetched successfully, the code then uses the value of event property type to route control to an appropriate function to handle the event which arrived: for selectstart events, a mybegintracking() function is called with the target ray
pose's matrix.
... upon receiving a select event, the mydropobject() function is called with the target object and the current target ray
pose transform as inputs.
...And 2 more matches
XRSession: selectstart event - Web APIs
after checking to ensure that the received event is a tracked-pointer event (the only kind we handle here), the target ray's
pose is obtained using get
pose().
... if the target ray
pose was fetched successfully, the code then uses the value of event property type to route control to an appropriate function to handle the event which arrived: for selectstart events, a mybegintracking() function is called with the target ray
pose's matrix.
... upon receiving a select event, the mydropobject() function is called with the target object and the current target ray
pose transform as inputs.
...And 2 more matches
XRSession: squeezeend event - Web APIs
after checking to ensure that the received event is a tracked-pointer event (the only kind we handle here), the target ray's
pose is obtained using get
pose().
... if the target ray
pose was fetched successfully, the code then uses the value of event property type to route control to an appropriate function to handle the event which arrived: for squeezestart events, a mybegintracking() function is called with the target ray
pose's matrix.
... upon receiving a squeeze event, the mydropobject() function is called with the target object and the current target ray
pose transform as inputs.
...And 2 more matches
XRSession: squeezestart event - Web APIs
after checking to ensure that the received event is a tracked-pointer event (the only kind we handle here), the target ray's
pose is obtained using get
pose().
... if the target ray
pose was fetched successfully, the code then uses the value of event property type to route control to an appropriate function to handle the event which arrived: for squeezestart events, a mybegintracking() function is called with the target ray
pose's matrix.
... upon receiving a squeeze event, the mydropobject() function is called with the target object and the current target ray
pose transform as inputs.
...And 2 more matches
Operable - Accessibility
2.4.2 include page title (a) each web page should include an informative <title>, the content of which describes the page's content/pur
pose.
... 2.4.4 link pur
pose (in context) (a) the pur
pose/destination of a link can be determined from the link text, or from its surroundings (e.g.
...exceptions are where the link pur
pose is ambiguous to all users (see ambiguous to users in general for a useful explanation of this).
...And 2 more matches
-moz-context-properties - CSS: Cascading Style Sheets
syntax /* keyword values */ -moz-context-properties: fill; -moz-context-properties: fill, stroke; /* global values */ -moz-context-properties: inherit; -moz-context-properties: initial; -moz-context-properties: unset; values fill ex
pose the fill value set on the image to the embedded svg.
... stroke ex
pose the stroke value set on the image to the embedded svg.
... fill-opacity ex
pose the fill-opacity value set on the image to the embedded svg.
...And 2 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
for example, sup
pose web content at https://foo.example wishes to invoke content on domain https://bar.other.
... requests with credentials the most interesting capability ex
posed by both xmlhttprequest or fetch and cors is the ability to make "credentialed" requests that are aware of http cookies and http authentication information.
... access-control-ex
pose-headers the access-control-ex
pose-headers header lets a server whitelist headers that browsers are allowed to access.
...And 2 more matches
Web audio codec guide - Web media technologies
because the compression algorithm is specifically designed for audio, it gives better results than would be achieved using a general-pur
pose compression algorithm.
...it's a good general-pur
pose audio codec that can efficiently handle both low-complexity audio such as speech as well as music and other high-complexity sounds.
... if you need to minimize latency during music playback, you should strongly consider opus, which has the lowest range of latencies of the general-pur
pose codecs (5 ms to 66.5 ms, compared to at least 100 ms for the others).
...And 2 more matches
SVG documentation index - SVG: Scalable Vector Graphics
they let svg markup and its resulting dom share information that standard attributes can't, usually for scripting pur
poses.
... 213 tabindex svg, svg attribute the tabindex attribute allows you to control whether an element is focusable and to define the relative order of the element for the pur
poses of sequential focus navigation.
...actually, that's its only pur
pose.
...And 2 more matches
widget - Archive of obsolete content
for example, sup
pose we want to implement a media player as an add-on.
... contentscriptoptions object read-only value ex
posed to content scripts under self.options property.
...nt element for the widget is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the widget has been loaded, at the time the window.onload event fires contentscriptoptions read-only value ex
posed to content scripts under self.options property.
... for the widget view is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the widget view has been loaded, at the time the window.onload event fires contentscriptoptions read-only value ex
posed to content scripts under self.options property.
lang/functional - Archive of obsolete content
com
pose(fn...) returns the composition of a list of functions, where each function consumes the return value of the function that follows.
... let { com
pose } = require("sdk/lang/functional"); let welcome = com
pose(exclaim, greet); welcome('moe'); // "hi: moe!"; function greet (name) { return "hi: " + name; } function exclaim (statement) { return statement + "!"; } parameters fn...
... : function takes a variable number of functions as arguments and com
poses them from right to left.
... returns function : the com
posed function.
StringView - Archive of obsolete content
for custom cycles, look at the example pro
posed here.
...this function will recom
pose all these parts into a codepoint.
...this function will recom
pose all these parts into a codepoint.
... stringview has been pro
posed as strawman for es2015 on ecmascript bugs.
Adding sidebars - Archive of obsolete content
for this pur
pose we'll also look at some handy xul elements in this section.
...for instance, you could have a window that is used for two different pur
poses, and the only difference between the two cases is a label that has a value in one case and something else in another.
...the alternative is to use a deck with the two labels, and change the selected index depending on the pur
pose of the window.
...it allows you to decom
pose complex ui into individual layers, broadening the layout possibilities.
The Essentials of an Extension - Archive of obsolete content
as we saw in the directory structure of the unpacked extension, the chrome is com
posed of 3 sections: content, locale and skin.
... the chrome as mentioned earlier, the chrome is com
posed of 3 sections: content, locale and skin.
...that's the pur
pose of the attribute: insertafter="appmenu_addons" appmenu_addons is the id of the menu element that corresponds to the add-ons menu item in the main menu.
... we'll see later how we can find out things like the ids of browser elements, but for now let's look at the elements that com
pose the hello world menu.
XPCOM Objects - Archive of obsolete content
firefox can be seen as com
posed of two layers.
...most of the objects and functions in the lower layers are hidden from the chrome; those that need to be publicized are ex
posed through xpcom components and interfaces.
...the ";1" at the end of the string is sup
posed to indicate the version of the component, although it shouldn't change much.
...the pur
pose of this code is to register the component so that you can get references to it just like all other firefox components.
Images, Tables, and Mysterious Gaps - Archive of obsolete content
obviously most designs are a touch more complicated than this, but we don't need anything more for our pur
poses.
...there isn't sup
posed to be, since it's an example of how browsers have traditionally behaved.
...there have been many proposals to fix the problem, but one of the most promising approaches is the property line-box-contain, which has been pro
posed for inclusion in css3.
... should this property be adopted, then any browser supporting it could emulate traditional "shrinkwrap" behavior without risking other layout upset with the following rule: td {line-box-contain: font replaced;} /* pro
posed for css3 */ there are other possible fixes contained within the current css3 working drafts, such as line-height-policy.
jspage - Archive of obsolete content
e.version<420)?"innerhtml":"value"}; var c=function(l){return(f[l]||(f[l]={}));};var g=function(n,l){if(!n){return;}var m=n.uid;if(browser.engine.trident){if(n.clearattributes){var q=l&&n.clonenode(false); n.clearattributes();if(q){n.mergeattributes(q);}}else{if(n.removeevents){n.removeevents();}}if((/object/i).test(n.tagname)){for(var o in n){if(typeof n[o]=="function"){n[o]=$empty; }}element.dis
pose(n);}}if(!m){return;}h[m]=f[m]=null;};var d=function(){hash.each(h,g);if(browser.engine.trident){$a(document.getelementsbytagname("object")).each(g); }if(window.collectgarbage){collectgarbage();}h=f=null;};var j=function(n,l,s,m,p,r){var o=n[s||l];var q=[];while(o){if(o.nodetype==1&&(!m||element.match(o,m))){if(!p){return document.id(o,r); }q.push(o);}o=o[l];}return(p)?new elements(q,{ddup:false,c...
....mergeattributes(u);v.removeattribute("uid");if(v.options){var w=v.options,s=u.options;for(var t=w.length;t--;){w[t].selected=s[t].selected;}}}var x=i[u.tagname.tolowercase()]; if(x&&u[x]){v[x]=u[x];}};if(o){var p=r.getelementsbytagname("*"),q=this.getelementsbytagname("*");for(var m=p.length;m--;){n(p[m],q[m]);}}n(r,this);return document.id(r); },destroy:function(){element.empty(this);element.dis
pose(this);g(this,true);return null;},empty:function(){$a(this.childnodes).each(function(l){element.destroy(l); });return this;},dis
pose:function(){return(this.parentnode)?this.parentnode.removechild(this):this;},haschild:function(l){l=document.id(l,true);if(!l){return false; }if(browser.engine.webkit&&browser.engine.version<420){return $a(this.getelementsbytagname(l.tagname)).contains(l);}return(this...
...omready={onadd:function(a){if(browser.loaded){a.call(this);}}};(function(){var b=function(){if(browser.loaded){return;}browser.loaded=true; window.fireevent("domready");document.fireevent("domready");};window.addevent("load",b);if(browser.engine.trident){var a=document.createelement("div"); (function(){($try(function(){a.doscroll();return document.id(a).inject(document.body).set("html","temp").dis
pose();}))?b():arguments.callee.delay(50);})(); }else{if(browser.engine.webkit&&browser.engine.version<525){(function(){(["loaded","complete"].contains(document.readystate))?b():arguments.callee.delay(50); })();}else{document.addevent("domcontentloaded",b);}}})();var json=new hash(this.json&&{stringify:json.stringify,parse:json.parse}).extend({$specialchars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f"...
...ptions.path; }if(this.options.duration){var a=new date();a.settime(a.gettime()+this.options.duration*24*60*60*1000);b+="; expires="+a.togmtstring();}if(this.options.secure){b+="; secure"; }this.options.document.cookie=this.key+"="+b;return this;},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escaperegexp()+"=([^;]*)"); return(a)?decodeuricomponent(a[1]):null;},dis
pose:function(){new cookie(this.key,$merge(this.options,{duration:-1})).write("");return this;}});cookie.write=function(b,c,a){return new cookie(b,a).write(c); };cookie.read=function(a){return new cookie(a).read();};cookie.dis
pose=function(b,a){return new cookie(b,a).dis
pose();};var swiff=new class({implements:[options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"hi...
A XUL Bestiary - Archive of obsolete content
the pur
pose of this article is not to describe these items in any great detail but to define what they are in simple terms.
...menus, toolbars, buttons, and scrollbars are widgets, and so are such general pur
pose pieces as boxes and springs.
...there are, unfortunately, different document object models corresponding to different types of documents and also to different proprietary notions about what in a document should be ex
posed programmatically.
... in briefest terms, xul is the xml-based language used for creating interfaces, xptoolkit is the set of xul widgets (menus, toolbar, etc.) actually assembed for this pur
pose -- the building blocks of the interface, as it were -- and xpfe, the cross platform front end, is the front end that has been created from xptoolkit.
Custom toolbar button - Archive of obsolete content
you can use this page if all you really want is a button for some special pur
pose.
...e following content, and paste it into the new file: content custombutton chrome/ style chrome://global/content/customizetoolbar.xul chrome://custombutton/content/button.css # firefox overlay chrome://browser/content/browser.xul chrome://custombutton/content/button.xul # thunderbird mail overlay chrome://messenger/content/messenger.xul chrome://custombutton/content/button.xul # thunderbird com
pose overlay chrome://messenger/content/messengercom
pose/messengercom
pose.xul chrome://custombutton/content/button.xul # thunderbird address book overlay chrome://messenger/content/addressbook/addressbook.xul chrome://custombutton/content/button.xul # sunbird overlay chrome://calendar/content/calendar.xul chrome://custombutton/content/button.xul optionally remove the sections for toolbars that you...
...eymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://custombutton/content/button.js"/> <!-- firefox --> <toolbarpalette id="browsertoolbarpalette"> <toolbarbutton id="custom-button-1"/> </toolbarpalette> <!-- thunderbird mail --> <toolbarpalette id="mailtoolbarpalette"> <toolbarbutton id="custom-button-1"/> </toolbarpalette> <!-- thunderbird com
pose --> <toolbarpalette id="msgcom
posetoolbarpalette"> <toolbarbutton id="custom-button-1"/> </toolbarpalette> <!-- thunderbird address book --> <toolbarpalette id="addressbooktoolbarpalette"> <toolbarbutton id="custom-button-1"/> </toolbarpalette> <!-- sunbird --> <toolbarpalette id="calendartoolbarpalette"> <toolbarbutton id="custom-button-1"/> </toolbarpalette> <!-- button details ...
... note: the preference setting javascript.options.strict im
poses restrictions that are not appropriate for the simple scripts in this tutorial.
TCP/IP Security - Archive of obsolete content
tcp/ip communications are com
posed of four layers that work together.
... at each layer, the logical units are typically com
posed of a header and a payload.
... one example is secure multipur
pose internet mail extensions (s/mime), which is commonly used to encrypt email messages.
... an internet-based connection is typically com
posed of several physical links chained together; protecting such a connection with data link layer controls would require deploying a separate control to each link, which is not feasible.
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
we leverage some of these ideas to help you make your netscape communicator 4.x plugins ex
posed to javascript in mozilla based browsers.
... *aclassidnoalloc) {return ns_error_not_implemented;} }; class nsscriptablepeer : public nsitestplugin, public nsclassinfomixin { public: nsscriptablepeer(); ~nsscriptablepeer(); ns_decl_isupports ns_decl_nsitestplugin }; nsscriptablepeer::nsscriptablepeer() { ns_init_isupports(); } nsscriptablepeer::~nsscriptablepeer() { } // notice that we ex
pose our claim to implement nsiclassinfo.
...npp_getvalue implementation and possible scenario of scriptable object life cycle #include "nsitestplugin.h" nperror npp_new(npmimetype plugintype, npp instance, uint16 mode, int16 argc, char* argn[], char* argv[], npsaveddata* saved) { if(instance == null) return nperr_invalid_instance_error; // just prime instance->pdata with null for the pur
pose of this example // it will be assigned to the scriptable interface later to keep its // association with the specific plugin instance instance->pdata = null; return rv; } nperror npp_getvalue(npp instance, nppvariable variable, void *value) { if(instance == null) return nperr_invalid_instance_error; nperror rv = nperr_no_error; static nsiid scriptableiid = ns...
...for the pur
pose of this example to keep things simple // we just assign it to instance->pdata after we create it.
HTML: A good basis for accessibility - Learn web development
previous overview: accessibility next a great deal of web content can be made accessible just by making sure the correct hypertext markup language elements are used for the correct pur
pose at all times.
...this means using the correct html elements for their intended pur
pose as much as possible.
... html5 includes two new elements — <figure> and <figcaption> — which are sup
posed to associate a figure of some kind (it could be anything, not necessarily an image) with a figure caption: <figure> <img src="dinosaur.png" alt="the mozilla tyrannosaurus"> <figcaption>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.</figcaption> </figure> unfortunately, most screen readers don't seem ...
... empty alt attributes <h3> <img src="article-icon.png" alt=""> tyrannosaurus rex: the king of the dinosaurs </h3> there may be times where an image is included in a page's design, but its primary pur
pose is for visual decoration.
HTML: A good basis for accessibility - Learn web development
previous overview: accessibility next a great deal of web content can be made accessible just by making sure the correct hypertext markup language elements are used for the correct pur
pose at all times.
...this means using the correct html elements for their intended pur
pose as much as possible.
... html5 includes two new elements — <figure> and <figcaption> — which are sup
posed to associate a figure of some kind (it could be anything, not necessarily an image) with a figure caption: <figure> <img src="dinosaur.png" alt="the mozilla tyrannosaurus"> <figcaption>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.</figcaption> </figure> unfortunately, most screen readers don't seem ...
... empty alt attributes <h3> <img src="article-icon.png" alt=""> tyrannosaurus rex: the king of the dinosaurs </h3> there may be times where an image is included in a page's design, but its primary pur
pose is for visual decoration.
Test your skills: Flexbox - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
Test your skills: Grid Layout - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the code below to create your example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
What is JavaScript? - Learn web development
in this article we will look at javascript from a high level, answering questions such as "what is it?" and "what can you do with it?", and making sure you are comfortable with javascript's pur
pose.
...we can mark it up using html to give it structure and pur
pose: <p>player 1: chris</p> then we can add some css into the mix to get it looking nice: p { font-family: 'helvetica neue', helvetica, sans-serif; letter-spacing: 1px; text-transform: uppercase; text-align: center; border: 2px solid rgba(0,0,200,0.6); background: rgba(0,0,200,0.3); color: rgba(0,0,200,0.6); box-shadow: 1px 1px 2px rgba(0,0,200,0.4); border-radius: 10px; padd...
... browser apis are built into your web browser, and are able to ex
pose data from the surrounding computer environment, or do useful complex things.
...the code we used above to serve this pur
pose looks like this: const buttons = document.queryselectorall('button'); for(let i = 0; i < buttons.length ; i++) { buttons[i].addeventlistener('click', createparagraph); } this might be a bit longer than the onclick attribute, but it will work for all buttons — no matter how many are on the page, nor how many are added or removed.
Getting started with React - Learn web development
these components can be com
posed together to create a full ui, and react abstracts away much of the rendering work, leaving you to concentrate on the ui design.
... sup
pose we wanted to wrap our heading in a <header> tag, for semantic reasons?
...these parts can be big or small, but they are usually clearly defined: they serve a single, obvious pur
pose.
...this is the same as the class attribute in html, but because jsx is javascript, we can't use the word class — it's reserved, meaning javascript already uses it for a specific pur
pose and it would cause problems here in our code.
Multiprocess on Windows
one of the better pieces of documentation is a two-part series written by jeff prosise: understanding com apartments, part i understanding com apartments, part ii for the pur
poses of this document, "com" will refer to microsoft com (as op
posed to xpcom).
...the windows message queue carries a lot of baggage for the pur
poses of maintaining backward compatibility.
...unfortunately, crossing apartment boundaries using com incurs the exact same problem as crossing process boundaries: if we directly use com's built in marshaling capabilities to forward an rpc from the mta to the main thread sta, com will still use the sta's message queue, thus defeating the pur
pose of using the mta in the first place!
... using the interceptor in a11y code unlike the built in com marshaling schemes, we must explicitly wrap any com objects that we want to ex
pose, through the mta with interceptors.
Displaying Places information using views
this is useful when you need the id for another pur
pose or when a treecol is contained in anonymous content, as in xbl.
... the built-in tree view is provided as a general-pur
pose convenience.
...it's not so useful for our pur
poses here.
... fortunately you can commandeer parts of the built-in tree view to suit your pur
poses.
Firefox UI considerations for web developers
rich icons the high resolution icons—also known as rich icons—are specified by setting the rel attribute to one of: apple-touch-icon apple-touch-icon-precom
posed fluid-icon the size of each icon is taken from the size attribute specified on the <link>, if it's provided.
... apple-touch-icon and apple-touch-icon-precom
posed icons with no size attribute are assumed to be the standard classic iphone size of 57x57 pixels.
... hootsuite the html on hootsuite's site looks roughly like this: <link rel="shortcut icon" href="/dist/images/icons/favicon.ico"> <link rel="apple-touch-icon-precom
posed" href="/dist/images/icons/apple-touch-icon.png"> <link rel="apple-touch-icon-precom
posed" sizes="72x72" href="/dist/images/icons/apple-touch-icon_72.png"> <link rel="apple-touch-icon-precom
posed" sizes="114x114" href="/dist/images/icons/apple-touch-icon@2x.png"> firefox starts by looking for an svg icon; there is none.
...here, there are three of them, each specified as apple-touch-icon-precom
posed.
source-editor.jsm
the source-editor.jsm javascript code module implements an editor specifically tailored for editing source code; its primary pur
pose is to provide support for web developer tools to display and edit web site code.
...its functionality is all ex
posed through source-editor.jsm.
...the source editor code module loads a module by the name "source-editor-<component>.jsm" and ex
poses its api as part of the sourceeditor object.
...all changes made to the text between the two calls is considered to be a single edit for the pur
poses of undo operations.
Localization content best practices
for example, sup
pose this string needs to be changed from "event" to "add new event": new-event-header = event add-new-event-header is definitely a better choice for the new string than new-event-header1.
... don't forget to add a localization note when: part of the string is not sup
posed to be localized (for example, the name of an html attribute in a warning).
...if you already know that your strings are temporary, they shouldn't be ex
posed to the localization process.
... unless there are significant savings of translation volume involved, it is usually easier and quicker for translators to handle these as fixed strings rather than com
posed strings, especially considering the time needed for locating, checking and potentially fixing com
posed strings.
Intel Power Gadget
these are reasonably useful for power profiling pur
poses, but mozilla's rapl utility provides these along with gpu and ram estimates, and in a command-line format that is often easier to use.
...these measurements aren't particularly useful for power profiling pur
poses.
...this is interesting, but again not useful for power profiling pur
poses.
... (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 ex
poses an api from which the same measurements can be extracted programmatically.
NSPR Contributor Guide
new features for pur
poses of this paper, a "new feature" is defined as some api addition that goes into the core nspr library, for example: libnspr4.dll nspr is mostly complete.
...your pro
posed api should encapsulate a relatively low level capability as would be found in a system call or libc.
...when you consider a new api for nspr ask yourself if your pro
posed feature can implement it across all platforms supported by nspr.
...for pur
poses of this paper, a "new library" is defined as a libary under the mozilla/nsprpub/lib directory tree and built as a separate library.
NSS API Guidelines
cmmf no longer exists as a pro
posed standard; cmmf functions have been incorporated into the proposal for certificate management protocols (cmp).
... structure members for ex
posed data structures should have the form capitalizedenglishwords (the first letter uncapitalized).
...there seem to be three reasonable options: enum members have the same standard as ex
posed data structure members.
...so here are some guidelines to make them more manageable: all callback operating search functions should be in the low level of the api, if ex
posed at all.
Hacking Tips
to where you came from with the following set of gdb commands: (gdb) record full (gdb) si (gdb) record goto 0 (gdb) record stop if you have a core file, you can use the gdb unwinder the same way, or do everything from the command line as follow: $ gdb -ex 'enable unwinder .* spidermonkey' -ex 'bt 0' -ex 'thread apply all backtrace' -ex 'quit' out/dist/bin/js corefile the gdb unwinder is sup
posed to be loaded by dist/bin/js-gdb.py and load python scripts which are located in js/src/gdb/mozilla under gdb.
... (gdb) x /64a $sp […] 0x7fffffff9838: 0x7ffff7fad2da 0x141 0x7fffffff9848: 0x7fffef134d40 0x2 […] (gdb) p (*(jsfunction**) 0x7fffffff9848)->u.i.script_->lineno $1 = 1 (gdb) p (*(jsfunction**) 0x7fffffff9848)->u.i.script_->filename $2 = 0xff92d1 "typein" the stack is order as defined in js/src/ion/ionframes-x86-shared.h, it is com
posed of the return address, a descriptor (a small value), the jsfunction (if it is even) or a jsscript (if the it is odd, remove it to dereference the pointer) and the frame ends with the number of actual arguments (a small value too).
.../* open your png viewer with the result of iongraph */ this gdb instrumentation is sup
posed to work with debug builds, or with optimized build compiled with --enable-jitspew configure flag.
...gdb does not ex
pose // enough information to restrict the watchpoint to just a single bit.
JS_DumpHeap
enum jsgctracekind { // these trace kinds have a publicly ex
posed, although opaque, c++ type.
... jstrace_object = 0x00, jstrace_string = 0x01, jstrace_symbol = 0x02, jstrace_script = 0x03, // shape details are ex
posed through js_traceshapecyclecollectorchildren.
... jstrace_outofline = 0x07, // the following kinds do not have an ex
posed c++ idiom.
...not all of the matching c++ types are ex
posed, and those that are, are opaque.
How to build an XPCOM component in JavaScript
implementation this example component will ex
pose a single method, which returns the string "hello world!".
... defining the interface if you want to use your component in other xpcom components, you must define the interfaces that you want ex
posed.
...using the generateqi helper (remove argument if skipped steps above) queryinterface: xpcomutils.generateqi([components.interfaces.nsihelloworld]), // optional, but required if you want your component to be ex
posed to dom classinfo: xpcomutils.generateci({classid: components.id("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"), contractid: "@dietrich.ganx4.com/helloworld;1", interfaces: [ci.nsihelloworld], flags: ci.nsiclassinfo.dom_object}), // ...component implementation...
... // define the function we want to ex
pose in our interface hello: function() { return "hello world!"; }, }; xpcomutils does the work of creating the module and factory for you after this.
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 ex
posed to embedders and component developers, so the apis are not ready to be published.
... the danger of using unfrozen interfaces sup
pose that you need to use the interface nsifoo that isn't frozen.
...moreover, since this interface was never sup
posed to be used by clients other than gecko or mozilla, the maintainers of the interface don't know that it's being used, and don't change the iid of the interface.
...an interface reaches this state when a group of module owners and peers are actively engaged in discussion about how best to ex
pose it.
XPCOM Stream Guide
complex input stream types type pur
pose native class contract id interface how to bind to a primitive input stream multiplex concatenate multiple input streams into one.
... nsmimeinputstream @mozilla.org/network/mime-input-stream;1 nsimimeinputstream .setdata(stream) similarly, there are complex output streams which build from primitive output streams: complex output stream types type pur
pose native class contract id interface how to bind to a primitive output stream buffered store data in a buffer until the buffer is full or the stream closes.
... (xxx nsiunicharinputstream interface) (xxx nsiunicharlineinputstream interface) (xxx nsisearchableinputstream interface) stream converters (tbd: @mozilla.org/streamconverters;1) forcing an input stream to be read sup
pose you already have an input stream, and something to read from that input stream...but the reader doesn't do anything with the stream.
... sup
pose that reader also implements nsistreamlistener.
XUL Overlays
since one of the main pur
poses of overlays is to provide ui for additions or components to the basic package, explicit loading can be somewhat problematic when the overlay defines optional ui elements.
...because an overlay is superim
posed on the master document, there are no ambiguities relating to scoping of style sheets or scripts.
...since the pur
pose of an overlay is to define new ui elements for a package within the context of that package's skin, the overlay should add structure but not new style.
...in the base file, the html image element points to a netscape gif icon: <html:img id="foo" src="netscapeimage.gif"/> in the overlay, an element with the same id attribute specifies a different image, and that image is superim
posed on top of the original netscape image as part of the merge process: <html:img id="foo" src="mozillaimage.gif"/> when the base file references an overlay file which contains the html image element above, the new src attribute is superim
posed over the original, and the mozilla icon replaces the netscape icon.
Mozilla
a bird's-eye view of the mozilla framework the pur
pose of this article is to provide a high-level technical overview of the architecture of the extensible, object-based mozilla application framework.
... how test harnesses work mozilla test harnesses are typically com
posed of a python runner that invokes firefox, utilizes the browser to run tests, and reports the results.
... javascript tips javascript-dom prototypes in mozilla when a dom node is accessed from javascript in mozilla, the native c++ dom node is wrapped using xpconnect and the wrapper is ex
posed to javascript as the javascript representation of the dom node.
...all the methods that are sup
posed 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).
HTMLImageElement.alt - Web APIs
there are separate attributes and elements designed for those pur
poses.
...r; } .left-margin img { width: 6em; } .contents { background-color: rgb(241, 240, 235, 255); height: 100%; margin-left: 2em; padding-top: 1em; padding-left: 2em; padding-right: 1em; } result images used as buttons when using an image as a button (by using it as the only visible child of an <a> element representing a hyperlink), the alt attribute must be used to convey the pur
pose of the button.
... in other words, it should be the same text you would use in a textual button to serve the same pur
pose.
... in this example, a starburst image with the word "new!" is used to indicate that an article is about something new (and probably sup
posedly also exciting).
Using the Payment Request API - Web APIs
tions invoked inside the constructor simply return the required object parameters: function buildsupportedpaymentmethoddata() { // example supported payment methods: return [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard'], supportedtypes: ['debit', 'credit'] } }]; } function buildshoppingcartdetails() { // hardcoded for demo pur
poses: return { id: 'order-123', displayitems: [ { label: 'example item', amount: {currency: 'usd', value: '1.00'} } ], total: { label: 'total', amount: {currency: 'usd', value: '1.00'} } }; } starting the payment process once the paymentrequest object has been created, you call the paymentrequest.show() method on it to initiate the pay...
...for this demo, simulate immediate success: paymentresponse.complete('success') .then(function() { // for demo pur
poses: intropanel.style.display = 'none'; successpanel.style.display = 'block'; }); }) this object provides the developer with access to details they can use to complete the logical steps required after the payment completes, such as an email address to contact the customer, a shipping address for mailing goods out to them, etc.
...for this demo, simulate immediate success: paymentresponse.complete('success') .then(function() { // for demo pur
poses: intropanel.style.display = 'none'; successpanel.style.display = 'block'; }); }).catch(function(error) { if (error.code == domexception.not_supported_err) { window.location.href = 'https://bobpay.xyz/#download'; } else { // other kinds of errors; cancelled or failed payment.
... for demo pur
poses: intropanel.style.display = 'none'; legacypanel.style.display = 'block'; } }); }); note: see our recommending a payment app when user has no apps demo for the full code.
RTCIceCandidate.address - Web APIs
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 ex
pose more information about the source of the remote peer than the user expects.
...it can also be used for fingerprinting pur
poses.
... the candidate ip addresses are always ex
posed to the application through address, and unsavory applications can in turn potentially reveal the address to the user.
...doing so prevents the remote user's address from being ex
posed, but reduces the pool of available candidates to choose from.
WebRTC connectivity - Web APIs
this description includes all the information about the caller's pro
posed configuration for the call.
...because during renegotiation, an offer might be rejected because it pro
poses an incompatible format, it's necessary that each endpoint have the ability to pro
pose a new format but not actually switch to it until it's accepted by the other peer.
...once the pro
posed description has been agreed upon, the value of currentlocaldescription or currentremotedescription is changed to the pending description, and the pending description is set to null again, indicating that there isn't a pending description.
...typically, each peer will pro
pose its best candidates first, making their way down the line toward their worse candidates.
Signaling and video calling - Web APIs
candidate the sdp candidate string, describing the pro
posed connection method.
... note: obviously, it would be more efficient to update the list by adding and removing individual users instead of rebuilding the whole list every time it changes, but this is good enough for the pur
poses of this example.
... once the rtcpeerconnection has been created, we request access to the user's camera and microphone by calling mediadevices.getusermedia(), which is ex
posed to us through the navigator.mediadevices.getusermedia property.
...our example doesn't use this for anything, but it can be useful to watch these events for debugging pur
poses, as well as to detect when candidate collection has finished.
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 im
posed by the real world.
... introduction a bounded reference space is one which represents an xr environment in which the user is able to move around physically in the real world while being tracked by the xr hardware, with their movements being then trans
posed into the simulation.
... requirements because a bounded reference space establishes a limited area in which the user can move, it naturally im
poses a limit on how large the simulated environment can be.
....then(onrefspacecreated) .catch(() => { spacetype = "local-floor"; xrsession.requestreferencespace(spacetype) .then(onrefspacecreated) .catch(handleerror); }); } function onrefspacecreated(refspace) { xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl) }); // now set up matrices, create a secondary reference space to // transform the viewer's
pose, and so forth.
Geometry and reference spaces in WebXR - Web APIs
this two cubic meter space encompasses the entire universe for the pur
poses of your code.
... once created, an xrreferencespace guarantees a certain level of support for motion and orientation tracking, and provides a mechanism for obtaining an xrviewer
pose from which you can get a matrix which represents the position and facing direction of the space relative to the world space, if the space represents a viewer such as the user's headset, an observer's headset, or a virtual camera.
... the primary reference space types the viewer reference space corresponds to the viewer's position in space; it's used by the xrviewer
pose returned by the xrframe method getviewer
pose().
...the reference space's configuration is then able to provide you with the view matrices and object
poses needed to correctly render the contents of the space.
XRRigidTransform.inverse - Web APIs
applying the inverse of a transform to any object previously transformed by the parent xrrigidtransform always undoes the transformation, resulting in the object returning to its previous
pose.
... examples in this example, the model view matrix for an object is computed by taking the view matrix and multiplying it by the object's
pose matrix.
... let modelviewmatrix = mat4.create(); for (let view of
pose.view) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); /* ...
...*/ } this outline of a renderer's core code shows how the
pose's view gets represented by taking its transform's inverse's matrix as the model view matrix used to transform objects based on the viewer's position and orientation.
XRView.transform - Web APIs
the read-only transform property of the xrview interface is an xrrigidtransform object which provides the position and orientation of the viewpoint relative to the xrreferencespace specified when the xrframe.getviewer
pose() method was called to obtain the view object.
... const modelviewmatrix = mat4.create(); const normalmatrix = mat4.create(); for (let view of
pose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); for (let obj of world.objects) { mat4.multiply(modelviewmatrix, view.transform.inverse.matrix, obj.matrix); mat4.invert(normalmatrix, modelviewmatrix); mat4.trans
pose(normalmatrix, normalmatrix); obj.render(modelviewmatrix, normalmatrix); } } two mat...
... then we iterate over each xrview found in the xrviewer
pose's list of views.
...currently, webxr doesn't support more than two views per
pose, although room has been left to extend the specification to support that in the future with some additions to the api.
Perceivable - Accessibility
ui controls such as form elements and buttons should have text labels that describe their pur
pose.
... understanding orientation 1.3.5 identify input pur
pose (aa) added in 2.1 follow the list of 53 input fields to programmatically identify the pur
pose of a field.
... understanding identify input pur
pose 1.3.6 identify pur
pose (aaa) added in 2.1 in content implemented using markup languages, the pur
pose of user interface components, icons, and regions can be programmatically determined.
... understanding identify pur
pose note: also see the wcag description for guideline 1.3: adaptable: create content that can be presented in different ways without losing information or structure.
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
headings use size to indicate their relative importance, but css is preferred for general-pur
pose resizing.
...it makes logical sense — <h1> is the most important heading, and tells you what the pur
pose of the overall page is.
... sectioning content can be labeled using a combination of the aria-labelledby and id attributes, with the label concisely describing the pur
pose of the section.
...if labels were not provided, the person using screen reading software may have to investigate each nav element's contents to determine their pur
pose.
<img>: The Image Embed element - HTML: Hypertext Markup Language
there are many other attributes to achieve various pur
poses: referrer/cors control for security and privacy: see crossorigin and referrerpolicy.
...for example, (max-height: 500px) 1000px pro
poses to use a source of 1000px width, if the viewport is not higher than 500px.
...each string is com
posed of: a url to an image optionally, whitespace followed by one of: a width descriptor (a positive integer directly followed by w).
...if the alt attribute is pur
posefully left off because the image has no textual equivalent, consider alternate methods to present what the image is trying to communicate.
HTTP Index - HTTP
it was designed for communication between web browsers and web servers, but it can also be used for other pur
poses.
... 9 mime types (iana media types) content-type, guide, http, mime types, meta, request header, response header, application/javascript, application/json, application/xml a media type (also known as a multipur
pose internet mail extensions or mime type) is a standard that indicates the nature and format of a document, file, or assortment of bytes.
... 55 access-control-allow-credentials access-control-allow-credentials, cors, http, reference, credentials, header the access-control-allow-credentials response header tells browsers whether to ex
pose the response to frontend javascript code when the request's credentials mode (request.credentials) is include.
... 59 access-control-ex
pose-headers cors, http, reference, header the access-control-ex
pose-headers response header indicates which headers can be ex
posed as part of the response by listing their names.
Indexed collections - JavaScript
sup
pose you define the following array: let myarray = ['wind', 'rain', 'fire'] you can refer to the first element of the array as myarray[0], the second element of the array as myarray[1], etc… the index of the elements begins with zero.
... reverse() trans
poses the elements of an array, in place: the first array element becomes the last and the last becomes the first.
... let myarray = new array('1', '2', '3') myarray.reverse() // trans
poses the array so that myarray = ["3", "2", "1"] sort() sorts the elements of an array in place, and returns a reference to the array.
... isnumber(value) { return typeof value === 'number' } let a1 = [1, 2, 3] console.log(a1.some(isnumber)) // logs true let a2 = [1, '2', 3] console.log(a2.some(isnumber)) // logs true let a3 = ['1', '2', '3'] console.log(a3.some(isnumber)) // logs false reduce(callback[, initialvalue]) applies callback(accumulator, currentvalue[, currentindex[, array]]) for each value in the array for the pur
pose of reducing the list of items down to a single value.
Working with objects - JavaScript
for example, sup
pose you want to create an object type for cars.
...for example, sup
pose you define an object called person as follows: function person(name, age, sex) { this.name = name; this.age = age; this.sex = sex; } and then instantiate two new person objects as follows: var rand = new person('rand mckinnon', 33, 'm'); var ken = new person('ken jones', 39, 'm'); then, you can rewrite the definition of car to include an owner property that takes a person object, as f...
...for example, sup
pose you have 2 objects, managerand intern.
...o.c = 50; // <-- at this point the set c(x) method is initiated console.log(o.a); // 25 the o object's properties are: o.a — a number o.b — a getter that returns o.a plus 1 o.c — a setter that sets the value of o.a to half of the value o.c is being set to please note that function names of getters and setters defined in an object literal using "[gs]et property()" (as op
posed to __define[gs]etter__ ) are not the names of the getters themselves, even though the [gs]et propertyname(){ } syntax may mislead you to think otherwise.
Classes and Inheritance - Archive of obsolete content
however, to fully appreciate how class works, and the problem it is sup
posed to solve, it is recommended that you read the entire article.
...to illustrate this, let's add a member function to the class shape: shape.prototype.draw = function () { throw error("not yet implemented"); } let shape = shape(2, 3); shape.draw(); // => error: not yet implemented inheritance and constructors sup
pose we want to create a new class, circle, and inherit it from shape.
...the constructor property is sup
posed to be non-configurable, non-enumberable, and non-writable, so the correct way to define it is as follows: circle.prototype = object.create(shape.prototype, { constructor: { value: circle } }); overriding methods as a final example, we show how to override the stub implementation of the method draw in shape with a more specialized one in circle.
Private Properties - Archive of obsolete content
however, the use of an underscore prefix is just a coding convention and is not enforced by the language: there is nothing to prevent a user from directly accessing a property that is sup
posed to be private.
...before explaining how weakmaps work, the following looks at how ordinary objects can be used as hash maps, by creating a simple image cache: let images = {}; function getimage(name) { let image = images[name]; if (!image) { image = loadimage(name); images[name] = image; } return image; } now sup
pose there's a need to associate a thumbnail with each image.
...among other things, add-ons should not be able to access variables that are sup
posed to be private.
XUL Migration Guide - Archive of obsolete content
for example, action buttons appear by default in the main firefox toolbar (although users may relocate them by toolbar customization) because it makes for a better user experience for add-ons to ex
pose their interfaces in a consistent way.
... similarly, the supported apis ex
pose only a small fraction of the full range of xpcom functionality.
... using the low-level apis in addition to the high-level apis, the sdk includes a number of low-level apis some of which, such xhr and window/utils, ex
pose powerful browser capabilities.
core/promise - Archive of obsolete content
}); consuming promises in general, the whole pur
pose of promises is to avoid the so-called callback spaghetti.
...module exports promised function to do exactly that: const { promised } = require('sdk/core/promise'); function sum(x, y) { return x + y }; var asyncsum = promised(sum); var c = sum(a, b); var casync = asyncsum(aasync(), basync()); promised takes normal function and com
poses new promise-aware version of it.
... the com
posed function may take both normal values and promises as arguments and returns promise.
ui/sidebar - Archive of obsolete content
once you've finished using the sidebar you can destroy it by calling its dis
pose() method.
...once a sidebar is no longer needed it can be destroyed using dis
pose().
... methods dis
pose() destroys the sidebar.
cfx to jpm - Archive of obsolete content
the id is used for a variety of pur
poses.
... requiring local modules sup
pose your add-on is structured into separate modules: my-addon lib main.js utils.js when you want to use the "utils" module in "main.js", you should use a path relative to "main.js", and prefix the path with "./" to indicate that it's a relative path: var utils = require("./utils"); however, with cfx you are also allowed to omit the "./": var utils = require(...
... requiring modules from test code similarly, sup
pose you've written some tests for your add-on: my-addon lib my-addon.js test test-my-addon-js with cfx, code inside "test-my-addon.js" can import "my-addon.js" using a statement like this: var my_addon = require("my-addon"); // this will not work with jpm!
Localization - Archive of obsolete content
s: use the .properties format are named "xx-yy.properties", where "xx-yy" is the name of the locale in question contain one entry for each string you want to localize, consisting of an identifier for the string and its translation in that locale, in the format identifier=translation need to use utf-8 without bom encoding lines starting with "#" (after optional whitespace) are comments sup
pose your add-on contains a single localizable string, represented in english as "hello!", and you want to supply us english and french french localizations.
... for example, sup
pose we want to include a localized string naming a person's home town.
... for example, sup
pose your "package.json" defines a single preference: { "preferences": [ { "type": "string", "name": "monster_name", "value": "gerald", "title": "name" } ], "name": "monster-builder", "license": "mpl 2.0", "author": "me", "version": "0.1", "title": "monster builder", "id": "monster-builder@me.org", "de...
Handling Preferences - Archive of obsolete content
firefox ex
poses its most common high-level preferences through the preferences window and other parts of its ui.
... note: the pur
pose of the defaults directory is to hold non-code files your extension needs.
...the element and its children are completely invisible, and their pur
pose is to list the preferences to be used in the window/pane.
CSS3 - Archive of obsolete content
detection of ecmascript support, using the script media features is also pro
posed.
... stable modules a few css modules are already fairly stable and have reached one of the three recommendation level of the csswg: candidate recommendation, pro
posed recommendation or recommendation.
... css writing modes module level 3 pro
posed recommendation defines the writing modes of both horizontal and vertical scripts and clarifies how the css direction and unicode-bidi properties interact with the new css text-orientation property, and extends them where needed.
MMgc - Archive of obsolete content
unmanaged memory mmgc is not only a garbage collector, but a general-pur
pose memory manager.
...gcweakref can be used for this pur
pose.
...the following flash animation illustrates the working of a mark/sweep collector: (temporarily not working) <gflash>600 300 gc.swf</gflash> one pass the mark sweep algorithm described above decom
poses into clearmarks/mark/finalize/sweep.
Dehydra Function Reference - Archive of obsolete content
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 pur
poses.
...builtin objects sys this.sys is a container for miscellaneous properties ex
poses by dehydra sys.gcc_version is a gcc version string sys.include_path ex
poses the search path used by include().
... the default value is the following directories: the directory of the dehydra script being processed the libs directory next to the gcc_dehydra.so plugin user script may add additional directories sys.aux_base_name ex
poses the base filename part of the file being compiled sys.frontend ex
poses the compiler frontend (e.g.
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
for all other pur
poses you should check for the feature you need rather than the browsers you think will support that feature.
...however, the issues usually lie in the apis that a browser ex
poses to javascript, such as the dom hooks.
...window.event : aevent; } </script> the properties and functions that the event object ex
poses are also often named differently in mozilla and internet explorer, as table 4 shows.
Prism - Archive of obsolete content
minimal user interface: a general-pur
pose browser ui is not necessary or appropriate for most web apps.
...we intend to pro
pose these extensions for inclusion in future versions of xulrunner.
...some simple objects and utilities are ex
posed to webapp scripts.
The new nsString class implementation (1999) - Archive of obsolete content
these should typically not be ex
posed to objects in other modules.
...the i18n folks will tell you it's better to use a wide string and convert to 1-byte forms for this pur
pose even though there is a performance penalty for doing so.
...i'm wondering if this is sufficient, namely, that a string can return it's own (shared) allocator for this pur
pose.
Using XPInstall to Install Plugins - Archive of obsolete content
error conde: " + err); return err; } installing to a secondary location for the pur
poses of solving the first install problem, it is necessary to install to a secondary location to ensure discoverability of the plugin by other netscape gecko browser in addition to the current browser.
...this is accomplished with the winreg object that is ex
posed to xpinstall.
...additionally, via the installtrigger object which is ex
posed in web pages, they can find out what the last version of the xpi package was.
The Joy of XUL - Archive of obsolete content
this
poses a significant problem in team environments because the skills required to develop these two parts are often satisfied by different people.
...but overlays can also be specified externally, enabling the designer to superim
pose them upon an application without changing the original source.
...it uses simple xul components like boxes, grids, and stacks to com
pose views for the weeks, days, and months.
Skinning XUL Files by Hand - Archive of obsolete content
since the pur
pose 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.
... thinking skins sometimes you can become so involved in the details of xul and mozilla's other xp tools that you can lose sight of what the pur
pose and impact of these technologies are.
... the pur
pose of this split between xul and its skins -- and between the global skin and whatever custom styles you might create -- is to enable the dynamic skinning of applications such as the mozilla browser.
Accessibility/XUL Accessibility Reference - Archive of obsolete content
this table is designed to show how to ex
pose text properly for various xul element types.
... firefox ex
poses the position, cardinality, and depth of each tree item through the accessible description fixme: exact format?
... treecell see tree treechildren see tree treecol see tree treecols see tree treeitem see tree treerow see tree elements that do not ex
pose anything to screen readers/have no discovered accessibility issues yet: arrowscrollbox bbox box grippy hbox menuseparator overlay page script spacer splitter stringbundle stringbundleset vbox window elements not processed yet: action binding bindings broadcaster broadcasterset conditions content dialog dialogheader editor listcell member observes preference preferences prefpane prefwindow resizer richlistbox richlistitem resizer rule scrollbar scrollbox scrollcorner separator template textn...
Using IO Timeout And Interrupt On NT - Archive of obsolete content
nt's <tt>cancelio()</tt> function would be ideal for this pur
pose.
...for example, sup
pose thread a and thread b call <tt>pr_accept()</tt> on the same socket, and they time out at the same time.
...sup
pose the file descriptor is intended to be used for the life time of the process, for example, the logging file, this is really not acceptable.
Array comprehensions - Archive of obsolete content
array comprehension was previously pro
posed to be standardized in ecmascript 2016, it provide a useful shortcut for constructing a new array based on the contents of another.
...here is a comprehension which selects only even numbers: var numbers = [1, 2, 3, 21, 22, 30]; var evens = [for (i of numbers) if (i % 2 === 0) i]; console.log(evens); // logs 2,22,30 filter() can be used for the same pur
pose: var evens = numbers.filter(i => i % 2 === 0); map() and filter() style operations can be combined into a single array comprehension.
... here is one that filters just the even numbers, then creates an array containing their doubles: var numbers = [1, 2, 3, 21, 22, 30]; var doubledevens = [for (i of numbers) if (i % 2 === 0) i * 2]; console.log(doubledevens); // logs 4,44,60 the square brackets of an array comprehension introduce an implicit block for scoping pur
poses.
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
the pur
pose of this document is to discuss and emphasize the importance of conforming to open technology standards that are external to the organization.
...when projects are pro
posed, they are evaluated to ensure compatibility with the overall business strategy.
...for example, if an organization is developing a web-based client, they may have to adhere to standards im
posed by these organizations: ansi (american national standards institute ) atsc (advanced television systems committee ) ieee (institute of electrical and electronics engineers ) ietf (internet engineering task force ) irtf (internet research task force ) iso (international standards organization ) itu (international telecommunication union ) oasis (organization for the advancement of struc...
The Business Benefits of Web Standards - Archive of obsolete content
strict html (as op
posed 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.
... search engine agents crawl the web to index it, but for ranking and indexing pur
poses they can only process text.
... using xhtml is a way to enter a set of standards com
posed of xml-based technologies, such as xml, xslt (transforming data), svg (animated graphics), mathml (describing mathematic expressions)...
Game monetization - Game development
the word itself acquired negative connotations after big companies focused on creating games, the main pur
pose 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 pur
pose.
... selling resources if you're a graphic designer, you can sell the assets from the games you've created, or something brand new exclusively for that pur
pose at online shops like envato market.
UDP (User Datagram Protocol) - MDN Web Docs Glossary: Definitions of Web-related terms
it has no handshaking dialogues, and thus ex
poses the user's program to any unreliability of the underlying network; there is no guarantee of delivery, ordering, or duplicate protection.
... if error-correction facilities are needed at the network interface level, an application may use the transmission control protocol (tcp) or stream control transmission protocol (sctp) which are designed for this pur
pose.
... udp is suitable for pur
poses 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.
Test your skills: The Box Model - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the example as displayed in the image: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
Test your skills: sizing - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the example as displayed in the image: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the example as displayed in the image: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
Test your skills: values and units - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the example as displayed in the image: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the example as displayed in the image: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
Test your skills: Writing Modes and Logical Properties - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the example as displayed in the image: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
Test your skills: floats - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
Introduction to CSS layout - Learn web development
the two values most important for our pur
poses when discussing layout are display: flex and display: grid.
...each label/input pair is wrapped in a <div>, for layout pur
poses.
... you'll notice that the caption paragraph has been given display: table-caption; — which makes it act like a table <caption> — and caption-side: bottom; to tell the caption to sit on the bottom of the table for styling pur
poses, even though the markup is before the <input> elements in the source.
Test your skills: Multicol - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
Practical positioning examples - Learn web development
</aside> to start with here we've got a <label> element and an <input> element — <label> elements are normally used to associate a text label with a form element for accessibility pur
poses (allowing a screen user to see what description goes with what form element).
... here we are going to use these elements for a slightly different pur
pose — another useful side effect of <label> elements is that you can click a checkbox's label to check the checkbox, as well as just the checkbox itself.
...this will work in ie9 and above (the smooth transition will work in ie10 and above.) this effect does have some concerns — this is a bit of an abuse of form elements, as they weren't intended for this pur
pose.
What is a Domain Name? - Learn web development
tlds tell users the general pur
pose of the service behind the domain name.
... the most generic tlds (.com, .org, .net) don't require web services to meet any particular criteria, but some tlds enforce stricter policies so it is clearer what their pur
pose is.
... for example: local tlds such as .us, .fr, or .se can require the service to be provided in a given language or hosted in a certain country — they are sup
posed to indicate a resource in a particular language or country.
Debugging HTML - Learn web development
this demo is deliberately written with some built-in errors for us to explore (the html markup is said to be badly-formed, as op
posed to well-formed).
...this is a bit more problematic, as it isn't easy to tell where the element is sup
posed to end.
... now let's look at the markup the browser has rendered, as op
posed to the markup in the source code.
From object to iframe — other embedding technologies - Learn web development
unsandboxed content can do way too much (executing javascript, submitting forms, popup windows, etc.) by default, you should im
pose all available restrictions by using the sandbox attribute with no parameters, as shown in our previous example.
... the <embed> and <object> elements the <embed> and <object> elements serve a different function to <iframe> — these elements are general pur
pose embedding tools for embedding multiple types of external content, which include plugin technologies like java applets and flash, pdf (which can be shown in a browser with a pdf plugin), and even content like videos, svg and images!
... </a> </p> </object> pdfs were a necessary stepping stone between paper and digital, but they
pose many accessibility challenges and can be hard to read on small screens.
Introduction to client-side frameworks - Learn web development
a brief history when javascript debuted in 1996, it added occasional interactivity and excitement to a web that was, up until then, com
posed of static documents.
...writing your whole application in javascript can make you lose sight of html and the pur
pose of its various tags, and lead you to produce an html document that is un-semantic and inaccessible.
...like frameworks, static site generators allow developers to write components that define common pieces of your web pages, and to com
pose those components together to create a final page.
Starting our Svelte Todo list app - Learn web development
further down, you can find the following <ul> element: <ul role="list" classname="todo-list stack-large" aria-labelledby="list-heading"> the role attribute helps assistive technology explain what kind of semantic value an element has — or what its pur
pose is.
... the aria-labelledby attribute tells assistive technologies that we're treating our <h2> with an id of list-heading as the label that describes the pur
pose of the list beneath it.
... making this association gives the list a more informative context, which could help screen reader users better understand the pur
pose of it.
Dynamic behavior in Svelte: working with variables and props - Learn web development
to turn our component into a general pur
pose to-do editor we should allow the parent of this component to pass in the list of todos to edit.
...this is how svelte 'extends' javascript by taking valid syntax and giving it a new pur
pose.
...this is another example in which svelte takes advantage of valid javascript syntax and gives it a new pur
pose — in this case to to mean "re-run this code whenever any of the referenced values change".
Deploying our app - Learn web development
deploying to hosting tends to be at the tail-end of the project life cycle, but with services such as netlify bringing down the cost of deployments (both in financial terms and also the time required to actually deploy) it's possible to deploy during development to either share work in progress or to have a pre-release for some other pur
pose.
...instead of running the server with npx parcel src/index.html, we can run it with npx parcel build src/index.html and parcel will build everything ready for production instead of just running it for development and testing pur
poses.
... integration testing, which basically says "does one block of code still work when connected to another block?" unit testing, where small and specific bits of functionality are tested to see if they do what they are sup
posed to do.
A bird's-eye view of the Mozilla framework
tiner last updated date: 11/23/05 statement of pur
pose the pur
pose of this article is to provide a high-level technical overview of the architecture of the extensible, object-based mozilla application framework.
...sup
pose the client already has an nsirdfdatasource object representing a sub-graph of an rdf graph and calls nsirdfdatasource.gettarget(resource, nc_link, true) to obtain an nsirdfnode representing a specific node in the graph, in this case a link to ahelp viewer document page.
... javascript client example sup
pose the javascript service in figure 2 is getlink() in help.js, which responds to the user clicking on a link in thecontents panel within thehelp viewer window by obtaining the link from thecontents panel elements stored in a dom tree.
Command line options
-com
pose message_options start with mail com
poser.
... thunderbird -com
pose "to=foo@nowhere.net" -mail start with the mail client.
... -editor url or -edit url start with editor (com
poser) for the given url (where url is optional).
Debugging on Mac OS X
if you are debugging firefox, thunderbird, or some other application that supports multiple profiles, using a separate profile for debugging pur
poses is recommended.
... see "having a profile for debugging pur
poses" below.
... having a profile for debugging pur
poses it is recommended to create a separate profile to debug with, whatever your task, so that you don't lose precious data like bookmarks, saved passwords, etc.
Multiple Firefox profiles
for example, you might want to have some extensions installed for web development, but not for general-pur
pose web browsing.
...this name is not ex
posed to the internet.
...this name is not ex
posed to the internet.
Communicating with frame scripts
the example below sends a message named "my-e10s-extension-message", with a data payload containing details and tag properties, and ex
poses the event.target object as a cpow: // frame script addeventlistener("click", function (event) { sendasyncmessage("my-addon@me.org:my-e10s-extension-message", { details : "they clicked", tag : event.target.tagname }, { target : event.target }); }, false); to receive messages from content, a chrome script needs to add a message listener using the message manager's addmessage...
... objects an object whose properties are any cpows ex
posed by the sender as the third argument to sendasyncmessage() in the example below the listener just logs all the messages details: // chrome script messagemanager.addmessagelistener("my-addon@me.org:my-e10s-extension-message", listener); function listener(message) { console.log(message.name); console.log(message.sync); console.log(message.data); console.log(message.target); conso...
... for example, sup
pose we load a script into the current <browser> on some event, and keep the browser message manager in an array, so we can send it messages: var messagemanagers = []; ...
Performance best practices for Firefox front-end engineers
if you want to queue up some javascript to run after the next "natural" style and layout flush, try: // sup
pose we want to get the computed "display" style of some node without // causing a style flush.
...it is, however, advantageous to strive for reflow to only occur in the one place (the layout step of the 16ms tick) as op
posed to multiple times during the 16ms tick (which has a higher probability of running through the 16ms budget).
... also, the gecko profiler back-end is in the process of being modified to ex
pose things like markers (from window.performance.mark()).
JavaScript-DOM Prototypes in Mozilla
prototype setup on an xpconnect wrapped dom node in mozilla when a dom node is accessed from javascript in mozilla, the native c++ dom node is wrapped using xpconnect and the wrapper is ex
posed to javascript as the javascript representation of the dom node.
...all the methods that are sup
posed 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).
... all those properties come from the interfaces that the c++ image object (nshtmlimageelement) implements and chooses to ex
pose to xpconnect through the object's class info.
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 pur
poses: allow adding, moving and removing customizable widgets.
...note that widget wrappers have a convenience getter property (areatype) for this pur
pose.
... properties for readability, the properties are split according to pur
pose: dynamic getters attribute type description areas array always returns an up to date array of all the area ids that are currently registered with customizableui.
Localizing with Koala
for the pur
poses of this tutorial, the locale code that we will use will be called "x-testing".
...we're starting by the second entity in this file on pur
pose, you'll see in a moment how koala nicely handles entity order.
...for the pur
poses of this tutorial, we will switch to the command line every now and then to see what koala does behind the scenes.
Mozilla Web Developer FAQ
in the quirks mode—for the pur
pose of backwards compatibility—gecko mimics some behaviors of legacy browsers in ways that are spec violations.
...the point of having a common api (the w3c dom) is interoperability, and checking for a particular browser defeats that pur
pose.
... authors are sup
posed to communicate their intentions using the web standards.
Mozilla Quirks Mode Behavior
pro
posed to apply in all modes: bug 747517.
... pro
posed to remove: bug 725646.
...[see nstableframe::getdeflationforbackground and figure out what really differs, and when it started differing.] gecko had bug 248239, where table cells acted as they had box-sizing:border-box applied for the pur
pose of the height property.
Introduction to NSPR
locks and monitors in general, a monitor is a conceptual entity com
posed of a mutex, one or more condition variables, and the monitored data.
...sup
pose an object has three values, v1, v2, and sum.
... for example, sup
pose the defined rule of a function is that it should wait until there is an object available and that it should return a reference to that object.
An overview of NSS Internals
softoken is an nss module that ex
poses most freebl functionality as a pkcs#11 module.
... most of the time certificates and keys are sup
posed to be stored in the nss database.
... when using hashing, encryption, and decryption functions, it is possible to stream data (as op
posed to operating on a large buffer).
NSS 3.19 release notes
new in nss 3.19 new functionality for some certificates, such as root ca certificates that don't embed any constraints, nss might im
pose additional constraints such as name constraints.
... a new api (cert_getim
posednameconstraints) has been added that allows one to lookup im
posed constraints.
... new functions in cert.h cert_getim
posednameconstraints - check if any im
posed constraints exist for the given certificate, and if found, return the constraints as encoded certificate extensions.
nss tech note3
bolyard this week at least 5 different people came to me with variants of the same question: what certificate extensions do i have to put into my cert for nss to allow it to be used for pur
pose <x>??
... this message attempts to answer that question, and to document nss's approach to validating certificates for certain pur
poses.
... when nss is asked to verify the validity of a certificate chain, it verifies the validity of that cert chain for a particular pur
pose, known as a seccertusage, as of a specific date and time.
gtstd.html
the instructions that follow assume you are using the certificate database tool to set up both the server and client databases for testing pur
poses.
...following sections decribe how to the certificate database tool to perform these tasks: setting up the ca db and certificate setting up the server db and certificate setting up the client db and certificate verifying the server and client certificates warning: the instructions below illustrate the use of nss command line tools to operate a simple root certificate authority for test pur
poses only.
... the ca, ssl server and ssl client certificates produced by these instructions work correctly for short term testing pur
poses.
Tutorial: Embedding Rhino
with more effort on the part of the embedder, the objects ex
posed to scripts can be customized further.
... in this document: runscript: a simple embedding entering a context initializing standard objects collecting the arguments evaluating a script printing the result exiting the context ex
pose java apis using java apis implementing interfaces adding java objects using javascript objects from java using javascript variables calling javascript functions javascript host objects defining host objects counter example counter's constructors class name dynamic properties defining javascript "methods" adding counter to run...
... ex
pose java apis using java apis no additional code in the embedding needed!
Bytecode Descriptions
however, the functionbody of the generator is not sup
posed to start running until the first .next() call, so after setup the script suspends itself: the "initial yield".
...this decom
posed version is needed to implement the compound assignment and increment/decrement operators, which get and then set a variable.
...this optimization im
poses no restrictions on bytecode.
JS_SetParent
this must be an object that has not yet been ex
posed to script.
...in fact, once an object is ex
posed to a script, the object's parent must not change.
...js_setparent has no way to check that this is the case, but nonetheless, applications must not call js_setparent on an object that has already been ex
posed to a script.
Split object
the window object split objects were introduced to resolve a problem
posed by the window object.
...sup
pose a script in page a, in tab ta, has a reference to the window object of page b in another tab tb.
...more indirectly, sup
pose there's a javascript function defined in page b that refers to global variables in page b.
Handling Mozilla Security Bugs
background security vulnerabilities are different from other bugs, because their consequences are potentially so severe: users' private information (including financial information) could be ex
posed, users' data could be destroyed, and users' systems could be used as platforms for attacks on other systems.
... the applicant should have a legitimate pur
pose for wishing to join the group.
...ng, the module owner, a peer, or some other person they may designate will post this message to the known vulnerabilities page (which will be the authoritative source for this information) and will also send a copy of this message to an appropriate moderated mailing list and/or newsgroup (e.g., netscape.public.mozilla.announce and/or some other newsgroup/list established specifically for this pur
pose).
AT APIs Support
also we ex
pose ms com interfaces isimpledom* to provide an access to dom tree.
... accessible web standards gecko ex
poses the number of xml languages including html to at.
... refer to accessible web specifications page to learn what and how markup languages are ex
posed.
XML Extras
the module is structured as a drop-in component and ex
poses its xml-as-data features both to javascript and c++/xpcom users.
...normally your files should reside on a webserver so this shouldn't
pose a problem (there you do not need that line either).
... additionally, "foo.com:80" and "foo.com:313" are considered different hosts for security pur
poses.
Introduction to XPCOM for the DOM
as op
posed to a concreate class, an interface is sup
posed to be more stable through time.
... tutorial : how to add a new interface introduction the pur
pose of this tutorial is to describe the process of adding a new interface to the dom and then implementing it.
...for the pur
pose of this document, i have chosen to implement a new html interface called nsidomfabian.
Language bindings
ex
poses modules written in the bound language as xpcom objects, thereby enabling all other languages for which xpcom bindings exist to access these modules.
...this can be used for various diagnostic pur
poses.components.utilscomponents.utils is a collection of various useful xpconnect features.
... this is useful for privileged code, such as add-on code, to access variables and apis defined in web content.components.utils.exportfunctionthis function provides a safe way to ex
pose a function from a privileged scope to a less-privileged scope.components.utils.forcegccomponents.utils.forcegc lets scripts force a garbage collection cycle.
mozIRegistry
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 sup
posed to link together the various xpcom components that together form the mozilla browser.
...some are for illustrative pur
poses (the lighter-colored boxes near the top of the picture).
... i think this might make it a little more flexible, thereby making xpcom more general-pur
pose.
nsIDOMGlobalPropertyInitializer
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) an xpcom component implementing this interface can be ex
posed to web content as a property on the window.
...an alternative way to ex
pose an object to the web content is to add the property in response to the content-document-global-created notification.
... it is also recommended to use __ex
posedprops__ to control which members are ex
posed.
nsIMsgIdentity
johnnospam@doe.com organization astring optional organization com
posehtml boolean should we com
pose with html by default?
...if this is set, the return receipt menu item on the com
pose window will be checked.
...if this is set, the dsn menu item on the com
pose window will be checked.
nsISearchEngine
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void addparam(in astring name, in astring value, in astring responsetype); nsisearchsubmission getsubmission(in astring data, [optional] in astring responsetype, [optional] in astring pur
pose); boolean supportsresponsetype(in astring responsetype); attributes attribute type description alias astring an optional shortcut alias for the engine.
...nsisearchsubmission getsubmission( in astring data, [optional] in astring responsetype, [optional] in astring pur
pose ); parameters data data to add to the submission object.
... pur
pose [optional] a string meant to indicate the context of the search request.
nsIWebContentHandlerRegistrar
cu.import('resource://gre/modules/services.jsm'); var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getservice(ci.nsiwebcontenthandlerregistrar); var htmlcontentwindow = undefined; var registeruri = 'http://mail.live.com/secure/start?action=com
pose&to=%s'; var myurihostname = services.io.newuri(registeruri, null, null).host; // this section here is long and daunting, but its just finding a suitable contentwindow var domwindows = services.wm.getenumerator(null); while (domwindows.hasmoreelements()) { var adomwindow = domwindows.getnext(); if (adomwindow.gbrowser) { if (adomwindow.gbrowser.tabcontainer) { //adomwi...
... permission denied to add http://mail.live.com/secure/start?action=com
pose&to=%s as a content or protocol handler'permission denied to add http://mail.live.com/secure/start?action=com
pose&to=%s as a content or protocol handler' when calling method: [nsiwebcontenthandlerregistrar::registerprotocolhandler] if the host names do match then a confirmation like this will be seen: this domain check can be bypassed by setting the preference of gecko.handlerservice.allowreg...
...andlerservice.allowregisterfromdifferenthost', true); } var htmlcontentwindow = services.wm.getmostrecentwindow('navigator:browser'); //because we set the preference to true above, we need any window that has a browser, just pass the domwindow and the registerprotocolhandler will get the contentwindow from it nsiwchr.registerprotocolhandler("mailto", "http://mail.live.com/secure/start?action=com
pose&to=%s", "outlook.com live mail", htmlcontentwindow); if (!allowregisterfromdifferenthost) { //it this variable is false, than we had set the pref to true obviously.
XPIDL
array<t> const nstarray<t>& nstarray<t>& array the c++-ex
posed type t will be an owned variant.
... interfaces specifying interfaces is the primary pur
pose of using xpidl.
...in javascript contexts, attributes are ex
posed as a regular property access, while native code sees attributes as a get and possibly a set method.
Mail composition back end
ns_imethod createandsendmessage( nsieditorshell *aeditor, - the editor object for the mail com
pose operation.
... ns_imethod quotemessage( const prunichar *msguri, - the uri of the message to be quoted nsioutputstream *outstream) = 0; - the consumer output stream for the quoted data sample programs the mozilla/mailnews/com
pose/tests/ directory contains sample test programs for all of the above described interfaces.
... com
pose - this program shows the use of the createandsendmessage interface (createandsendmessage) com
pose2 - this program shows the use of the createandsendmessage interface (sendmessagefile) sendlater - this program shows the use of the nsimsgsendlater interface sendpage - this program shows the use of the createandsendmessage interface (sendwebpage) last modified: wed nov 1, 2000 rhp@netscape.com ...
customDBHeaders Preference
as you follow along the step-by-step guide in creating a custom column, you may want to consider a preference setting that ex
poses custom header data for use in a custom column within thunderbird's main view.
...in addition to the preference outlined in setting up extension development environment, you'll want to add the following preferences: // this allows you to add extra headers while composing messages user_pref("mail.com
pose.other.header", "x-superfluous,x-other,x-whatever"); // this enables the preservation of custom headers as incoming mail is processed user_pref( "mailnews.customdbheaders", "x-superfluous,x-other"); important: please pay careful attention to the case of the mailnews.customdbheaders preference.
.../ chrome/content/superfluous.js chrome/content/superfluous_overlay.xul install.rdf adding: chrome/ (stored 0%) adding: chrome.manifest (deflated 44%) adding: chrome/content/ (stored 0%) adding: chrome/content/superfluous.js (deflated 57%) adding: chrome/content/superfluous_overlay.xul (deflated 44%) adding: install.rdf (deflated 50%) end result ultimately, you want to be able to com
pose a message like this: and see the superfluous column displayed in your inbox like this: thanks many thanks go out to the thunderbird developers for the fine product that it is.
Using the Multiple Accounts API
identities (nsimsgidentity): an identity contains all the information necessary to com
pose and outgoing mail message.
... identities identities are used in the com
pose window.
...(replyto: header in mail messages) preference: mail.identity.identity.organization - user's organization (organization: header in mail messages) preference: mail.identity.identity.com
pose_html - boolean, should we com
pose messages in html (true) or plain text (false)?
Drawing and Event Handling - Plugins
because windowless plug-ins can be layered or drawn to arbitrary drawables, the browser (as op
posed to the native windowing system) is responsible for controlling both their drawing and their event handling.
... unix/x11 the plug-in receives a graphicsex
pose event.
... the xgraphicsex
poseevent structure contains the xlib drawable (which is an offscreen pixmap), its display, and the dirty rectangle (optional clip rectangle) specified relative to the top-left corner of the drawable.
Streams - Plugins
for instance, sup
pose the plug-in allocates, in npp_newstream, an 8k buffer to hold the data written from that stream.
...in the example above, sup
pose that the plug-in allocates an 8k buffer and returns 8192 from npp_writeready.
... as an example, sup
pose that a plug-in (and the http server) supports byte-range requests, and that the browser is in the process of pushing data to the plug-in.
Debugger - Firefox Developer Tools
setting this flag to true is intended for uses of subsystems of the debugger api (e.g, debugger.source) for pur
poses other than step debugging a target javascript program.
...in some cases, the code coverage might ex
pose information which pre-date the modification of this flag.
...thus, for example, a debugger.object referring to a second debugger.object which refers to a global does not designate that global for the pur
poses of this function.) the global designated byglobal must be in a different compartment than this debugger instance itself.
DevTools API - Firefox Developer Tools
a definition is a js light object that ex
poses different information about the tool (like its name and its icon), and a build method that will be used later-on to start an instance of this tool.
... console.log("network monitor initialized to toolbox", toolbox); }); toolsidebar to build a sidebar in your tool, first, add a xul:tabbox where you want the sidebar to live: <splitter class="devtools-side-splitter"/> <tabbox id="mytool-sidebar" class="devtools-sidebar-tabs" hidden="true"> <tabs/> <tabpanels flex="1"/> </tabbox> a sidebar is com
posed of tabs.
... if the loaded document ex
poses a window.setpanel(toolpanel) function, the sidebar will call it once the document is loaded.
Migrating from Firebug - Firefox Developer Tools
the devtools display an element {} rule for this pur
pose, which requires a single click into it to start editing the properties.
...the style editor has a sidebar for this pur
pose.
...the network monitor has a preview panel for this pur
pose.
CSSStyleDeclaration - Web APIs
the cssstyledeclaration interface represents an object that is a css declaration block, and ex
poses style information and various style-related methods and properties.
... a cssstyledeclaration object can be ex
posed using three different apis: via htmlelement.style, which deals with the inline styles of a single element (e.g., <div style="...">).
... via window.getcomputedstyle(), which ex
poses the cssstyledeclaration object as a read-only interface.
Hit regions and accessibility - Web APIs
canvas content is not ex
posed to accessibility tools like semantic html is.
...you can use aria attributes to describe the behavior and pur
pose of the canvas element.
...the hit region api allows you to define an area of your canvas and provides another possibility to ex
pose interactive content on a canvas to accessibility tools.
EXT_disjoint_timer_query - Web APIs
types this extension ex
poses a new type: gluint64ext unsigned 64-bit integer number.
... constants this extension ex
poses seven new constants.
... methods this extension ex
poses eight new methods.
History.replaceState() - Web APIs
examples sup
pose https://www.mozilla.org/foo.html executes the following javascript: const stateobj = { foo: 'bar' }; history.pushstate(stateobj, '', 'bar.html'); the explanation of these two lines above can be found in the example of pushstate() method section of the working with the history api article.
... then sup
pose https://www.mozilla.org/bar.html executes the following javascript: history.replacestate(stateobj, '', 'bar2.html'); this will cause the url bar to display https://www.mozilla.org/bar2.html, but won't cause the browser to load bar2.html or even check that bar2.html exists.
... sup
pose now that the user navigates to https://www.microsoft.com, then clicks the back button.
Intersection Observer API - Web APIs
or specifically which ones they are; however, it covers the much more common use case of "if they intersect by somewhere around n%, i need to do something." intersection observer concepts and usage the intersection observer api allows you to configure a callback that is called: (1) whenever one element, called the target, intersects either the device viewport or a specified element; for the pur
pose of this api, this is called the root element or root (2) and whenever the observer is asked to watch a target for the very first time typically, you'll want to watch for intersection changes with regard to the element's closest scrollable ancestor, or, if the element isn't a descendant of a scrollable element, the viewport.
... when the callback is invoked, it receives a list of intersectionobserverentry objects, one for each observed target which has had the degree to which it intersects the root change such that the amount ex
posed crosses over one of the thresholds, in either direction.
... <div id="box"> <div class="vertical"> welcome to <strong>the box!</strong> </div> </div> css the css isn't terribly important for the pur
poses of this example; it lays out the element and establishes that the background-color and border attributes can participate in css transitions, which we'll use to affect the changes to the element as it becomes more or less obscured.
Navigator - Web APIs
navigator.locks read only returns a lockmanager object which provides methods for requesting a new lock object and querying for an existing lock object navigator.mediacapabilities read only returns a mediacapabilities object that can ex
pose information about the decoding and encoding capabilities for a given format and output capabilities.
...this property is kept only for compatibility pur
pose.
... navigator.credentials returns the credentialscontainer interface which ex
poses methods to request credentials and notify the user agent when interesting events occur such as successful sign in or sign out.
Using the Screen Capture API - Web APIs
visible vs logical display surfaces for the pur
poses of the screen capture api, a display surface is any content object that can be selected by the api for sharing pur
poses.
... the dumpoptionsinfo() function—which we will look at in a moment—dumps information about the stream to the log box for educational pur
poses.
... function stopcapture(evt) { let tracks = videoelem.srcobject.gettracks(); tracks.foreach(track => track.stop()); videoelem.srcobject = null; } dumping configuration information for informational pur
poses, the startcapture() method shown above calls a method named dumpoptions(), which outputs the current track settings as well as the constraints that were placed upon the stream when it was created.
USBDevice - Web APIs
usbdevice.deviceclass read only one of three properties that identify usb devices for the pur
pose of loading a usb driver that will work with that device.
... usbdevice.deviceprotocol read only one of three properties that identify usb devices for the pur
pose of loading a usb driver that will work with that device.
... usbdevice.devicesubclass read only one of three properties that identify usb devices for the pur
pose of loading a usb driver that will work with that device.
WEBGL_compressed_texture_astc - Web APIs
the webgl_compressed_texture_astc extension is part of the webgl api and ex
poses adaptive scalable texture compression (astc) compressed texture formats to webgl.
... methods this extension ex
poses one new methods.
... constants the compressed texture formats are ex
posed by 28 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d().
WebGL2RenderingContext.uniformMatrix[234]x[234]fv() - Web APIs
syntax void gl.uniformmatrix2fv(location, trans
pose, data, optional srcoffset, optional srclength); void gl.uniformmatrix3x2fv(location, trans
pose, data, optional srcoffset, optional srclength); void gl.uniformmatrix4x2fv(location, trans
pose, data, optional srcoffset, optional srclength); void gl.uniformmatrix2x3fv(location, trans
pose, data, optional srcoffset, optional srclength); void gl.uniformmatrix3fv(location, trans
pose, data, optional srcoffset, optional srclength); void gl.uniformmatrix4x3fv(location, trans
pose, data,...
... optional srcoffset, optional srclength); void gl.uniformmatrix2x4fv(location, trans
pose, data, optional srcoffset, optional srclength); void gl.uniformmatrix3x4fv(location, trans
pose, data, optional srcoffset, optional srclength); void gl.uniformmatrix4fv(location, trans
pose, data, optional srcoffset, optional srclength); parameters location a webgluniformlocation object containing the location of the uniform attribute to modify.
... trans
pose a glboolean specifying whether to trans
pose the matrix.
WebGL model view projection - Web APIs
these matrices can be com
posed together and grouped in special ways to make them useful for rendering complicated 3d scenes.
... these com
posed matrices ultimately move the original model data around into a special coordinate space called clip space.
... // this function is for illustration pur
poses only.
Web Video Text Tracks Format (WebVTT) - Web APIs
the primary pur
pose of webvtt files is to add text overlays to a <video>.
...following interface can be used to ex
pose webvtt cues in dom api: enum autokeyword { "auto" }; enum directionsetting { "" /* horizontal */, "rl", "lr" }; enum linealignsetting { "start", "center", "end" }; enum positionalignsetting { "line-left", "center", "line-right", "auto" }; enum alignsetting { "start", "center", "end", "left", "right" }; [constructor(double starttime, double endtime, domstring text)] interface vttcue : texttrackcu...
...the interface code is given below which can be used to ex
pose the webvtt regions in dom api: enum scrollsetting { "" /* none */, "up" }; [constructor] interface vttregion { attribute double width; attribute long lines; attribute double regionanchorx; attribute double regionanchory; attribute double viewportanchorx; attribute double viewportanchory; attribute scrollsetting scroll; }; methods and properties the methods used in webvtt are thos...
Lighting a WebXR setting - Web APIs
you can learn all about the pro
posed api and a fair amount about the concept of lighting estimation in the explainer documnent that's included in the specification's github repository.
... the specifics of how lighting estimation works, especially in the context of the pro
posed api, is out of scope for the moment.
... the lighting estimation api specification mandates that all user agents perform temporal and spatial filtering to fuzz the data in a manner that reduces its usefulness for the pur
pose of locating the user or performing side-channel attacks.
Advanced techniques: Creating and sequencing audio - Web APIs
pulse user controls for the ui controls, let's ex
pose both frequencies of our oscillators, allowing them to be controlled via range inputs.
... let bandpass = audioctx.createbiquadfilter(); bandpass.type = 'bandpass'; bandpass.frequency.value = 1000; // connect our graph noise.connect(bandpass).connect(audioctx.destination); noise user controls on the ui we'll ex
pose the noise duration and the frequency we want to band, allowing the user to adjust them via range inputs and event handlers just like in previous sections: <label for="duration">duration</label> <input name="duration" id="duration" type="range" min="0" max="2" value="1" step="0.1" /> <label for="band">band</label> <input name="band" id="band" type="range" min="400" max="1200" value="1000" step="...
...let's ex
pose that to our ui, so we can speed up and slow down our sample.
XRFrame - Web APIs
in addition to providing a reference to the xrsession for which this frame is to be rendered, the getviewer
pose() method is provided to obtain the xrviewer
pose describing the viewer's position and orientation in space, and get
pose() can be used to create an xr
pose describing the relative position of one xrspace relative to another.
... methods get
pose() returns an xr
pose object representing the spatial relationship between the two specified xrspace objects.
... getviewer
pose() returns an xrviewer
pose describing the viewer's position and orientation in a given xrreferencespace.
XRHandedness - Web APIs
function updateinputsources(session, frame, refspace) { for (let source of session.inputsources) { if (source.gripspace) { let grip
pose = frame.get
pose(source.gripspace, refspace); if (grip
pose) { myrenderhandobject(grip
pose, inputsource.handedness); } } } } this function, which would be called every animation frame (or possibly just periodically, depending on the degree of smoothness required and any performance constraints), scans the list of input sources looking for any which have a gripspace whic...
... if gripspace is non-null, the function proceeds to get the
pose for the gripspace transformed into the current reference space.
... assuming that's then valid, a function called myrenderhandobject() is called with the grip's
pose and the value of handedness.
XRInputSource.gripSpace - Web APIs
the read-only xrinputsource property gripspace returns an xrspace whose native origin tracks the
pose used to render virtual objects so they appear to be held in (or part of) the user's hand.
... for (let source in xrsession.inputsources) { if (source.gripspace) { let grip
pose = frame.get
pose(source.gripspace, xrrefspace); if (grip
pose) { mydrawmeshusingtransform(controllermesh, grip
pose.transform.matrix); } } } for each input source which has a value for gripspace, this loop obtains the xr
pose representing the position and orientation that are described by gripspace.
... if a valid
pose is returned, a method mydrawmeshusingtransform() is called to draw the controller's mesh transformed using the grip
pose's transform matrix.
XRInputSource.handedness - Web APIs
function updateinputsources(session, frame, refspace) { for (let source of session.inputsources) { if (source.gripspace) { let grip
pose = frame.get
pose(source.gripspace, refspace); if (grip
pose) { myrenderhandobject(grip
pose, inputsource.handedness); } } } } this function, which would be called every animation frame (or possibly just periodically, depending on the degree of smoothness required and any performance constraints), scans the list of input sources looking for any which have a gripspace whic...
... if gripspace is non-null, the function proceeds to get the
pose for the gripspace transformed into the current reference space.
... assuming that's then valid, a function called myrenderhandobject() is called with the grip's
pose and the value of handedness.
XRInputSourceEventInit.frame - Web APIs
the xrinputsourceeventinit dictionary's property frame specifies an xrframe providing information about the timestamp at which the new input source event took place, as well as access to the xrframe method get
pose() which can be used to map the coordinates of any xrreferencespace to the space in which the event took place.
... syntax xrinputsourceeventinit.frame = xrframe; let xrinputsourceeventinit = { frame: xrframe }; let xrinputsourceevent = new xrinputsourceevent(type, { frame: xrframe }); value an xrframe indicating the time at which the event took place, and providing a get
pose() method which can be used to map reference spaces to the world reference space.
...instead, the xrframe specified by the frame property is simply a method to provide access to the get
pose() method, which you can use to get the relative positions of the objects in the scene at the time the event occurred.
XRSession: squeeze event - Web APIs
the handler fetches the
pose representing the target ray for tracked-pointer inputs and sends the
pose's transform to a function called myhandlesqueezewithray().
... xrsession.addeventlistener("squeeze", event => { if (event.inputsource.targetraymode == "tracked-pointer") { let targetray
pose = event.frame.get
pose(event.inputsource.targetrayspace, myrefspace); if (targetray
pose) { myhandlesqueezewithray(targetray
pose.transform); } } }); you can of course also set up a handler for squeeze events by setting the xrsession object's onsqueeze event handler property to a function that handles the event: xrsession.onsqueeze = event => { if (...
...event.inputsource.targetraymode == "tracked-pointer") { let targetray
pose = event.frame.get
pose(event.inputsource.targetrayspace, myrefspace); if (targetray
pose) { myhandlesqueezewithray(targetray
pose.transform); } } }; specifications specification status comment webxr device apithe definition of 'squeeze event' in that specification.
XRSession - Web APIs
with xrsession methods, you can poll the viewer's position and orientation (the xrviewer
pose), gather information about the user's environment, and present imagery to the user.
...returns an integer value which can be used to identify the request for the pur
poses of canceling the callback using cancelanimationframe().
... const xr = navigator.xr; if (xr) { xr.requestsession("inline").then((xrsession) => { xrsession.requestreferencespace("local").then((xrreferencespace) => { xrsession.requestanimationframe((time, xrframe) => { let viewer = xrframe.getviewer
pose(xrreferencespace); gl.bindframebuffer(xrwebgllayer.framebuffer); for (xrview of viewer.views) { let xrviewport = xrwebgllayer.getviewport(xrview); gl.viewport(xrviewport.x, xrviewport.y, xrviewport.width, xrviewport.height); } }); }); }); } else { /* webxr is not available */ } specifications specificati...
XRView.eye - Web APIs
usage notes the primary pur
pose of this property is to allow the correct area of any pre-rendered stereo content to be presented to the correct eye.
... examples this code, from the viewer
pose's renderer, iterates over the
pose's views and renders them.
... gllayer = xrsession.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); gl.clearcolor(0,0, 0, 1.0); gl.cleardepth(1.0); gl.clear(gl.color_buffer_bit, gl.depth_buffer_bit); for (let view of xr
pose.views) { let skipview = false; if (view.eye == "left" && body.lefteye.injured) || skipview = updateinjury(body.lefteye); } else if (view.eye == "right" && body.righteye.injured) { skipview = updateinjury(body.righteye); } if (!skipview) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); renderscene(gl, ...
XRWebGLLayer.getViewport() - Web APIs
this works because the set of views returned by an xrviewer
pose each represent one eye's perspective on the scene.
... since the framebuffer is split in half, one half for each eye, setting the webgl viewport to match the webxr layer's viewport will ensure that when rendering the scene for the current eye's
pose, it is rendered into the correct half of the framebuffer.
... <<<--- add link to appropriate section in the cameras and views article --->>> function drawframe(time, frame) { let session = frame.session; let
pose = frame.getviewer
pose(mainreferencespace); if (
pose) { let gllayer = session.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); gl.clearcolor(0, 0, 0, 1.0); gl.cleardepth(1.0); gl.clear(gl.color_buffer_bit, gl.depth_color_bit); for (let view of
pose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); /* render the scene now */ } } specifications specification status comment webxr device apithe definition of 'xrwebgllayer.getviewport()' in that specification.
ARIA Test Cases - Accessibility
there are several pur
poses for providing this information: help browser vendors provide correct implementations help at vendors provide correct implementations inform authors as to what actually works reliably in general we're testing with the latest public releases.
... reference to link example note regarding dojo/dijit test files the main pur
pose of dojo's dijit test files are for dojo developers to exercise and debug the code.
... jaws 10 - - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass zoomtext - - - - orca - - - - property-only test cases these testcases involve aria properties used to enhance html controls (as op
posed to javascript-built widgets).
ARIA: form role - Accessibility
make sure to have a unique label on each form in a document to help users understand the pur
pose of the form.
... labeling landmarks each <form> element and form role that needs to be ex
posed as a landmark must be given an accessible name.
... this name will allow an assitive technology user to be able to quickly understand the pur
pose of the form landmark.
ARIA: checkbox role - Accessibility
elements containing role="checkbox" must also include the aria-checked attribute to ex
pose the checkbox's state to assistive technology.
...similarly, an element with role="checkbox" can ex
pose three states through the aria-checked attribute: true, false, or mixed.
...ument.getelementbyid('chkpref'); switch(item.getattribute('aria-checked')) { case "true": item.setattribute('aria-checked', "false"); break; case "false": item.setattribute('aria-checked', "true"); break; } } accessibility concerns when the checkbox role is added to an element, the user agent should do the following: ex
pose the element as having a checkbox role in the operating system's accessibility api.
WAI-ARIA Roles - Accessibility
elements containing role="checkbox" must also include the aria-checked attribute to ex
pose 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.
...the main content area consists of content that is directly related to or expands upon the central topic of a document, or the central functionality of an application.aria: mark rolethe mark landmark role semantically denotes html elements containing text that is marked/highlighted for reference pur
poses.
...a rowgroup contains one or more rows of cells, grid cells, column headers, or row headers within a grid, table or treegrid.aria: search rolethe search landmark role is used to identify a section of the page used to search the page, site, or collection of sites.aria: suggestion rolethe suggestion landmark role semantically denotes a single pro
posed change to an editable document.
Accessibility Information for Web Authors - Accessibility
its pur
pose is to aid humans in the web accessibility evaluation process.
...furthermore, assistive technologies do not understand what these widgets are sup
posed to be, or what state they are in or what they are capable of.
... pur
pose newsgroup mailing list google group developer discussion mozilla.dev.accessibility subscribe/unsubscribe google group end user support mozilla.support.accessibility subscribe/unsubscribe google group ...
Using media queries - CSS: Cascading Style Sheets
note: the examples on this page use css's @media for illustrative pur
poses, but the basic syntax remains the same for all types of media queries.
... syntax a media query is com
posed of an optional media type and any number of media feature expressions.
... width width of the viewport including width of scrollbar logical operators the logical operators not, and, and only can be used to com
pose a complex media query.
Event reference
compositionupdate a character is added to a passage of text being com
posed.
... compositionupdate compositionevent dom l3 a character is added to a passage of text being com
posed.
... ussdreceived firefox os specific a new ussd message is received mscontentzoom microsoft specific msmanipulationstatechanged microsoft specific mspointerhover microsoft specific mozilla-specific events note: these events are never ex
posed to web content and can only be used in a xul chrome content context.
Ajax - Developer guides
pure-ajax navigation example this article provides a working (minimalist) example of a pure-ajax website com
posed only of three pages.
... xml the extensible markup language (xml) is a w3c-recommended general-pur
pose markup language for creating special-pur
pose markup languages.
...its primary pur
pose is to facilitate the sharing of data across different systems, particularly systems connected via the internet.
<picture>: The Picture element - HTML: Hypertext Markup Language
the <img> element serves two pur
poses: it describes the size and other attributes of the image and its presentation.
... it is com
posed of a comma-separated list of image descriptors.
... each image descriptor is com
posed of a url of the image, and either...
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
you should not use <u> to simply underline text for presentation pur
poses, or to denote titles of books.
...ou should use an element other than <u>, such as: <em> to denote stress emphasis <b> to draw attention to text <mark> to mark key words or phrases <strong> to indicate that text has strong importance <cite> to mark the titles of books or other publications <i> to denote technical terms, transliterations, thoughts, or names of vessels in western texts to provide textual annotations (as op
posed to the non-textual annotations created with <u>), use the <ruby> element.
... examples indicating a spelling error this example uses the <u> element and some css to display a paragraph which includes a misspelled error, with the error indicated in the red wavy underline style which is fairly commonly used for this pur
pose.
Global attributes - HTML: Hypertext Markup Language
in addition to the basic html global attributes, the following global attributes also exist: xml:lang and xml:base — these are inherited from the xhtml specifications and deprecated, but kept for compatibility pur
poses.
...its pur
pose is to identify the element when linking (using a fragment identifier), scripting, or styling (with css).
...this attribute and the <style> element have mainly the pur
pose of allowing for quick styling, for example for testing pur
poses.
MIME types (IANA media types) - HTTP
a media type (also known as a multipur
pose internet mail extensions or mime type) is a standard that indicates the nature and format of a document, file, or assortment of bytes.
...they treat it as if the content-disposition header was set to attachment, and pro
pose a "save as" dialog.
... when the 206 partial content status code is sent, this mime type indicates that the document is com
posed of several parts, one for each of the requested ranges.
Resource URLs - HTTP
syntax resource urls are com
posed of two parts: a prefix (resource:), and a url pointing to the resource you want to load: resource://<url> an example: resource://gre/res/svg.css when arrows are found in the resource url's ('->'), it means that the first file loaded the next one: resource://<file-loader> -> <file-loaded> please refer to identifying resources on the web for more general details.
... resources that have to be ex
posed to web content have been moved to a new location named resource://content-accessible/, which is isolated and only contains non-sensitive resources.
... in this way we can keep essential resources ex
posed and have most threats eliminated.
Browser detection using the user agent - HTTP
let us imagine a page com
posed of boxes of information; each box is about a different feline breed or canine breed.
...for the pur
poses of grouping the content meaningfully, all the cat boxes are separated from all the dog boxes such that the cat and dog boxes are not intermixed together.
...do you actually want to detect firefox, as op
posed to seamonkey, or chrome as op
posed to chromium?
Access-Control-Allow-Credentials - HTTP
the access-control-allow-credentials response header tells browsers whether to ex
pose the response to frontend javascript code when the request's credentials mode (request.credentials) is include.
... when a request's credentials mode (request.credentials) is include, browsers will only ex
pose the response to frontend javascript code if the access-control-allow-credentials value is true.
...for a cors request with credentials, in order for browsers to ex
pose the response to frontend javascript code, both the server (using the access-control-allow-credentials header) and the client (by setting the credentials mode for the xhr, fetch, or ajax request) must indicate that they’re opting in to including credentials.
HTTP headers - HTTP
iana also maintains a registry of pro
posed new http headers.
... access-control-allow-credentials indicates whether the response to the request can be ex
posed when the credentials flag is true.
... access-control-ex
pose-headers indicates which headers can be ex
posed as part of the response by listing their names.
About JavaScript - JavaScript
objects are created programmatically in javascript, by attaching methods and properties to otherwise empty objects at run time, as op
posed to the syntactic class definitions common in compiled languages like c++ and java.
... each of mozilla's javascript engines ex
pose a public api which application developers can use to integrate javascript into their software.
...a javascript web server would ex
pose host objects representing a http request and response objects, which could then be manipulated by a javascript program to dynamically generate web pages.
Object.prototype.__proto__ - JavaScript
the __proto__ property of object.prototype is an accessor property (a getter function and a setter function) that ex
poses the internal [[prototype]] (either an object or null) of the object through which it is accessed.
... description the __proto__ getter function ex
poses the value of the internal [[prototype]] of an object.
...this is for example pur
poses only.
Symbol - JavaScript
the symbol() function returns a value of type symbol, has static properties that ex
pose several members of built-in objects, has static methods that ex
pose 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()".
... a symbol value may be used as an identifier for object properties; this is the data type's primary pur
pose, although other use-cases exist, such as enabling opaque data types, or serving as an implementation-supported unique identifier in general.
... some further explanation about pur
pose and usage can be found in the glossary entry for symbol.
icons - Web app manifests
the pur
pose of this member is to allow a user agent to quickly ignore images with media types it does not support.
... pur
pose defines the pur
pose of the image, for example if the image is intended to serve some special pur
pose in the context of the host os (i.e., for better integration).
... pur
pose can have one or more of the following values, separated by spaces: monochrome: a user agent can present this icon where a monochrome icon with a solid fill is needed.
Authoring MathML - MathML
the mathml code is not ex
posed to web crawlers (e.g.
... pros: you get static web pages: the latex source don't need to be parsed at each page load, the mathml code is ex
posed to web crawlers and you can put them easily on any web server.
...on unix, you can then download itex2mml, build and install it: wget http://golem.ph.utexas.edu/~distler/blog/files/itextomml.tar.gz; \ tar -xzf itextomml.tar.gz; \ cd itex2mml/itex-src; make sudo make install now sup
pose that you have a html page with tex fragments delimited by dollars: input.html ...
Media container formats (file types) - Web media technologies
because quicktime support is, for all intents and pur
poses, primarily available on apple devices, it is no longer widely used on the internet.
... consider using this container format compressed files for general-pur
pose playback mp3 (mpeg-1 audio layer iii) losslessly compressed files flac with alac fallback uncompressed files wav now that mp3's patents have all expired, the choice of audio file format has become much easier to make.
... consider using this container format general pur
pose video, preferably in an open format webm (ideally with mp4 fallback) general pur
pose video mp4 (ideally with webm or ogg fallback) high compression optimized for slow connections 3gp (ideally with mp4 fallback) compatibility with older devices/browsers quicktime (ideally with avi and/or mpeg-2 fallback) these suggestions make a number of assumptions.
Content Scripts - Archive of obsolete content
passing configuration options the contentscriptoptions is a json object that is ex
posed to content scripts as a read-only value under the self.options property: // main.js var tabs = require("sdk/tabs"); tabs.on('ready', function(tab) { tab.attach({ contentscript: 'window.alert(self.options.message);', contentscriptoptions: {"message" : "hello world"} }); }); any kind of jsonable value (object, array, string, etc.) can be used here.
... however, the worker is not ex
posed to add-on code in quite the same way in all modules.
Modules - Archive of obsolete content
this is useful if the api to be ex
posed does not have a corresponding js file, or is written in an incompatible format.
... cuddlefish uses this option to ex
pose the components object as a module called chrome, in a way similar to the code here below: const { classes: cc, constructor: cc, interfaces: ci, utils: cu, results: cr, manager: cm } = components; let loader = loader({ paths: ["./": "http://www.foo.com/"], resolve: function (id, requirer) { // your logic here return id; }, modules: { 'chrome': { components: components, cc: cc, cc: bind(cc, components), ci: ci, cu: cu, cr: cr, cm: cm } } }); all accesses to the chrome module go through this one point.
Contributor's Guide - Archive of obsolete content
content processes a content process was sup
posed to run all the code associated with a single tab.
... conversely, an add-on process was sup
posed to run all the code associated with a single add-on.
indexed-db - Archive of obsolete content
experimental ex
poses the indexeddb api to add-ons.
... the api ex
posed by indexed-db is almost identical to the dom indexeddb api, so we haven't repeated its documentation here, but refer you to the indexeddb api documentation for all the details.
page-worker - Archive of obsolete content
contentscriptoptions object read-only value ex
posed to content scripts under self.options property.
...cument element for the page is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the page has been loaded, at the time the window.onload event fires contentscriptoptions read-only value ex
posed to content scripts under self.options property.
panel - Archive of obsolete content
contentscriptoptions object read-only value ex
posed to content scripts under addon.options property.
...ment element for the panel is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the panel has been loaded, at the time the window.onload event fires contentscriptoptions read-only value ex
posed to content scripts under addon.options property.
content/loader - Archive of obsolete content
example: the following code creates a wrapper on a hidden frame that reloads a web page in the frame every time the contenturl property is changed: var hiddenframes = require("sdk/frame/hidden-frame"); var { loader } = require("sdk/content/content"); var pageloader = loader.com
pose({ constructor: function pageloader(options) { options = options || {}; if (options.contenturl) this.contenturl = options.contenturl; this.on('propertychange', this._onchange = this._onchange.bind(this)); let self = this; hiddenframes.add(hiddenframes.hiddenframe({ onready: function onready() { let frame = self._frame = this.element; self._emit('pr...
...cument element for the page is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the page has been loaded, at the time the window.onload event fires contentscriptoptions read-only value ex
posed to content scripts under self.options property.
core/heritage - Archive of obsolete content
reading or writing such code requires sharp eye and lot's of discipline, mainly due to code fragmentation and lots of machinery being ex
posed: // defining a simple class function dog(name) { // classes are for creating instances, calling them without `new` changes // behavior, which in majority cases you need to handle, so you end up // with additional boilerplate.
...this is too much machinery ex
posed.
places/history - Archive of obsolete content
// we'd com
pose the query with the following options let lastweek = date.now - (1000*60*60*24*7); search( // first query looks for all entries before last week with 'ruby' [{ query: "ruby", to: lastweek }, // second query searches all entries after last week with 'javascript' { query: "javascript", from: lastweek }], // we want to order chronologically by visit date { sort: "date" } ).on("end", func...
... placesemitter the placesemitter is not ex
posed in the module, but returned from the search functions.
preferences/event-target - Archive of obsolete content
these are the same preferences that are ex
posed to users in the about:config page.
...you can also use the simple-prefs module to access just the preferences for your own add-on and ex
pose them to the user in the add-on manager.
preferences/service - Archive of obsolete content
these are the same preferences that are ex
posed to users in the about:config page.
...you can also use the simple-prefs module to access just the preferences for your own add-on and ex
pose them to the user in the add-on manager.
ui/button/toggle - Archive of obsolete content
for example, sup
pose the browser has two windows (w1 and w2), and each window has two tabs.
...the only pur
pose of the extra event is that change is a more natural event name for a toggle button, as it matches the change event emitted by elements like <select> and <input>.
util/list - Archive of obsolete content
list is com
posed out of iterable, therefore it provides custom enumeration behavior that is similar to array (enumerates only on the elements of the list).
... examples: var { list } = require("sdk/util/list"); var mylist = list.com
pose({ add: function add(item1, item2, /*item3...*/) { array.slice(arguments).foreach(this._add.bind(this)); }, remove: function remove(item1, item2, /*item3...*/) { array.slice(arguments).foreach(this._remove.bind(this)); } }); mylist('foo', 'bar', 'baz').length == 3; // true new mylist('new', 'keyword').length == 2; // true mylist.apply(null, [1, 2, 3]).length == 3; // true let list = mylist(); list.length == 0; // true list.add(1, 2, 3) == 3; // true properties length number of elements in this list.
View Source for XUL Applications - Archive of obsolete content
importing gviewsourceutils xul applications wanting to show the source code for documents should import the viewsourceutils.js script instead of attempting to open the viewsource.xul window themselves: <script type="application/javascript" src="chrome://global/content/viewsourceutils.js"/> viewsourceutils.js ex
poses a gviewsourceutils global into the scope of the window that imports that script.
... method overview gviewsourceutils ex
poses several methods, but the only one you should be using directly is the viewsource method.
Extension Etiquette - Archive of obsolete content
generic prefixes such as myextension-, or short prefixes such as ffx-, are likely to be used elsewhere, and therefore unsuitable to the pur
pose.
...make sure your extension's homepage states the "obvious," including the pur
pose of your extension.
Jetpack Processes - Archive of obsolete content
a mechanism to optionally disable this feature has been pro
posed in bug 614351.
...individual lines of the form //@line 1 "foo.js" can be used to specify filename and line number information for debugging pur
poses.
The Box Model - Archive of obsolete content
any xul interface can be broken down into the following basic components: boxes text images alignment and flexibility widths and heights margins and paddings menus, toolbar buttons, and even the most complex elements in xul are com
posed of these simple ingredients.
... here's a very simple example of an hbox with 3 child buttons: <hbox> <button label="cat" /> <button label="parrot" /> <button label="porcupine" /> </hbox> this is how it looks on mac os (the black border was added for illustrative pur
poses, boxes don't have borders by default): if you use a vbox instead, it looks like this: the orientation of boxes (and most xul elements) can be controlled using the orient attribute or the -moz-box-orient css property.
List of Mozilla-Based Applications - Archive of obsolete content
belgum internet tv service basilisk pre-servo xul-based web browser uses most of the firefox 55 source code batik java-based toolkit uses mozilla rhino bitbox security focused browser seemingly based on firefox blackbird browser for african american community bluegriffon wysiwyg editor next generation version of com
poser buzzbird twitter client built on xulrunner camino browser 2.5m downloads and ~400,000 active users ...
...red by xulrunner foxkeh clock clock frizione javascript development, testing and deployment environment uses mozilla rhino geckofx embeddable gecko gjs javascript bindings for gnome globalmojo browser that raises money for your favorite causes gluescript a javascript engine which can be used as a general pur
pose language uses mozilla spidermonkey and formerly called wxjavascript gnome operating system gnome 3 will use spidermonkey through gjs google adwords editor editor google gadgets for linux google’s desktop widget engine uses xulrunner according to the build instructions grani grain sizing assessment tool according to this wiki page g...
Defining Cross-Browser Tooltips - Archive of obsolete content
the solution the most obvious solution is to use the alt and title attributes for their intended pur
poses, instead of adhering to their historical misuses.
... if such a find-and-replace operation is somehow not feasible, authors with the ability to run proxy servers can use the approach pro
posed by christian jensen (cf.
Documentation for BiDi Mozilla - Archive of obsolete content
text fields and com
poser the specification of the bidi changes to com
poser was posted in the editor and i18n newsgroups, and responses there were taken into account.
...the text pasted from the clipboard (to the com
poser or to an edit field) is pasted as is.
JavaScript Client API - Archive of obsolete content
y be downloaded) a separate, conspicuous, and 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 pur
pose; (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 n...
...its pur
pose in life is to track changes to whatever data type you are syncing.
Hidden prefs - Archive of obsolete content
mail composition "other header" pref ("mail.com
pose.other.header") the format for this a comma delimited list of mail headers, like "approved,x-no-archive" an example for your prefs.js would be: user_pref("mail.com
pose.other.header", "approved"); this will cause "approved" to show up in the com
pose window address picker, under to:, cc:, bcc:, newsgroup:, etc.
...| mail & newsgroups | addressing" "other com
pose header" pref from mailnews.js: // you can specify a comma delimited list of optional headers // this will show up in the address picker in the com
pose window // examples: "x-face" or "approved" pref("mail.com
pose.other.header", "approved,x-no-archive"); ...
Modularization techniques - Archive of obsolete content
introduction the pur
pose of this document is provide all the information you need to create a new mozilla module or break existing code into a module.
...*aresult = null; nsisupports inst = new nssamplefactory(); if (inst == null) { return ns_error_out_of_memory; } nsresult res = inst->queryinterface(kifactoryiid, aresult); if (res != ns_ok) { // we didn't get the right interface, so clean up delete inst; } return res; } file main.cpp main.cpp is a simple program that creates an instance of our sample class and dis
poses of it.
Plug-n-Hack - Archive of obsolete content
overview plug-n-hack (pnh) is a pro
posed standard from the mozilla security team for defining how security tools can interact with browsers in a more useful and usable way.
...while some of the pnh capabilities do have a fixed meaning, particularly around proxy configuration, most of the capabilities are completely generic, allowing tools to ex
pose whatever functionality they want.
Safely loading URIs - Archive of obsolete content
these methods are ex
posed on the nsiscriptsecuritymanager interface and are called checkloaduri, checkloaduriwithprincipal, and checkloaduristr.
... all three methods take three arguments: the first argument identifies the source of the uri, the second argument is the uri that one plans to load, and the third argument is a set of flags that can be used to im
pose additional restrictions on the uris that may be loaded.
XTech 2005 Presentations - Archive of obsolete content
these include plans to ex
pose the rdf api to public web content, as well as performance and correctness improvements.
...to realize this potential in web applications, browsers must ex
pose rich new graphics apis to web content.
Introduction to XUL - Archive of obsolete content
the intention is to build cross-platform applications like browsers and mail clients from a set of tools designed for that pur
pose.
...(for standards pur
poses, we will probably need to change the the mime type to something like "text/x-xul".) these files are processed using the same parser as "text/xml" files (and therefore subject to xml syntax rules, as they should be).
Menus - Archive of obsolete content
the menu and each menuitem has a label indicating its pur
pose.
...if you want to create a general pur
pose popup that isn't a menu, use a panel instead.
Code Samples - Archive of obsolete content
change the first line to specify the page that you want to open: const url = "http://www.mozilla.org/" var uri = components .classes["@mozilla.org/network/simple-uri;1"] .getservice(components.interfaces.nsiuri) uri.spec = url components .classes["@mozilla.org/uriloader/external-protocol-service;1"] .getservice(components.interfaces.nsiexternalprotocolservice) .loadurl(uri) com
pose an e-mail to com
pose an e-mail, use the same code as in the section open a web page above.
...rds* const name = "toolkit:passwordmanager" const uri = "chrome://passwordmgr/content/passwordmanager.xul" seamonkey navigator const name = "navigator:browser" const uri = "chrome://navigator/content/" mail & newsgroups const name = "mail:3pane" const uri = "chrome://messenger/content/" com
poser const name = "com
poser:html" const uri = "chrome://editor/content/" address book const name = "mail:addressbook" const uri = "chrome://messenger/content/addressbo...ddressbook.xul" irc chat const name = "irc:chatzilla" const uri = "chrome://chatzilla/content/" calendar const name = "cale...
Input Controls - Archive of obsolete content
in xul, you can use the textbox element for this pur
pose as well -- two separate elements are not necessary.
...radio buttons can be used for a similar pur
pose when there are a set of them and only one can be selected at once.
Archived Mozilla and build documentation - Archive of obsolete content
plug-n-hack plug-n-hack (pnh) is a pro
posed standard from the mozilla security team for defining how security tools can interact with browsers in a more useful and usable way.
... table cellmap the table layout use the cellmap for two pur
poses: table cellmap - border collapse this document describes the additional information that is stored for border collapse tables in the cellmap.
Gecko Compatibility Handbook - Archive of obsolete content
since a browser is sup
posed to ignore html tags it does not recognize and render the content inside the tags, web page authors have used the technique of combining proprietary html that will work as expected in each browser.
...we will have more to say about doctypes later in this article, but essentially the doctype is sup
posed to indicate to a browser what version of html is used in the page.
NPObject - Archive of obsolete content
npobject is the type used to express objects ex
posed by either the plugin or by the browser through this api.
... the browsers are expected to ex
pose their window objects and everything reachable from it through this api.
The First Install Problem - Archive of obsolete content
pro
posed solution on mac os x, the system's plugins folder will probably suffice as an install location in which browsers installed later can find their plugins.
...this document pro
poses a meta-information model in the win32 registry similar to the one used by microsoft's hkey_classes_root\clsid\ where a new activex control (ocx) on the system presents its uuid as a registry key (identifying the activex control) as well as information about where to find the ocx (e.g.
What is RSS - Archive of obsolete content
(although some were using rss 0.93 and rss 0.94 even though they weren't sup
posed to.) in september 2002 userland released rss 2.0.
... rss 2.0 was meant to be a replacement for rss 0.92 (and the rss 0.93 and rss 0.94 drafts that no one was sup
posed to use).
Threats - Archive of obsolete content
information passes to a person who
poses as the intended recipient.
...for example, sup
pose the site www.example.net pretends to be a furniture store when it is really just a site that takes credit-card payments but never sends any goods.
Browser Detection and Cross Browser Support - Archive of obsolete content
since the user agent string was ex
posed as a property of the navigator object (e.g.
... recommendations target the standards and not particular browsers while the period from 1994-2000 was dominated by incompatible non-standard browsers from netscape and microsoft, today the dominating factor in web development are the standards pro
posed by the world wide web consortium (w3c).
Generator comprehensions - Archive of obsolete content
sup
pose we have an iterator it which iterates over a large sequence of integers.
...m it, doubled when a generator comprehension is used as the argument to a function, the parentheses used for the function call means that the outer parentheses can be omitted: var result = dosomething(for (i in it) i * 2); the significant difference between the two examples being that by using the generator comprehension, you would only have to loop over the 'obj' structure once, total, as op
posed to once when comprehending the array, and again when iterating through it.
XForms Custom Controls - Archive of obsolete content
pur
pose you are in the right place if you would like to create your own custom renderings of the xforms controls like input, output, trigger, etc.
...the pur
pose of this article is to give you enough background information so that you'll be able to get a good start.
Requests For Enhancement - Archive of obsolete content
introduction the pur
pose of this page is to gather requests for enhancement to the mozilla xforms implementation.
... enhancements of xforms elements if you find that none of the elements pro
posed by the xforms spec address your requirements, please post your usecase here.
GLSL Shaders - Game development
the pur
pose of the vertex shader is to set up the gl_position variable — this is a special, global, and built-in glsl variable.
...the pur
pose of the fragment shader is to set up the gl_fragcolor variable.
Desktop gamepad controls - Game development
an api ex
poses all the information you need to hook up your game's logic and successfully control the user interface and gameplay.
...received values are assigned to the proper objects and returns the pressed info for debugging pur
poses.
Implementing controls using the Gamepad API - Game development
(we could use the gamepad.connected boolean for this pur
pose, but we wanted to have a separate variable for turning on turbo mode without needing to have a gamepad connected, for reasons explained above.) disconnect: function(evt) { gamepadapi.turbo = false; delete gamepadapi.controller; console.log('gamepad disconnected.'); }, the disconnect function sets the gamepad.turbo property to false and removes the variable containing the gamepad object.
...ons[b].pressed) { pressed.push(gamepadapi.buttons[b]); } } } // loop through axes and push their values to the array var axes = []; if(c.axes) { for(var a=0,x=c.axes.length; a<x; a++) { axes.push(c.axes[a].tofixed(2)); } } // assign received values gamepadapi.axesstatus = axes; gamepadapi.buttonsstatus = pressed; // return buttons for debugging pur
poses return pressed; }, on every frame, update() saves buttons pressed during the previous frame to the buttonscache array and takes fresh ones from the gamepadapi.controller object.
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-ex
posed region of content, which may introduce slow-down.
...requestanimationframe includes a domhighrestimestamp in its callback function prototype, which you definitely should use (as op
posed to using the date object), as this will be the time the frame began rendering, and ought to make your animations look more fluid.
Plug-in Development Overview - Gecko Plugin API Reference
for more information about mime types, see these mime rfcs: rfc-2045: "multipur
pose internet mail extensions (mime) part one: format of internet message bodies" rfc-2046: "multipur
pose internet mail extensions (mime) part two: media types" rfc-4288: "media type specifications and registration procedures" there are some variations to how plug-ins are handled on different platforms.
...both technologies are now obsolete for the pur
poses of plug-in scriptability, and the cross-browser npruntime api should be used instead.
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-ex
pose-headers).
... by default, the safelist includes the following response headers: cache-control content-language content-type expires last-modified pragma examples extending the safelist you can extend the list of cors-safelisted response headers by using the access-control-ex
pose-headers header: access-control-ex
pose-headers: x-custom-header, content-length ...
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 ex
posed when the credentials flag is true.
... access-control-ex
pose-headers indicates which headers can be ex
posed as part of the response by listing their names.
TLD - MDN Web Docs Glossary: Definitions of Web-related terms
depending on how strict an administrating organization might be, tld often serves as a clue to the pur
pose, ownership, or nationality of a website.
... sponsored top-level domains (stld) these domains are pro
posed and sponsored by private organizations that decide whether an applicant is eligible to use the tld, based on community theme concepts.
Brotli - MDN Web Docs Glossary: Definitions of Web-related terms
brotli is a general-pur
pose lossless compression algorithm.
... it compresses data using a combination of a modern variant of the lz77 algorithm, huffman coding, and second-order context modeling, providing a compression ratio comparable to the best currently available general-pur
pose compression methods.
CSS and JavaScript accessibility best practices - Learn web development
by the same token, a heading loses its visual pur
pose if you style it so it doesn't look like a heading.
...listitem = document.createelement('li'); const anchor = document.createelement('a'); anchor.textcontent = testitem.input.name + ' field is empty: fill in your ' + testitem.input.name + '.'; anchor.href = '#' + testitem.input.name; anchor.onclick = function() { testitem.input.focus(); }; listitem.appendchild(anchor); errorlist.appendchild(listitem); } each link serves a dual pur
pose — it tells you what the error is, plus you can click on it/activate it to jump straight to the input element in question and correct your entry.
Test your skills: Images and Form elements - Learn web development
for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the example as displayed in the image: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
Test your skills: Overflow - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the example as displayed in the image: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
Test your skills: position - Learn web development
for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work pur
poses, download the starting point for this task to work in your own editor or in an online editor.
How CSS is structured - Learn web development
previous overview: first steps next now that you are beginning to understanding the pur
pose and use of css, let's examine the structure of css.
... .special { color: red; } p { color: blue; } sup
pose that in our html document, we have a paragraph with a class of special.
What is CSS? - Learn web development
for example, you could take a look at the mdn reference to the backgrounds and borders module to find out what its pur
pose is, and what different properties and other features it contains.
... css specifications all web standards technologies (html, css, javascript, etc.) are defined in giant documents called specifications (or simply "specs"), which are published by standards organizations (such as the w3c, whatwg, ecma, or khronos) and define precisely how those technologies are sup
posed to behave.
Styling links - Learn web development
we also use background-size to specify the size we want the background image to be shown at — it is useful to have a larger icon and then resize it like this as needed for responsive web design pur
poses.
... the last three declarations are pretty simple and are mainly just for cosmetic pur
poses.
How to structure a web form - Learn web development
the <fieldset> and <legend> elements the <fieldset> element is a convenient way to create groups of widgets that share the same pur
pose, for styling and semantic pur
poses.
...the text content of the <legend> formally describes the pur
pose of the <fieldset> it is included inside.
Tips for authoring fast-loading HTML pages - Learn web development
use a content delivery network (cdn) for the pur
poses of this article, a cdn is a means to reduce the physical distance between your server and your visitor.
...sup
pose your website server is located in the united states and it has a visitor from india; the page load time will be much higher for the indian visitor compared to a visitor from the us.
Advanced text formatting - Learn web development
the pur
pose of these lists is to mark up a set of items and their associated descriptions, such as terms and definitions, or questions and answers.
...the <time> element allows you to attach an unambiguous, machine-readable time/date for this pur
pose.
Document and website structure - Learn web development
the footer is also sometimes used for seo pur
poses, by providing links for quick access to popular content.
...for example: <p>the king walked drunkenly back to his room at 01:00, the beer doing nothing to aid him as he staggered through the door <span class="editor-note">[editor's note: at this point in the play, the lights should be down low]</span>.</p> in this case, the editor's note is sup
posed to merely provide extra direction for the director of the play; it is not sup
posed to have extra semantic meaning.
HTML Tables - Learn web development
a very common task in html is structuring tabular data, and it has a number of elements and attributes for just this pur
pose.
... guides this module contains the following articles: html table basics this article gets you started with html tables, covering the very basics such as rows and cells, headings, making cells span multiple columns and rows, and how to group together all the cells in a column for styling pur
poses.
Introduction to events - Learn web development
note: event handlers are sometimes called event listeners — they are pretty much interchangeable for our pur
poses, although strictly speaking, they work together.
...onst para = document.queryselector('p'); form.onsubmit = function(e) { if (fname.value === '' || lname.value === '') { e.preventdefault(); para.textcontent = 'you need to fill in both names!'; } } obviously, this is pretty weak form validation — it wouldn't stop the user validating the form with spaces or numbers entered into the fields, for example — but it is ok for example pur
poses.
Third-party APIs - Learn web development
the pur
pose of these is so that the user knows what is going on in the websites they visit and is less likely to fall victim to someone using an api in a malicious way.
...for the google maps api in particular, you need to provide a credit card for billing pur
poses (although basic usage is free), which we didn't think was acceptable for a basic tutorial.
Server-side web frameworks - Learn web development
— other factors include: framework pur
pose/origin: some web frameworks were initially created to solve certain types of problems, and remain better at creating web apps with similar constraints.
...there are many excellent independent components, but sometimes it can be hard to work out which is the best for a particular pur
pose!
Framework main features - Learn web development
sup
pose you're building a website for an online magazine, and you need to be sure that each contributing writer gets credit for their work.
... components in components one key benefit of component-based ui architecture is that components can be com
posed together.
Beginning our React todo list - Learn web development
the aria-labelledby attribute tells assistive technologies that we're treating our list heading as the label that describes the pur
pose of the list beneath it.
... making this association gives the list a more informative context, which could help screen reader users better understand the pur
pose of it.
Componentizing our Svelte app - Learn web development
repl to code along with us using the repl, start at https://svelte.dev/repl/99b9eb228b404a2f8c8959b22c0a40d3?version=3.23.2 breaking the app into components in svelte, an application is com
posed from one or more components.
...components can be big or small, but they are usually clearly defined: the most effective components serve a single, obvious pur
pose.
Working with Svelte stores - Learn web development
to handle those situations, we can take advantage of aria live regions, which provide a way to programmatically ex
pose dynamic content changes so that they can be detected and announced by assistive technologies.
...if you have a central place where all the state modification is applied, components could just call those methods to modify the app's state and reactively display the info ex
posed by the store.
Handling common accessibility problems - Learn web development
html semantic html (where the elements are used for their correct pur
pose) is accessible right out of the box — such content is readable by sighted viewers (provided you don't do anything silly like make the text way too small or hide it using css), but will also be usable by assistive technologies like screen readers (apps that literally read out a web page to their user), and confer other advantages too.
...see desktop mouse and keyboard controls for some game-related examples that can be adapted for any pur
pose.
Setting up your own test automation environment - Learn web development
if you wish to extract these results for reporting pur
pose from lambdatest platform then you can do so by using lambdatest restful api.
...we have tested this locally, but you could set this up on just about any server along with the relevant browser drivers, and then connect your scripts to it using the url you choose to ex
pose it at.
Introducing a complete toolchain - Learn web development
checking the file (and not saving it) is useful for pur
poses like checks that run before a release - i.e.
... although this stage of our toolchain can be quite painful, because we've chosen a tool that pur
posely tries to reduce configuration and complexity, there's really nothing more we need to do during the development phase.
Learn web development
random glossary entry semantics in programming, semantics refers to the meaning of a piece of code — for example "what effect does running that line of javascript have?", or "what pur
pose or role does that html element have" (rather than "what does it look like?".) topics covered the following is a list of all the topics we cover in the mdn learning area.
... html — structuring the web html is the language that we use to structure the different parts of our content and define what their meaning or pur
pose is.
Information for Assistive Technology Vendors
in addition, we provide some simple interfaces via which we ex
pose a read-only dom (document object model).
... pur
pose newsgroup mailing list google group developer discussion mozilla.dev.accessibility subscribe/unsubscribe google group end user support mozilla.support.accessibility subscribe/unsubscribe google group ...
Choosing the right memory allocator
allocating memory in xpcom these are general pur
pose memory-management routines that you should use unless your code falls into one of the other categories below.
... js_malloc() js_realloc() js_free() js_strdup() arena allocators nspr ex
poses arena allocators that can be used to efficiently allocate lots of small, uniformly sized objects.
The Firefox codebase: CSS Guidelines
for testing pur
poses, here is an example of a webextension theme.
... never write css specially for the built-in light/dark theme in compacttheme.css unless that css isn't sup
posed to affect webextension themes.
Eclipse CDT Manual Setup
note the requirements that this method of build option discovery im
poses on us.
... below we will configure eclipse's build step so that you use it only occasionally to manually trigger a special "build" (actually a fast script that fakes a build) purely for the pur
poses of setting/updating the compiler options that eclipse associates with each source file.
Gecko Logging
log level numeric value pur
pose mozilla logging levels disabled 0 indicates logging is disabled.
... the log crate lists the available log levels: log level pur
pose rust logging levels error designates very serious errors.
Reviewer Checklist
good web citizenship make sure new web-ex
posed apis actually make sense and are either standards track or preffed off by default.
... [fennec: android services has logger.pii() for this pur
pose (e.g., logging profile dir)].
mach
if you don't use mach, you have to find another solution for the following problems: discovering what commands or make targets are available (mach ex
poses everything through mach help while inside "mozilla-central" , else you'll just get a cryptic error message) making more sense out of command output (mach offers terminal colorization and structured logging) getting productive tools in the hands of others (mach "advertises" tools to people through mach help (unless it actually just gives you a cryptic error message) - in the former case, people...
...instead, it aims to ex
pose that tooling through a common, shared interface.
Experimental features in Firefox
these nightly builds of firefox typically include experimental or partially-implemented features, including those for pro
posed or cutting-edge web platform standards.
...the hit region api allows you define an area of your canvas and provides another possibility to ex
pose interactive content on a canvas to accessibility tools.
Embedding Tips
the nsiauthprompt interface allows the networking layer to
pose a user / password prompt to obtain the values needed for authentication.
... your own implementation should
pose this dialog, or fill in the values that are needed for the upload to succeed.
HTML parser threading
the method implementations assert which thread they are sup
posed to be called on.
...nodes created by tree ops are owned by the parser for the lifetime of the parser, so for refcounting pur
poses, the parser owns each nsicontent object it creates by one reference no matter how many copies of the content handle for the node exist inside the parser.
Introduction to Layout in Mozilla
ext non-geometric information may be shared by adjacent frames reference counted, owned by frame view clipping, z-order, transparency [0..1] per frame, owned by frame widget native window [0..1] per view, owned by view key data structures the document owns the content model, and one or more presentations ex
posed programmatically via dom apis the presentation owns the frame hierarchy frames own the style contexts, views, widgets presentation has media type, dimensions, etc.
...“in the flow” incremental reflow multiple reflow commands are batched nsreflowpath maintains a tree of target frames amortize state recovery and damage propagation cost painting as reflow proceeds through the frame hierarchy, areas are invalidated via nsiviewmanager::updateview unless immediate, invalid areas are coalesced and processed asynchronously via os ex
pose event native ex
pose event dispatched to widget; widget delegates to the view manager view manager 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 unwi...
Assert.jsm
json.stringify is not designed to be used for this pur
pose; objects may have ambiguous tojson() implementations that would influence the test.
... all assertion methods provide both the actual and expected values to the assertion error for display pur
poses.
Localizing with Pontoon
note that for our pur
poses here, we'll be using firefox affiliates website to demo pontoon's functionality and workflow.
... publishing your localization sup
pose you now want to publish your l10n work by committing it to a repo.
Gecko Profiler FAQ
for this pur
pose you should try to use a native profiler on your platform of choice (for example xperf/vtune on windows, instruments on osx, and perf/zoom on linux.) one workaround is to break the hot function into several explicitly-non-inline helpers, recompile, and re-profile.
...the profile contains markers for dom events, and those include user-generated events like mouse clicks, but these markers are only ex
posed as a huge unsearchable list in the markers tab.
Leak-hunting strategies and tips
xpconnect allows an xpcom object to be ex
posed to javascript, and it allows certain javascript objects to be ex
posed to c++ code as normal xpcom objects.
... when a c++ object is ex
posed to javascript (the more common of the two), an xpcwrappednative object is created.
Memory Profiler
however, the information ex
posed in this way is usually a snapshot and the history of how memory has been used goes missing.
...it's sup
posed to profile a very long time period without problem.
powermetrics
user%: percentage of that cpu time spent in user space (as op
posed to kernel mode.) deadlines (<2 ms, 2-5 ms): these two columns count how many "short" timers woke up threads in the process, per second, during the sample period.
...the second column counts "package idle exit" wakeups, which wake up the entire package as op
posed to just a single core; such wakeups are particularly expensive, and this count is a subset of the first column's count.
Productization guide
pur
pose of productization there are two main pur
poses of adding default web services to mozilla products: provide users with useful and relevant content demonstrate certain features of the product the first one (provide users with useful and relevant content) is obvious: we want to improve our users’ experience on the web, so we provide a couple of well-thought suggestions for different services.
...the second pur
pose (demonstrate certain features of the product) is equally important: by providing these default services, we demonstrate particular features of the product, the ones which otherwise wouldn’t be as discoverable.
About NSPR
history a good portion of the library's pur
pose, and perhaps the primary pur
pose in the gromit environment, was to provide the underpinnings of the java vm, more or less mapping the sys layer that sun defined for the porting of the java vm to various platforms.
...it is a goal of nspr that nspr im
pose as little overhead as possible in accessing those appropriate system features.
Logging
nspr uses this facility itself for its own development debugging pur
poses.
... log types and variables two types supporting nspr logging are ex
posed in the api: prlogmoduleinfo prlogmodulelevel two environment 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.6xx...
NSS_3.12_release_notes.html
bug 357015: on windows, readsystemfiles reads 21 files as op
posed to 10 files in c:\windows\system32.
...obal salt as having no password bug 405966: unknown signature oid 1.3.14.3.2.29 causes sec_error_bad_signature, 3.11 ignores it bug 413010: cert_comparerdn may return a false match bug 417664: false positive crl revocation test on ppc/ppc64 nss_enable_pkix_verify=1 bug 404526: glibc detected free(): invalid pointer bug 300929: certificate policy extensions not supported bug 129303: nss needs to ex
pose interfaces to deal with multiple token sources of certs.
NSS Developer Tutorial
a data buffer is usually represented as: unsigned char *data; unsigned int len; the buffer pointer is unsigned char *, as op
posed to void *, so we can perform pointer arithmetic without casting.
... for historical reasons, the buffer length is unsigned int, as op
posed to size_t.
NSS sources building testing
several tools are general pur
pose and can be used to inspect and manipulate the storage files that software using the nss library creates and modifies.
... other tools are only used for testing pur
poses.
PKCS11 FAQ
for the sake of completeness, it's also a good idea to ex
pose public key objects.
... if i have a multipur
pose token that supports all required pkcs #11 functions and provides rsa_pkcs and dsa mechanisms but but not aes, des or rc4, will nss use the token for the rsa_pkcs mechanisms and the nss internal pkcs #11 module for aes, des or rc4 when making an ssl connection?
sslfnc.html
the third parameter to the password callback function is application-defined and can be used for any pur
pose.
... description the ssl_revealurl function is used by certificate authentication callback function to obtain the domain name of the desired ssl server for the pur
pose of comparing it with the domain name in the certificate presented by the server actually contacted.
NSS tools : signtool
for testing pur
poses only, you can create an object-signing certificate with netscape signing tool 1.3.
...to create a file for this pur
pose, enter each of the seven input fields, in order, on a separate line.
Rhino overview
rhino contains all the features of javascript 1.7 allows direct scripting of java a javascript shell for executing javascript scripts a javascript compiler to transform javascript source files into java class files a javascript debugger for scripts executed with rhino language the javascript language itself is standardized by standard ecma-262 ecmascript: a general pur
pose, cross-platform programming language.
...these features are generally not broadly useful, yet they im
pose significant constraints on implementations that hamper or prevent optimization.
Scripting Java
rhino provides a top-level function importpackage that serves the same pur
pose as java's import declaration.
...you must use the java.lang.reflect.array class for this pur
pose.
64-bit Compatibility
for all intents and pur
poses they are also 32-bit on 64-bit platforms: intn, uintn jsintn, jsuintn, jsbool general problems with pointers when performing bitwise operations on pointer values, make sure that both operands are 64-bit.
...a native integer is the size used for intptr_t/uintptr_t, which is usually the width of a general-pur
pose register on the target cpu.
JSAPI Cookbook
*/ js::rootedobject obj(cx, js_new(cx, constructor, args)); if (!obj) return false; calling a global js function // javascript var r = foo(); // where f is a global function /* jsapi * * sup
pose the script defines a global javascript * function foo() and we want to call it from c.
... */ js::rootedvalue r(cx); if (!js_callfunctionname(cx, js_getglobalobject(cx), "foo", 0, null, &r)) return false; calling a js function via a local variable // javascript var r = f(); // where f is a local variable /* jsapi * * sup
pose f is a local c variable of type js::value.
JSFastNative
the term "native" here refers to c/c++ code as op
posed to javascript code.
... argc unsigned int the number of arguments supplied to the function by the caller (as op
posed to, say, the number of arguments the function is specified to take in its jsfunctionspec).
JSNative
the term "native" here refers to c/c++ code as op
posed to javascript code.
... argc unsigned the number of arguments supplied to the function by the caller (as op
posed to, say, the number of arguments the function is specified to take in its jsfunctionspec).
JSObjectOps.newObjectMap
description note: the jsapi does not ex
pose the data structure that would be necessary to develop new jsobjectmap subclasses.
...when nrefs reaches 0 due to a js_dropobjectmap call, jsobjectops.destroyobjectmap will be called to dis
pose of the map.
JS_DefineFunction
description js_definefunction ex
poses a c/c++ function to scripts by defining a new method on an existing javascript object.
...call is a pointer to the c/c++ function that is to be ex
posed to javascript.
JS_GetFunctionObject
in other cases, the object returned by js_getfunctionobject is not necessarily safe to call and should not be ex
posed to script.
...but in the jsapi there are two separate concepts: a jsobject is what is ex
posed to scripts and has properties and can be stored in variables; and the corresponding jsfunction contains the code of a function.
JS_GetLocaleCallbacks
callback functions struct jslocalecallbacks { jslocaletouppercase localetouppercase; jslocaletolowercase localetolowercase; jslocalecompare localecompare; // not used #if ex
pose_intl_api jslocaletounicode localetounicode; }; typedef bool (* jslocaletouppercase)(jscontext *cx, js::handlestring src, js::mutablehandlevalue rval); typedef bool (* jslocaletolowercase)(jscontext *cx, js::handlestring src, js::mutablehandlevalue rval); typedef bool (* jslocalecompare)(jscontext *cx, js::handlestring src1, js::handlestring src2, js::mutablehandle...
...if ex
pose_intl_api is defined, intl api is used instead.
JS_GetParent
such an object should not be passed to any other jsapi function that could ex
pose it to script code.
... an object's parent serves two pur
poses in spidermonkey: for some functions, it is used to implement lexical scoping (but this is an implementation detail).
JS_GetReservedSlot
these fields are not directly ex
posed to scripts.
...(note that private values must not be ex
posed directly to javascript.
JS_InitClass
the jsclass is an internal data structure that is not ex
posed outside the javascript engine.
...they can also have methods and properties that are only present on the constructor; these are called "static methods" and "static properties" because they serve the same pur
pose and use the same syntax as static methods and fields in java.
SpiderMonkey 31
migrating to spidermonkey 31 the first change most embedders will notice is that spidermonkey must now be initialized before it can be used, using the newly-repur
posed js_init method.
...embedders still need to build with nspr, as the new wrappers require using spidermonkey internal functions which are not ex
posed to the public api.
Thread Sanitizer
the default way of symbolizing the traces is much slower than using llvm-symbolizer for that pur
pose: llvm ships with a symbolizer binary that tsan will readily use to immediately output symbolized traces much faster.
...this list is a good tool to temporarily hide some traces, especially for debugging pur
poses.
Mozinfo
mozinfo pro
poses to solve this problem.
...the current implementation ex
poses relevant key, values: os, version, bits, and processor.
A Web PKI x509 certificate primer
key usage this extension is used to constrain the pur
pose for the key in the certificate.
...this is one of the most powerful extensions for businesses to have to help limit risk im
posed by losing the private key of the ca.
Gecko Roles
role_dial represents a dial or knob whose pur
pose is to allow a user to set a value.
... role_date_editor represents control whose pur
pose is to allow a user to edit a date.
The Publicity Stream API
the publicity stream is provided as a central place for applications to publicize application usage for the pur
pose of notifying a user's friends of the applications which their friends are using.
...publicity stream api (navigator.apps.publicity.*) the publicity api is ex
posed as properties on the navigator.apps.publicity object.
Fun With XBL and XPConnect
exposing the xpcom interfaces one somewhat nasty trick you need to do is to manually ex
pose the interfaces of the xpcom object that you want your widget to support.
...the handler calls the auto complete method we've ex
posed on the widget which in turn forwards the call to the xpcom object, passing in our implementation of nsiautocompletelistener.
Building the WebLock UI
one of the most efficient ways to ex
pose this is to use radio buttons, which allow the user to toggle a particulart state, as the figure above illustrates.
...in overlays the ordinarily unique id attributes that xul elements use to distinguish themselves are pur
posely made redundant with ui in the existing browser with which they should be merged.
Detailed XPCOM hashtable guide
future plans nsisimpleenumerator support the (obsolete) nshashtable has a wrapper that ex
poses an nsisimpleenumerator on its items.
...mozilla has tuned a good general-pur
pose hash algorithm for strings and nsid.
Components.utils.evalInWindow
this does im
pose some restrictions on the sorts of things that can be returned: in particular, the result can't contain any functions, because functions can't be structured-cloned.
... example sup
pose a page script defines a variable: // page-script.js var somelocalvariable = { name: "selection1", node: document.documentelement }; an add-on script or other privileged script can access the variable using evalinwindow(): // 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...
Components.utils.exportFunction
this function provides a safe way to ex
pose a function from a privileged scope to a less-privileged scope.
...sup
pose the content window defines a local variable bar: // page-script.js var bar = {}; now the add-on script can attach the function to bar: // addon-script.js components.utils.exportfunction(greetme, contentwindow.bar, {defineas: "greetme"}); // page-script.js var value = bar.greetme("bob"); console.log(value); // "hello bob" ...
XPConnect wrappers
security wrappers ex
posed to chrome to learn about security wrappers, see the article on script security in gecko.
... note that a previous version of the current page recommended using __ex
posedprops__ to ex
pose objects from chrome to content.
XPCOM glue classes
if there is no base class method with the same signature, a compiler with static-checking enabled will fail to compile.ns_postconditionmacrons_preconditionmacronsacstringthe nsacstring abstract class represents a character string com
posed of single-byte storage units.
... this class is typically used to represent ascii or utf-8 character arrays.nsacstring (external)class declarationnsacstring_internalclass declarationnsadoptingcstringclass declarationnsadoptingstringclass declarationnsastringthe nsastring abstract class represents a character string com
posed of double-byte storage units.
IAccessibleHypertext
other-licenses/ia2/accessiblehypertext.idlnot scriptable this interface ex
poses information about hypertext in a document.
... 1.0 66 introduced gecko 1.9 inherits from: iaccessibletext last changed in gecko 1.9 (firefox 3) the iaccessiblehypertext interface is the main interface to ex
pose hyperlinks in a document, typically a text document, that are used to reference other documents.
mozITXTToHTMLConv
whattodo a bit field com
posed of the conversion control attributes indicating what conversions to apply.
... whattodo a bit field com
posed of the conversion control attributes indicating what conversions to apply.
GroupPosition
remark alternatively this information is ex
posed by nsiaccessible.attribute attribute, also see group attributes page.
... refer to accessible web specifications to get an idea what elements ex
pose group information.
nsIAccessibleEvent
isfromuserinput boolean returns true if the event was caused by explicit user input, as op
posed to purely originating from a timer or mouse movement.
...that is, changes to text that is ex
posed through the iaccessibletext and iaccessibleeditabletext interfaces.
nsIAccessibleRole
role_dial 49 represents a dial or knob whose pur
pose is to allow a user to set a value.
... role_date_editor 69 represents control whose pur
pose is to allow a user to edit a date.
nsIDocShell
app_type_editor 2 this is the value of the apptype attribute used by thunderbird and seamonkey to indicate that email messages or web pages are com
posed in this window.
... load_cmd_pushstate 0x8 returned by the loadtype attribute when the page has used history.pushstate() character set source constants these constants are not ex
posed to script.
nsIHttpChannel
empty headers will have an empty string as value and multiple headers will not be merged as op
posed to getresponseheader().
...empty headers will be have an empty string as value and multiple headers will not be merged as op
posed to visitresponseheaders().
nsIMessenger
displayname the file name for display pur
poses.
... displayname the file name for display pur
poses.
nsIMsgSendLater
inherits from: nsistreamlistener implemented by: @mozilla.org/messengercom
pose/sendlater;1.
... to create an instance, use var msgsendlater = components.classes["@mozilla.org/messengercom
pose/sendlater;1"] .getservice(components.interfaces.nsimsgsendlater); method overview void sendunsentmessages(in nsimsgidentity identity); void removelistener(in nsimsgsendlaterlistener listener); void addlistener(in nsimsgsendlaterlistener listener); nsimsgfolder getunsentmessagesfolder](in nsimsgidentity identity); attributes attribute type description msgwindow nsimsgwindow methods sendunsentmessages() sends all unsent messages for an identity.
nsIScriptableUnescapeHTML
parser/html/nsiscriptableunescapehtml.idlscriptable this interface is a utility interface that ex
poses the kind of markup parser behavior that the feed service needs.
... element the nsidomelement to be used as the context node for the pur
poses of the fragment parsing algorithm.
nsIScrollable
getdefaultscrollbarpreferences(in long scrollorientation); void getscrollbarvisibility(out boolean verticalvisible, out boolean horizontalvisible); void getscrollrange(in long scrollorientation, out long minpos, out long maxpos); obsolete since gecko 29.0 void setcurscrollpos(in long scrollorientation, in long curpos); obsolete since gecko 29.0 void setcurscroll
posex(in long curhorizontalpos, in long curverticalpos); obsolete since gecko 29.0 void setdefaultscrollbarpreferences(in long scrollorientation, in long scrollbarpref); void setscrollrange(in long scrollorientation, in long minpos, in long maxpos); obsolete since gecko 29.0 void setscrollrangeex(in long minhorizontalpos, in long maxhorizontalpos, in long minverticalpos, in ...
... setcurscroll
posex() obsolete since gecko 29.0 (firefox 29.0 / thunderbird 29.0 / seamonkey 2.26) void setcurscroll
posex( in long curhorizontalpos, in long curverticalpos ); parameters curhorizontalpos an integer representing the horizontal position of the cursor.
nsITextInputProcessorCallback
example of simple js-ime: var simpleime = { _hasfocus: false, _hasrightstocom
pose: 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._hasrightstocom
pose = false; break; } return true; } catch (e) { return false; } }, setcomposition: function simpleime_setcomposition(atext, aclauses, acaret) { if (!this._tip) { this._tip = components.classes["@mozilla.org/text-input-processor;1"].
nsIWebBrowserPersist
encode_flags_selection_only 1 output only the current selection as op
posed to the whole document.
... saveprivacyawareuri() save the specified uri to file, explicitly dictating whether the operation should be considered private for the pur
poses of network requests, caching, etc.
Getting Started Guide
in each case, you are essentially extracting the raw pointer value for your own pur
pose.
... you can tell callers you are giving them ownership in a way that doesn't
pose this hazard by returning a already_addrefed<t> (see bug #59212).
Using the clipboard
for example, a textbox would accept "text/unicode" (or "text/plain") while a com
poser window might accept html and image data.
...the code below can be used for this pur
pose: if (str) { var pastetext = str.value.queryinterface(ci.nsisupportsstring).data; } because the data from the transferable is an nsisupportsstring, we need to convert it into a javascript string.
Mozilla technologies
the publicity stream is provided as a central place for applications to publicize application usage for the pur
pose of notifying a user's friends of the applications which their friends are using.
...the module is structured as a drop-in component and ex
poses its xml-as-data features both to javascript and c++/xpcom users.
Address Book examples
there are several hooks in the address book code ex
posed to add-on developers to help extend the behavior of the address book.
... load and save listeners edit dialogs for both contacts and mailing lists ex
pose functions for registering load and save listeners.
Mail and RDF
mozilla mail ex
poses many of it's data structures to rdf through a few datasources.
... there are of course many more properties that are ex
posed via rdf, but this should give you a feel for it.
Mail client architecture overview
most of these modules have little dependancy on the mail reader itself: com
pose - the mail com
pose module is responsible for anything that has to do with sending mail.
... this includes the mail com
pose window, creation of rfc822 messages from the data a user has entered, and sending the messages via smtp.
libmime content type handlers
pizzarro <rhp@netscape.com> contents overview api's plugin location/installation sample content type handler plugin overview the libmime module implements a general-pur
pose mime parser and one of the primary methods provided by the parser is the ability to emit an html representation of an input stream.
...the primary * pur
pose 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 nsimimecontenttypeha...
Working with windows in chrome code
sup
pose you're developing a browser extension that consists of a browser.xul overlay and an options window.
... sup
pose the overlay contains a button to open the extension's options window which needs to read some data from the browser window.
Standard OS Libraries
wayland is not considered stable, but it's sup
posed to replace xorg in the long term.
...the list of the ex
posed symbols/functions can be found here: gnome developer :: gtk+ reference manual.
Plug-in Development Overview - Plugins
for more information about mime types, see these mime rfcs: rfc-2045: "multipur
pose internet mail extensions (mime) part one: format of internet message bodies" rfc-2046: "multipur
pose internet mail extensions (mime) part two: media types" rfc-4288: "media type specifications and registration procedures" there are some variations to how plug-ins are handled on different platforms.
...both technologies are now obsolete for the pur
poses of plug-in scriptability, and the cross-browser npruntime api should be used instead.
DOM Inspector internals - Firefox Developer Tools
(internally, a panel may be loosely referred to as a "pane", but a panelset is always referred to as a "panelset".) a panel's pur
pose is to manage available viewers.
... host-integration overlays dom inspector is a general-pur
pose extension, suitable for use with any mozilla toolkit host application.
Debugger.Memory - Firefox Developer Tools
function properties of the debugger.memory.prototype object memory use analysis ex
poses implementation details memory analysis may yield surprising results, because browser implementation details that are transparent to content javascript often have visible effects on memory consumption.
... web developers need to know their pages’ actual memory consumption on real browsers, so it is correct for the tool to ex
pose these behaviors, as long as it is done in a way that helps developers make decisions about their own code.
Debugger.Script - Firefox Developer Tools
for example, sup
pose we have a script for the following source code: a=[] for (i=1; i < 10; i++) // it's hip to be square.
... the elements of the array are objects, each of which describes a single entry point, and contains the following properties: linenumber: the line number for which offset is an entry point columnnumber: the column number for which offset is an entry point offset: the bytecode instruction offset of the entry point for example, sup
pose we have a script for the following source code: a=[] for (i=1; i < 10; i++) // it's hip to be square.
CSS Flexbox Inspector: Examine Flexbox layouts - Firefox Developer Tools
if you click on the item, the display shifts to show details about that 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 im
posed 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 a...
...fter all sizing constraints im
posed 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 all the items in the selected flexbox container: you can use this drop-down to select any of the other flex items in the flex container.
Waterfall - Firefox Developer Tools
for example, sup
pose we have code like this: var iterations = 70; var multiplier = 1000000000; function calculateprimes() { console.time("calculating..."); 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 ...
... for example, sup
pose we adapt the code above to make a timestamp every 10 iterations of the loop, labeled with the iteration number: var iterations = 70; var multiplier = 1000000000; function calculateprimes() { console.time("calculating..."); var primes = []; for (var i = 0; i < iterations; i++) { if (i % 10 == 0) { console.timestamp(i.tostring()); } var candidate = i * (multiplier * mat...
ANGLE_instanced_arrays - Web APIs
constants this extension ex
poses one new constant, which can be used in the gl.getvertexattrib() method: ext.vertex_attrib_array_divisor_angle returns a glint describing the frequency divisor used for instanced rendering when used in the gl.getvertexattrib() as the pname parameter.
... methods this extension ex
poses three new methods.
Bluetooth.getAvailability() - Web APIs
the getavailability() method of bluetooth interface of web bluetooth api interface ex
poses the bluetooth capabilities of the current device.
... 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 ex
pose a real value).
Body.body - Web APIs
the body read-only property of the body mixin is a simple getter used to ex
pose a readablestream of the body contents.
... example in our simple stream pump example we fetch an image, ex
pose the response's stream using response.body, create a reader using readablestream.getreader(), then enqueue that stream's chunks into a second, custom readable stream — effectively creating an identical copy of the image.
Using dynamic styling information - Web APIs
the css object model (cssom), part of the dom, ex
poses specific interfaces allowing manipulation of a wide amount of information regarding css.
... the basic style object ex
poses the stylesheet and the cssstylesheet interfaces.
Credential Management API - Web APIs
credentialscontainer ex
poses methods to request credentials and notify the user agent when interesting events occur such as successful sign in or sign out.
... federatedcredential provides information about credentials from a federated identity provider, which is an entity that a website trusts to correctly authenticate a user, and which provides an api for that pur
pose.
DOMPoint - Web APIs
in the following snippet, the
pose of the xr device (such as a vr headset or phone with ar capabilities) can be retrieved by calling using xrframe.getviewer
pose() during an xrsession animation frame, then accessing the resulting xr
pose's transform property, which contains two dompointreadonly attributes: position as a vector and orientation as a quaternion.
... function onxrframe(time, xrframe) { let viewer
pose = xrframe.getviewer
pose(xrreferencespace); if (viewer
pose) { let position = viewer
pose.transform.position; let orientation = viewer
pose.transform.orientation; console.log('xr viewer position: {x: ' + roundtotwo(position.x) + ', y: ' + roundtotwo(position.y) + ', z: ' + roundtotwo(position.z)); console.log('xr viewer orientation: {x: ' + roundtotwo(orientation.x) + ', y: ' + roundtotwo(orientation.y) + ', z: ' + roundtotwo(orientation.z) + ', w: ' + roundtotwo(orientation.w)); } } specifications specification status comment ...
Introduction to the DOM - Web APIs
attribute when an attribute is returned by a member (e.g., by the createattribute() method), it is an object reference that ex
poses a special (albeit small) interface for attributes.
...a namednodemap has an item() method for this pur
pose, and you can also add and remove items from a namednodemap.
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
whitespace is any string of text com
posed only of spaces, tabs or line breaks (to be precise, crlf sequences, carriage returns or line feeds).
...blocks occupy the full width available and are stacked on top of each other, which means that we end up with a layout com
posed of this list of blocks: <block>⏎⇥</block> <block>◦◦hello◦◦</block> <block>⏎◦◦◦</block> <block>◦◦world!◦◦</block> <block>◦◦⏎</block> this is then simplified further by applying the processing rules for whitespace in inline formatting contexts to these blocks: <block></block> <block>hello</block> <block></block> <block>world!</block> <block></block> ...
EXT_texture_compression_bptc - Web APIs
the ext_texture_compression_bptc extension is part of the webgl api and ex
poses 4 bptc compressed texture formats.
... constants the compressed texture formats are ex
posed by 4 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d().
EXT_texture_compression_rgtc - Web APIs
the ext_texture_compression_rgtc extension is part of the webgl api and ex
poses 4 rgtc compressed texture formats.
... constants the compressed texture formats are ex
posed by 4 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d().
Element: blur event - Web APIs
bubbles no cancelable no interface focusevent event handler property onblur sync / async sync com
posed yes examples simple example html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascript const password = document.queryselector('input[type="password"]'); password.addeventlistener('focus', (event) => { event.target.style.background = 'pink'; }); password.addeventlistener('blur', (event) => { event.target.style.background = ''; }); result even...
...orm> javascript const form = document.getelementbyid('form'); form.addeventlistener('focus', (event) => { event.target.style.background = 'pink'; }, true); form.addeventlistener('blur', (event) => { event.target.style.background = ''; }, true); result specifications specification status comment ui events working draft added info that this event is com
posed.
Element: focus event - Web APIs
bubbles no cancelable no interface focusevent event handler property onfocus sync / async sync com
posed yes examples simple example html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascript const password = document.queryselector('input[type="password"]'); password.addeventlistener('focus', (event) => { event.target.style.background = 'pink'; }); password.addeventlistener('blur', (event) => { event.target.style.background = ''; }); result ...
...orm> javascript const form = document.getelementbyid('form'); form.addeventlistener('focus', (event) => { event.target.style.background = 'pink'; }, true); form.addeventlistener('blur', (event) => { event.target.style.background = ''; }, true); result specifications specification status comment ui events working draft added info that this event is com
posed.
Element: focusin event - Web APIs
bubbles yes cancelable no interface focusevent event handler property onfocusin sync / async sync com
posed yes examples live example html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascript const form = document.getelementbyid('form'); form.addeventlistener('focusin', (event) => { event.target.style.background = 'pink'; }); form.addeventlistener('focusout', (event) => { event.target.style.background = ''; }); result specific...
...ations specification status comment ui events working draft added info that this event is com
posed.
Element: focusout event - Web APIs
bubbles yes cancelable no interface focusevent event handler property onfocusout sync / async sync com
posed yes examples live example html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascript const form = document.getelementbyid('form'); form.addeventlistener('focusin', (event) => { event.target.style.background = 'pink'; }); form.addeventlistener('focusout', (event) => { event.target.style.background = ''; }); result specificat...
...ions specification status comment ui events working draft added info that this event is com
posed.
Comparison of Event Targets - Web APIs
there are five targets to consider: property defined in pur
pose event.target dom event interface the dom element on the lefthand side of the call that triggered this event, eg: element.dispatchevent(event) event.currenttarget dom event interface the eventtarget whose eventlisteners are currently being processed.
... event.com
posedtarget event.webidl the original non-native target of the event before composition from shadow dom.
HTMLScriptElement - Web APIs
html <script> elements ex
pose the htmlscriptelement interface, which provides special properties and methods for manipulating the behavior and execution of <script> elements (beyond the inherited htmlelement interface).
...for scripts from other origins, this controls if error information will be ex
posed.
Using microtasks in JavaScript with queueMicrotask() - Web APIs
in order to allow microtasks to be used by third-party libraries, frameworks, and polyfills, the queuemicrotask() method is ex
posed on the window and worker interfaces through the windoworworkerglobalscope mixin.
... simply pass the javascript function to call while the context is handling microtasks into the queuemicrotask() method, which is ex
posed on the global context as defined by either the window or worker interface, depending on the current execution context.
Recommended Drag Types - Web APIs
you can use comments to indicate the pur
pose of a url, the title associated with a url, or other data.
... dragging custom data you can also use other types that you invent for custom pur
poses.
ImageBitmap.close() - Web APIs
the imagebitmap.close() method dis
poses of all graphical resources associated with an imagebitmap.
... var bitmap = offscreen.transfertoimagebitmap(); // imagebitmap { width: 256, height: 256 } bitmap.close(); // imagebitmap { width: 0, height: 0 } -- dis
posed specifications specification status comment html living standardthe definition of 'close()' in that specification.
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 com
posed while offline—that should not be lost before they are backed up into the cloud.
... to use persistent storage with the file system api, chrome ex
poses a requestquota api.
Node.getRootNode() - Web APIs
the available options are: com
posed: a boolean that indicates whether the shadow root should be returned (false, the default), or a root node beyond shadow root (true).
...ent.getrootnode().nodename); // #document console.log(child.getrootnode().nodename); // #document // create a shadowroot var shadowroot = shadowhost.attachshadow({mode:'open'}); shadowroot.innerhtml = '<style>div{background:#2bb8aa;}</style>' + '<div class="js-shadowchild">content</div>'; var shadowchild = shadowroot.queryselector('.js-shadowchild'); // the default value of com
posed is false console.log(shadowchild.getrootnode() === shadowroot); // true console.log(shadowchild.getrootnode({com
posed:false}) === shadowroot); // true console.log(shadowchild.getrootnode({com
posed:true}).nodename); // #document </script> specifications specification status comment domthe definition of 'getrootnode()' in that specification.
OES_vertex_array_object - Web APIs
constants this extension ex
poses one new constant, which can be used in the gl.getparameter() method: ext.vertex_array_binding_oes returns a webglvertexarrayobject object when used in the gl.getparameter() method as the pname parameter.
... methods this extension ex
poses four new methods.
PromiseRejectionEvent - Web APIs
these events are particularly useful for telemetry and debugging pur
poses.
... examples this simple example catches unhandled promise rejections and logs them for debugging pur
poses.
RTCDataChannel.label - Web APIs
you may use the label as you wish; you could use it to identify all the channels that are being used for the same pur
pose, by giving them all the same name.
... or you could give each channel a unique label for tracking pur
poses.
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 pur
poses only, and their inclusion may be blocked by security systems, so do not rely on them having non-null values.
...relatedaddress can be used for diagnostic pur
poses; by observing the relationships between the various types of candidates and their addresses and related addresses.
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 pur
poses only, and their inclusion may be blocked by security systems, so do not rely on them having non-null values.
... usage notes the related address and port are not used by ice itself, and are only present for diagnostic and quality-of-service pur
poses.
RTCPeerConnection.createOffer() - Web APIs
the createoffer() method of the rtcpeerconnection interface initiates the creation of an sdp offer for the pur
pose of starting a new webrtc connection to a remote peer.
... the sdp offer includes information about any mediastreamtracks already attached to the webrtc session, codec, and options supported by the browser, and any candidates already gathered by the ice agent, for the pur
pose of being sent over the signaling channel to a potential peer to request a connection or to update the configuration of an existing connection.
RTCPeerConnection: icecandidate event - Web APIs
indicating the end of a generation of candidates when an ice negotiation session runs out of candidates to pro
pose for a given rtcicetransport, it has completed gathering for a generation of candidates.
... this signal exists for backward compatibility pur
poses 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.
Response.type - Web APIs
it can be one of the following: basic: normal, same origin response, with all headers ex
posed except “set-cookie” and “set-cookie2″.
... note: an "error" response never really gets ex
posed to script: such a response to a fetch() would reject the promise.
SharedWorker() - Web APIs
name optional a domstring specifying an identifying name for the sharedworkerglobalscope representing the scope of the worker, which is mainly useful for debugging pur
poses.
... name: a domstring specifying an identifying name for the sharedworkerglobalscope representing the scope of the worker, which is mainly useful for debugging pur
poses.
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 dis
poses of site data in order to make room for other things.
...both of these values are estimates; there are several reasons why they're not precise: user agents are encouraged to obscure the exact size of the data used by a given origin, to prevent these values from being used for fingerprinting pur
poses.
Streams API - Web APIs
for example, the response body returned by a successful fetch request can be ex
posed as a readablestream, and you can then read it using a reader created with readablestream.getreader(), cancel it with readablestream.cancel(), etc.
... body the response body returned by a successful fetch request is ex
posed by default as a readablestream, and can have a reader attached to it, etc.
WEBGL_compressed_texture_atc - Web APIs
the webgl_compressed_texture_atc extension is part of the webgl api and ex
poses 3 atc compressed texture formats.
... constants the compressed texture formats are ex
posed by 3 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d().
WEBGL_compressed_texture_etc - Web APIs
the webgl_compressed_texture_etc extension is part of the webgl api and ex
poses 10 etc/eac compressed texture formats.
... constants the compressed texture formats are ex
posed by 10 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d().
WEBGL_compressed_texture_etc1 - Web APIs
the webgl_compressed_texture_etc1 extension is part of the webgl api and ex
poses the etc1 compressed texture format.
... constants the compressed texture format is ex
posed 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
the webgl_compressed_texture_pvrtc extension is part of the webgl api and ex
poses four pvrtc compressed texture formats.
... constants the compressed texture formats are ex
posed by four constants and can be used in two functions: compressedteximage2d() (where the height and width parameters must be powers of 2) and compressedtexsubimage2d() (where the the height and width parameters must equal the current values of the existing texture and the xoffset and yoffset parameters must be 0).
WEBGL_compressed_texture_s3tc - Web APIs
the webgl_compressed_texture_s3tc extension is part of the webgl api and ex
poses four s3tc compressed texture formats.
... constants the compressed texture formats are ex
posed by four constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d().
WEBGL_compressed_texture_s3tc_srgb - Web APIs
the webgl_compressed_texture_s3tc_srgb extension is part of the webgl api and ex
poses four s3tc compressed texture formats for the srgb colorspace.
... constants the compressed texture formats are ex
posed by four constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d().
WEBGL_draw_buffers - Web APIs
constants this extension ex
poses new constants, which can be used in the gl.framebufferrenderbuffer(), gl.framebuffertexture2d(), gl.getframebufferattachmentparameter() ext.drawbufferswebgl(), and gl.getparameter() methods.
... methods this extension ex
poses one new method.
WebGLRenderingContext.uniformMatrix[234]fv() - Web APIs
syntax webglrenderingcontext.uniformmatrix2fv(location, trans
pose, value); webglrenderingcontext.uniformmatrix3fv(location, trans
pose, value); webglrenderingcontext.uniformmatrix4fv(location, trans
pose, value); parameters location a webgluniformlocation object containing the location of the uniform attribute to modify.
... trans
pose a glboolean specifying whether to trans
pose the matrix.
Lighting in WebGL - Web APIs
for our pur
poses, we're going to simplify the lighting model by only considering simple directional and ambient lighting; we won't have any specular highlights or point light sources in this scene.
... programinfo.attriblocations.vertexnormal); } finally, we need to update the code that builds the uniform matrices to generate and deliver to the shader a normal matrix, which is used to transform the normals when dealing with the current orientation of the cube in relation to the light source: const normalmatrix = mat4.create(); mat4.invert(normalmatrix, modelviewmatrix); mat4.trans
pose(normalmatrix, normalmatrix); ...
Using textures in WebGL - Web APIs
note that the texture coordinates range from 0.0 to 1.0; the dimensions of textures are normalized to a range of 0.0 to 1.0 regardless of their actual size, for the pur
pose of texture mapping.
... first, the code to specify the colors buffer is gone, replaced with this: // tell webgl how to pull out the texture coordinates from buffer { const num = 2; // every coordinate com
posed of 2 values const type = gl.float; // the data in the buffer is 32 bit float const normalize = false; // don't normalize const stride = 0; // how many bytes to get from one set to the next const offset = 0; // how many bytes inside the buffer to start from gl.bindbuffer(gl.array_buffer, buffers.texturecoord); gl.vertexattribpointer(programinfo.attriblocations.texturecoord...
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
it isn't adequate for the pur
poses of fully managing users, memberships, permissions, and so forth, but provides the basics needed for an unrestricted multi-user communication session.
... where it matters for webrtc pur
poses, these are dealt with in a variety of places within the webrtc infrastructure.
Using DTMF with WebRTC - Web APIs
adding candidates to the caller when the caller's rtcpeerconnection ice layer comes up with a new candidate to pro
pose, it issues an icecandidate event to callerpc.
... function handlecallersignalingstatechangeevent() { log("caller's signaling state changed to " + callerpc.signalingstate); } function handlecallergatheringstatechangeevent() { log("caller's ice gathering state changed to " + callerpc.icegatheringstate); } adding candidates to the receiver when the receiver's rtcpeerconnection ice layer comes up with a new candidate to pro
pose, it issues an icecandidate event to receiverpc.
Fundamentals of WebXR - Web APIs
these are not common among everyday users; they're mostly either experimental, used for demonstration pur
poses, or used by larger organizations.
... general-pur
pose 3d frameworks these frameworks are good for general-pur
pose programming as well as for game development when you want to do the logic yourself.
Using the Web Animations API - Web APIs
css animations have a familiar syntax that breaks down nicely for demonstration pur
poses.
... representing timing properties we’ll also need to create an object of timing properties (an animationeffecttimingproperties object) corresponding to the values in alice’s animation: var alicetiming = { duration: 3000, iterations: infinity } you’ll notice a few differences here from how equivalent values are represented in css: for one, the duration is in milliseconds as op
posed to seconds — 3000 not 3s.
Basic concepts behind Web Audio API - Web APIs
each input or output is com
posed of one or more audio channels, which together represent a specific audio layout.
... the web audio api ex
poses only planar buffers, because it's made for processing.
Web Audio API - Web APIs
this last connection is only necessary if the user is sup
posed to hear the audio.
... analysernode the analysernode interface represents a node able to provide real-time frequency and time-domain analysis information, for the pur
poses of data analysis and visualization.
Attestation and Assertion - Web APIs
they have similar names and similar pur
poses, but understanding the differences may be an initial point of confusion.
... to create android safetynet attestations fido u2f - security keys that implement the fido u2f standard use this format none - browsers may prompt users whether they want a site to be allowed to see their attestation data and/or may remove attestation data from the authenticator's response if the `attestation` parameter in `navigator.credentials.create()` is set to `none` the pur
pose of attestation is to cryptographically prove that a newly generated key pair came from a specific device.
Using Web Workers - Web APIs
so for example, sup
pose a document is served with the following header: content-security-policy: script-src 'self' among other things, this will prevent any scripts it includes from using eval().
... to illustrate this, let's create for didactical pur
pose a function named emulatemessage(), which will simulate the behavior of a value that is cloned and not shared during the passage from a worker to the main page or vice versa: function emulatemessage(vval) { return eval('(' + json.stringify(vval) + ')'); } // tests // test #1 var example1 = new number(3); console.log(typeof example1); // object console.log(typeof emulatemessage(example1)); /...
Window: blur event - Web APIs
bubbles no cancelable no interface focusevent event handler property onblur sync / async sync com
posed yes examples live example this example changes the appearance of a document when it loses focus.
...click outside the document to lose focus.'; } const log = document.getelementbyid('log'); window.addeventlistener('blur', pause); window.addeventlistener('focus', play); result specifications specification status comment ui events working draft added info that this event is com
posed.
Window: focus event - Web APIs
bubbles no cancelable no interface focusevent event handler property onfocus sync / async sync com
posed yes examples live example this example changes the appearance of a document when it loses focus.
...click outside the document to lose focus.'; } const log = document.getelementbyid('log'); window.addeventlistener('blur', pause); window.addeventlistener('focus', play); result specifications specification status comment ui events working draft added info that this event is com
posed.
Privileged features - Web APIs
the page is sup
posed to provide a user interface of its own, usually this feature is used to open xul documents (standard dialogs like the javascript console are opened this way).
...they are said to be dialog because their normal, usual pur
pose is to only notify info and to be dismissed, closed.
Window.requestFileSystem() - Web APIs
it has even been removed from the pro
posed specification.
... return value undefined example specifications specification status comment file and directory entries api draft draft of pro
posed api this api has no official w3c or whatwg specification.
WindowOrWorkerGlobalScope.queueMicrotask() - Web APIs
the queuemicrotask() method, which is ex
posed on the window or worker interface, queues a microtask to be executed at a safe time prior to control returning to the browser's event loop.
... queuemicrotask() is ex
posed on the windoworworkerglobalscope mixin.
WorkerNavigator - Web APIs
this property is kept only for compatibility pur
poses.
...this property is kept only for compatibility pur
poses.
Using XMLHttpRequest - Web APIs
this is what i sup
pose...: */ /* "4\3\7 - einstein said e=mc2" ----> "4\\3\\7\ -\ einstein\ said\ e\=mc2" */ return stext.replace(/[\s\=\\]/g, "\\$&"); } function submitrequest (otarget) { var nfile, sfieldtype, ofield, osegmreq, ofile, bispost = otarget.method.tolowercase() === "post"; /* console.log("ajaxsubmit - serializing form..."); */ this.contenttype = bispost && otarget.enctype ?
...for didactic pur
poses here is a translation of the previous example transformed to use the formdata api.
XMLHttpRequest.open() - Web APIs
user optional the optional user name to use for authentication pur
poses; by default, this is the null value.
... password optional the optional password to use for authentication pur
poses; by default, this is the null value.
XRInputSource.targetRaySpace - Web APIs
to determine the position and orientation of the target ray while rendering a frame, pass it into the xrframe method get
pose() method, then use the returned xr
pose object's transform to gather the spatial information you need.
... function updateinputsources(session, frame, refspace) { for (let source of session.getinputsources()) { let targetray
pose = frame.get
pose(inputsource.targetrayspace, refspace); if (targetray
pose) { if (source.targetraymode == "tracked-pointer") { myrendertargetrayasbeam(targetray
pose); } } /* ...
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-pur
pose gaming device.
... gripspaceread only an xrspace whose origin tracks the
pose which is used to render objects which should appear as if they're held in the hand indicated by handedness.
XRInputSourceEvent - Web APIs
because this is an event frame, not an animation frame, you cannot call the xrframe method getviewer
pose() on it; instead, use get
pose().
... xrsession.addeventlistener("select", event => { let targetray
pose = event.frame.get
pose(event.inputsource.targetrayspace, myrefspace); if (targetray
pose) { let hit = myhittest(targetray
pose.transform); if (hit) { /* handle the hit */ } } }); specifications specification status comment webxr device apithe definition of 'xrinputsourceevent' in that specification.
XRSession.onsqueeze - Web APIs
after checking that the event occurred on the user's dominant hand, the
pose's target ray is obtained.
... xrsession.onsqueeze = event => { if (event.inputsource.handedness == user.handedness) { let targetray
pose = event.frame.get
pose(event.inputsource.targetrayspace, myrefspace); if (user.heldobject && targetray
pose) { dropobjectusingray(user.heldobject, targetray
pose.transform.matrix): } } }; see the examples in the onsqueezestart and onsqueezeend event handlers for the reset of the event handling related to this approach.
XRSession.requestAnimationFrame() - Web APIs
this can be used to obtain the
poses of the viewer and the scene itself, as well as other information needed to render a frame of an ar or vr scene.
... // obtain xr object const xr = navigator.xr // request a new xrsession xr.requestsession("inline").then((xrsession) => { xrsession.requestanimationframe((time, xrframe) => { let viewer = xrframe.getviewer
pose(xrreferencespace) gl.bindframebuffer(xrwebgllayer.framebuffer) for (xrview of viewer.views) { let xrviewport = xrwebgllayer.getviewport(xrview) gl.viewport(xrviewport.x, xrviewport.y, xrviewport.width, xrviewport.height) // webgl draw calls will now be rendered into the appropriate viewport.
XRSession: select event - Web APIs
the handler fetches the
pose representing the target ray for tracked-pointer inputs and sends the
pose's transform to a function called myhandleselectwithray().
... xrsession.addeventlistener("select", event => { if (event.inputsource.targetraymode == "tracked-pointer") { let targetray
pose = event.frame.get
pose(event.inputsource.targetrayspace, myrefspace); if (targetray
pose) { myhandleselectwithray(targetray
pose.transform); } } }); you can of course also set up a handler for select events by setting the xrsession object's onselect event handler property to a function that handles the event: xrsession.onselect = event => { if (event.inputsource.targetraymode == "tracked-pointer") { let targetray
pose = event.frame.get
pose(event.inputsource.targetrayspace, myrefspace); if (targetray
pose) { myhandleselectwithray(targetray
pose.transform); } } }; speci...
XRViewport - Web APIs
after initial setup, it iterates over each of the views within the viewer's
pose, configuring the viewport as dictated by the xrwebgllayer.
... xrsession.requestanimationframe((time, xrframe) => { let viewer
pose = xrframe.getviewer
pose(xrreferencespace); gl.bindframebuffer(xrwebgllayer.framebuffer); for (xrview of viewer
pose.views) { let xrviewport = xrwebgllayer.getviewport(xrview); gl.viewport(xrviewport.x, xrviewport.y, xrviewport.width, xrviewport.height); // now we can use webgl to draw into a viewport matching // the viewer's needs } }); specifications specification status comment webxr device apithe definition of 'xrviewport' in that specification.
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
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.
...the result is a rendering context that looks like the diagram below: each time the xrviewer
pose's views are iterated over for rendering, the rendering loop obtains an xrview for the left eye which has its top-left corner at (0, 0) with its width and height being 1280x1440 pixels.
XRWebGLLayer - Web APIs
this information includes the
pose (an xrviewer
pose object) that describes the position and facing direction of the viewer within the scene as well as a list of xrview objects, each representing one perspective on the scene.
... let
pose = xrframe.getviewer
pose(xrreferencespace); if (
pose) { let gllayer = xrsession.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebffer); for (let view of
pose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); /* render the view */ } } specifications specification status comment webxr device apithe definition of 'xrwebgllayer' in that specification.
Introduction - Web APIs
css (cascade style sheets) was one of the first ways pro
posed by the w3c.
... xsl (extensible stylesheet language) transformations are com
posed of two parts: xsl elements, which allow the transformation of an xml tree into another markup tree and xpath, a selection language for trees.
Using the alertdialog role - Accessibility
which particular control focus should be moved to depends on the pur
pose of the dialog.
... possible effects on user agents and assistive technology when the alertdialog role is used, the user agent should do the following: ex
pose the element as a dialog in the operating system's accessibility api.
ARIA: Navigation Role - Accessibility
associated wai-aria roles, states, and properties aria-label a brief description of the pur
pose of the navigation, omitting the term "navigation", as the screen reader will read both the role and the contents of the label.
...this label will allow an assitive technology user to be able to quickly understand the pur
pose of each landmark.
ARIA: Region role - Accessibility
every element with a region role should include a label that describes the pur
pose of the content in the region, preferably with an aria-labelledby referencing a visible header.
...this label will allow an assitive technology user to be able to quickly understand the pur
pose of each landmark.
ARIA: switch role - Accessibility
possible effects on user agents and assistive technology when the switch role is added to an element, the user agent handles it like this: the element is ex
posed to the system's accessibility infrastructure as having the switch role.
... document.queryselectorall(".switch").foreach(function(theswitch) { theswitch.addeventlistener("click", handleclickevent, false); }); function handleclickevent(evt) { let el = evt.target; if (el.getattribute("aria-checked") == "true") { el.setattribute("aria-checked", "false"); } else { el.setattribute("aria-checked", "true"); } } css the pur
pose of the css is to establish a look and feel for the switch that's reminiscent of the power switch paradigm.
ARIA: dialog role - Accessibility
when the dialog appears on the screen, keyboard focus (whose control depends upon the dialogs pur
pose) should be moved to the default focusable control inside the dialog.
... possible effects on user agents and assistive technology when the dialog role is used, the user agent should do the following: ex
pose the element as a dialog in the operating system's accessibility api.
ARIA: textbox role - Accessibility
focus event handler and aria-activedescendent attribute if you are implementing a composite widget, such as a combobox com
posed of a text box and a listbox, you need to manage the aria-activedescendent attribute using a handler.
... possible effects on user agents and assistive technology when the textbox role is added to an element, or such an element becomes visible, the user agent should do the following: ex
pose the element as having a textbox role in the operating system's accessibility api.
Web Accessibility: Understanding Colors and Luminance - Accessibility
for the pur
poses of this document, we'll use terminlogy as it is defined in the w3c, in the css color module level 3 when working with color, it's important to know which "color space" you are working in, as different color spaces map to different measurement systems.
... in general, for accessibility pur
poses, the more contrast the better.
Accessibility
html: a good basis for accessibility a great deal of web content can be made accessible just by making sure the correct html elements are used for the correct pur
pose at all times.
... other documentation understanding the web content accessibility guidelines this set of articles provides quick explanations to help you understand the steps that need to be taken to conform to the recommendations outlined in the w3c web content accessibility guidelines 2.0 (wcag 2.0 or just wcag, for the pur
poses of this writing).
-moz-user-input - CSS: Cascading Style Sheets
note: -moz-user-input was one of the proposals leading to the pro
posed css 3 user-input property, which has not yet reached candidate recommendation (call for implementations).
... a similar property, user-focus, was pro
posed in early drafts of a predecessor of the css3 ui specification, but was rejected by the working group.
:empty - CSS: Cascading Style Sheets
accessible names ex
pose the interactive control to the accessibility tree, an api that communicates information useful for assistive technologies.
...this is commonly used for buttons that rely solely on an icon to convey pur
pose.
@supports - CSS: Cascading Style Sheets
the following example returns true if and only if the two shorter expressions are simultaneously true: @supports (display: table-cell) and (display: list-item) {} multiple conjunctions can be juxta
posed without the need of more parentheses.
...the following example returns true if at least one of the two shorter expressions is true: @supports (transform-style: preserve) or (-moz-transform-style: preserve) {} multiple disjunctions can be juxta
posed without the need of more parentheses.
Border-radius generator - CSS: Cascading Style Sheets
r = 200; inputslidermanager.setunit(this.topic, units[this.unitr]); inputslidermanager.setmax(this.topic, this.maxr / 2); } radiuscontainer.prototype.updateunits = function updateunits(unit) { if (this.rounded) { this.setunitr(this.unitr); return; } if (unit === 0) this.setunitx(this.unitx); if (unit === 1) this.setunity(this.unity); } radiuscontainer.prototype.com
poseborderradius = function com
poseborderradius () { if (this.rounded === true) { var unit = units[this.unitr]; var value = math.round(this.size / 2); return value + unit; } var unitx = units[this.unitx]; var unity = units[this.unity]; var valuex = math.round(this.width / 2); var valuey = math.round(this.height / 2); if (valuex === valuey && this.unitx === this.unity) retu...
...rn valuex + unitx; return valuex + unitx + ' ' + valuey + unity; } radiuscontainer.prototype.updateborderradius = function updateborderradius () { var radius = this.com
poseborderradius(); var corner = 0; if (this.topic === 'top-left') { subject.style.bordertopleftradius = radius; corner = 0; } if (this.topic === 'top-right') { subject.style.bordertoprightradius = radius; corner = 1; } if (this.topic === 'bottom-right') { subject.style.borderbottomrightradius = radius; corner = 2; } if (this.topic === 'bottom-left') { subject.style.borderbottomleftradius = radius; corner = 3; } tool.updateoutput(corner, radius); } radiuscontainer.prototype.updatecontainer = function updatecontainer(deltax, deltay) { if (this.rounded === true) { t...
Basic Concepts of grid layout - CSS: Cascading Style Sheets
you can also create a grid using flexible sizes with percentages or with the new fr unit designed for this pur
pose.
... grid-column-gap: 10px; grid-row-gap: 1em; border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } any space used by gaps will be accounted for before space is assigned to the flexible length fr tracks, and gaps act for sizing pur
poses like a regular grid track, however you cannot place anything into a gap.
Using the :target pseudo-class in selectors - CSS: Cascading Style Sheets
sup
pose 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.
...id="one">...</h4> <p id="two">...</p> <div id="three">...</div> <a id="four">...</a> <em id="five">...</em> <a href="#one">first</a> <a href="#two">second</a> <a href="#three">third</a> <a href="#four">fourth</a> <a href="#five">fifth</a> conclusion in cases where a fragment identifier points to a portion of the document, readers may become confused about which part of the document they're sup
posed to be reading.
Specificity - CSS: Cascading Style Sheets
specificity is based on the matching rules which are com
posed of different sorts of css selectors.
...in the following case, the selector *[id="foo"] counts as an attribute selector for the pur
pose of determining the selector's specificity, even though it selects an id.
<blend-mode> - CSS: Cascading Style Sheets
<div id="div"></div> #div { width: 300px; height: 300px; background: url('https://mdn.mozillademos.org/files/8543/br.png'), url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: overlay; } darken the final color is com
posed of the darkest values of each color channel.
... <div id="div"></div> #div { width: 300px; height: 300px; background: url('https://mdn.mozillademos.org/files/8543/br.png'), url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: darken; } lighten the final color is com
posed of the lightest values of each color channel.
caption-side - CSS: Cascading Style Sheets
this value was pro
posed for css 2, but removed from the final css 2.1 specification.
... this value was pro
posed for css 2, but removed from the final css 2.1 specification.
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
this value's only pur
pose is to create a new block formatting context (bfc).
... if only an inner value of flex, grid, or flow-root is specified then the specification explains that the outer value should be set to block: "if a <display-inside> value is specified but <display-outside> is omitted, the element’s outer display type defaults to block—except for ruby, which defaults to inline." finally, we have some legacy pre-com
posed inline-level values of: inline-block inline-table inline-flex inline-grid if a supporting browser comes across these as single values then it treats them the same as the two-value versions: inline flow-root inline table inline flex inline grid so all of the current situations are neatly covered, meaning that we maintain compatibility of existing and new sites that use the single ...
font-smooth - CSS: Cascading Style Sheets
antialiased - smooth the font on the level of the pixel, as op
posed to the subpixel.
... grayscale - render text with grayscale antialiasing, as op
posed to the subpixel.
grid-area - CSS: Cascading Style Sheets
if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the pur
pose of finding this position.
...if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the pur
pose of counting this span.
grid-column-end - CSS: Cascading Style Sheets
if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the pur
pose of finding this position.
...if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the pur
pose of counting this span.
grid-column-start - CSS: Cascading Style Sheets
if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the pur
pose of finding this position.
...if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the pur
pose of counting this span.
grid-column - CSS: Cascading Style Sheets
if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the pur
pose of finding this position.
...if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the pur
pose of counting this span.
grid-row-end - CSS: Cascading Style Sheets
if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the pur
pose of finding this position.
...if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the pur
pose of counting this span.
grid-row-start - CSS: Cascading Style Sheets
if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the pur
pose of finding this position.
...if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid, corresponding to the search direction, are assumed to have that name for the pur
pose of counting this span.
grid-row - CSS: Cascading Style Sheets
if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the pur
pose of finding this position.
...if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the pur
pose of counting this span.
image-orientation - CSS: Cascading Style Sheets
description this property is intended only to be used for the pur
pose of correcting the orientation of images which were shot with the camera rotated.
...for any pur
pose other than correcting an image's orientation due to how it was shot or scanned, use a transform property with the rotate keyword to specify rotation.
Video player styling basics - Developer guides
javascript as mentioned above, a data-state attribute is used in various places for styling pur
poses and these are set using javascript.
... styling the resultant video player style used here is rather basic — this is intentional, as the pur
pose is to show how such a video player could be styled and be made responsive.
HTML5 Parser - Developer guides
are not valid javascript escapes; the character code strategy is more general-pur
pose.) inline svg and mathml support as a completely new parsing feature, html5 introduced support for inline svg and mathml in text/html.
... to deal with legacy pages where authors have pasted partial svg fragments into html (who knows why) or used a <math> tag for non-mathml pur
poses, attempts to nest various common html elements as children of svg elements (without foreignobject) will immediately break out of svg or mathml context.
Using HTML sections and outlines - Developer guides
important: there are no implementations of the pro
posed outline algorithm in web browsers nor assistive technology; it was never part of a final w3c specification.
...it is important for developers to use these semantic elements in line with their intended pur
poses.
Index - Developer guides
5 wai aria live regions/api support ajax, accessibility firefox 3 contains important improvements to the way the mozilla engine ex
poses live changes in a document.
...such events are commonly called synthetic events, as op
posed to the events fired by the browser itself.
Writing forward-compatible websites - Developer guides
for the pur
pose of this piece of advice, "current" means the most recent version of a browser you have tested.
... for the pur
pose of this piece of advice, "current" means the most recent version of a browser you have tested, as in the case of the ua sniffing advice above.
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
if you're unhappy with the color that's pro
posed to you, you can change the color scheme, to see if you find something you like better.
... for example, if we don't like the pro
posed greenish-blue color, we can click the triad color scheme icon, which presents us with the following: that greyish blue in the top-right looks pretty good.
The HTML autocomplete attribute - HTML: Hypertext Markup Language
for instance, a browser might let the user save their name, address, phone number, and email addresses for autocomplete pur
poses.
...when creating a new account or changing passwords, this should be used for an "enter your new password" or "confirm new password" field, as op
posed to a general "enter your current password" field that might be present.
HTML attribute: rel - HTML: Hypertext Markup Language
non-standard values apple-touch-icon-precom
posed <!-- third-generation ipad with high-resolution retina display: --> <link rel="apple-touch-icon-precom
posed" sizes="144x144" href="favicon144.png"> <!-- iphone with high-resolution retina display: --> <link rel="apple-touch-icon-precom
posed" sizes="114x114" href="favicon114.png"> <!-- first- and second-generation ipad: --> <link rel="apple-touch-icon-precom
posed" sizes="72x72" h...
...ref="favicon72.png"> <!-- non-retina iphone, ipod touch, and android 2.1+ devices: --> <link rel="apple-touch-icon-precom
posed" href="favicon57.png"> ...
Date and time formats used in HTML - HTML: Hypertext Markup Language
while the gregorian calendar wasn't created until the year 1582 (replacing the similar julian calendar), for html's pur
poses, the gregorian calendar is extended back to the year 1 c.e.
... for the pur
poses of html dates, years are always at least four digits long; years prior to the year 1000 are padded with leading zeroes ("0"), so the year 72 is written as 0072.
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
this can be used, in turn, for styling or scripting pur
poses.
... default styling the pur
pose of this element is purely for the convenience of the author and all browsers display it inline (display: inline) by default, though its default styling varies from one browser to another: some browsers, like internet explorer, do not style it differently than a <span> element.
<acronym> - HTML: Hypertext Markup Language
summary the html acronym element (<acronym>) allows authors to clearly indicate a sequence of characters that com
pose an acronym or abbreviation for a word.
... example <p>the <acronym title="world wide web">www</acronym> is only a component of the internet.</p> default styling though the pur
pose 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.
<br>: The Line Break element - HTML: Hypertext Markup Language
styling with css the <br> element has a single, well-defined pur
pose — to create a line break in a block of text.
... you can set a margin on <br> elements themselves to increase the spacing between the lines of text in the block, but this is a bad practice — you should use the line-height property that was designed for that pur
pose.
<input type="email"> - HTML: Hypertext Markup Language
note: it's also crucial to remember that a user can tinker with your html behind the scenes, so your site must not use this validation for any security pur
poses.
...we want to ensure that not only does the user provide a valid e-mail address, but for security pur
poses, we require that the address be an internal corporate e-mail address.
<input type="range"> - HTML: Hypertext Markup Language
the attributes shared by all <input> elements, range inputs offer the following attributes: attribute description list the id of the <datalist> element that contains optional pre-defined options max the maximum permitted value min the minimum permitted value step the stepping interval, used both for user interface and validation pur
poses list the values of the list attribute is the id of a <datalist> element located in the same document.
... html use similar html as in the previous examples, we add the attribute with a value of vertical: <input type="range" min="0" max="11" value="7" step="1" orient="vertical"> writing-mode: bt-lr; the writing-mode property should generally not be used to alter text direction for internationalization or localization pur
poses, but can be used for special effects.
<input type="tel"> - HTML: Hypertext Markup Language
despite the fact that inputs of type tel are functionally identical to standard text inputs, they do serve useful pur
poses; the most quickly apparent of these is that mobile browsers — especially on mobile phones — may opt to present a custom keypad optimized for entering phone numbers.
...when creating any kind of registration or e-commerce site, for example, you will likely need to ask the user for a telephone number, whether for business pur
poses or for emergency contact pur
poses.
<link>: The External Resource Link element - HTML: Hypertext Markup Language
for example, a link to the site's favicon: <link rel="icon" href="favicon.ico"> there are a number of other icon rel values, mainly used to indicate special icon types for use on various mobile platforms, e.g.: <link rel="apple-touch-icon-precom
posed" sizes="114x114" href="apple-icon-114.png" type="image/png"> the sizes attribute indicates the icon size, while the type contains the mime type of the resource being linked.
... <!-- third-generation ipad with high-resolution retina display: --> <link rel="apple-touch-icon-precom
posed" sizes="144x144" href="favicon144.png"> <!-- iphone with high-resolution retina display: --> <link rel="apple-touch-icon-precom
posed" sizes="114x114" href="favicon114.png"> <!-- first- and second-generation ipad: --> <link rel="apple-touch-icon-precom
posed" sizes="72x72" href="favicon72.png"> <!-- non-retina iphone, ipod touch, and android 2.1+ devices: --> <link rel="apple-touch-icon-precom
pose...
<mark>: The Mark Text element - HTML: Hypertext Markup Language
the html mark text element (<mark>) represents text which is marked or highlighted for reference or notation pur
poses, due to the marked passage's relevance or importance in the enclosing context.
... don't use <mark> for syntax highlighting pur
poses; instead, use the <span> element with appropriate css applied to it.
<tbody>: The Table Body element - HTML: Hypertext Markup Language
the <tbody> element, along with its cousins <thead> and <tfoot>, provide useful semantic information that can be used when rendering for either screen or printer as well as for accessibility pur
poses.
...we do, however, add a slightly more subtle style for header cells contained directly within a <tbody> (as op
posed to those which reside in a <thead>).
<tr>: The Table Row element - HTML: Hypertext Markup Language
ski</td> <td>533175</td> <td><time datetime="2011-01013">january 13, 2011</time></td> <td><time datetime="2017-04008">april 8, 2017</time></td> <td>37.00</td> </tr> <tr> <th>hoshi nakamura</td> <td>601942</td> <td><time datetime="2012-07-23">july 23, 2012</time></td> <td>n/a</td> <td>15.00</td> </tr> </table> the differences that matter here—for the pur
poses of discussing row and column spans—are in the first few lines of the code above.
...datetime="2011-01013">january 13, 2011</time></td> <td><time datetime="2017-04008">april 8, 2017</time></td> <td>37.00</td> </tr> <tr> <th scope="row">hoshi nakamura</td> <td>601942</td> <td><time datetime="2012-07-23">july 23, 2012</time></td> <td>n/a</td> <td>15.00</td> </tr> </tbody> </table> the differences that matter here—for the pur
poses of discussing row and column spans—are in the first few lines of the code above.
Basics of HTTP - HTTP
this introductory article describes this structure, its pur
pose, and its possibilities.
...this article explains the frame structure, its pur
pose, and the way it's encoded.
Using HTTP cookies - HTTP
cookies are mainly used for three pur
poses: session management logins, shopping carts, game scores, or anything else the server should remember personalization user preferences, themes, and other settings tracking recording and analyzing user behavior cookies were once used for general client-side storage.
...these techniques violate the principles of user privacy and user control, may violate data privacy regulations, and could ex
pose a website using them to legal liability.
Index - HTTP
7 access-control-allow-credentials cors, http, reference, header the access-control-allow-credentials response header tells browsers whether to ex
pose the response to frontend javascript code when the request's credentials mode (request.credentials) is "include".
... 11 access-control-ex
pose-headers cors, http, reference, header the access-control-ex
pose-headers response header indicates which headers can be ex
posed as part of the response by listing their names.
HTTP Messages - HTTP
http messages are com
posed of textual information encoded in ascii, and span over multiple lines.
... http requests, and responses, share similar structure and are com
posed of: a start-line describing the requests to be implemented, or its status of whether successful or a failure.
Proxy Auto-Configuration (PAC) file - HTTP
furthermore, the three remaining proxy servers share the load based on url patterns, which makes their caching more effective (there is only one copy of any document on the three servers - as op
posed to one copy on each of them).
... the load is distributed like this: proxy pur
pose #1 .com domain #2 .edu domain #3 all other domains #4 hot stand-by all local accesses are desired to be direct.
HTTP
it was designed for communication between web browsers and web servers, but it can also be used for other pur
poses.
...iana also maintains a registry of pro
posed new http message headers.
CSS Houdini
houdini is a set of low-level apis that ex
poses parts of the css engine, giving developers the power to extend css by hooking into the styling and layout process of a browser’s rendering engine.
...the css typed om ex
poses css values as typed javascript objects to allow their performant manipulation.
Expressions and operators - JavaScript
sup
pose you define the following variables: var myfun = new function('5 + 2'); var shape = 'round'; var size = 1; var foo = ['apple', 'mango', 'orange']; var today = new date(); the typeof operator returns the following results for these variables: typeof myfun; // returns "function" typeof shape; // returns "string" typeof size; // returns "number" typeof foo; // returns "...
...use this either with the dot or the bracket notation: this['propertyname'] this.propertyname sup
pose a function called validate validates an object's value property, given the object and the high and low values: function validate(obj, lowval, hival) { if ((obj.value < lowval) || (obj.value > hival)) console.log('invalid value!'); } you could call validate in each form element's onchange event handler, using this to pass it to the form element, as in the following example: <p>enter a nu...
Functions - JavaScript
encodeuri() the encodeuri() method encodes a uniform resource identifier (uri) by replacing each instance of certain characters by one, two, three, or four escape sequences representing the utf-8 encoding of the character (will only be four escape sequences for characters com
posed of two "surrogate" characters).
... encodeuricomponent() the encodeuricomponent() method encodes a uniform resource identifier (uri) component by replacing each instance of certain characters by one, two, three, or four escape sequences representing the utf-8 encoding of the character (will only be four escape sequences for characters com
posed of two "surrogate" characters).
Introduction - JavaScript
core javascript can be extended for a variety of pur
poses by supplementing it with additional objects; for example: client-side javascript extends the core language by supplying objects to control a browser and its document object model (dom).
...the dom defines the way in which html document objects are ex
posed to your script.
Keyed collections - JavaScript
everything ex
posed on the instance and prototype is public; everything else is inaccessible from the outside world because privates is not exported from the module.
...they will not leak memory, so it can be safe to use dom elements as a key and mark them for tracking pur
poses, for example.
JavaScript modules - JavaScript
for learning and portability pur
poses, we decided to keep to .js.
... also, note that you might get different behavior from sections of script defined inside modules as op
posed to in standard scripts.
Using Promises - JavaScript
ult1, result2 and result3 */ }); sequential composition is possible using some clever javascript: [func1, func2, func3].reduce((p, f) => p.then(f), promise.resolve()) .then(result3 => { /* use result3 */ }); basically, we reduce an array of asynchronous functions down to a promise chain equivalent to: promise.resolve().then(func1).then(func2).then(func3); this can be made into a reusable com
pose function, which is common in functional programming: const applyasync = (acc,val) => acc.then(val); const com
poseasync = (...funcs) => x => funcs.reduce(applyasync, promise.resolve(x)); the com
poseasync() function will accept any number of functions as arguments, and will return a new function that accepts an initial value to be passed through the composition pipeline: const transformdata = co...
...m
poseasync(func1, func2, func3); const result3 = transformdata(data); in ecmascript 2017, sequential composition can be done more simply with async/await: let result; for (const f of [func1, func2, func3]) { result = await f(result); } /* use last result (i.e.
Memory Management - JavaScript
the pur
pose of a garbage collector is to monitor memory allocation and determine when a block of allocated memory is no longer needed and reclaim it.
... v8 engine flags the max amount of available heap memory can be increased with a flag: node --max-old-space-size=6000 index.js we can also ex
pose the garbage collector for debugging memory issues using a flag and the chrome debugger: node --ex
pose-gc --inspect index.js see also ibm article on "memory leak patterns in javascript" (2007) kangax article on how to register event handler and avoid memory leaks (2010) performance ...
Array.prototype.reduce() - JavaScript
].reduce( maxcallback ); // 22 [ { x: 2 } ].reduce( maxcallback ); // { x: 2 } [ ].reduce( maxcallback ); // typeerror // map & reduce with initialvalue; better solution, also works for empty or larger arrays [ { x: 22 }, { x: 42 } ].map( el => el.x ) .reduce( maxcallback2, -infinity ); how reduce() works sup
pose the following use of reduce() occurred: [0, 1, 2, 3, 4].reduce(function(accumulator, currentvalue, currentindex, array) { return accumulator + currentvalue }) the callback would be invoked four times, with the arguments and return values in each call being as follows: callback iteration accumulator currentvalue currentindex array return value first call ...
... p2, f3, p4] runpromiseinsequence(promisearr, 10) .then(console.log) // 1200 function composition enabling piping // building-blocks to use for composition const double = x => x + x const triple = x => 3 * x const quadruple = x => 4 * x // function composition enabling pipe functionality const pipe = (...functions) => input => functions.reduce( (acc, fn) => fn(acc), input ) // com
posed functions for multiplication of specific values const multiply6 = pipe(double, triple) const multiply9 = pipe(triple, triple) const multiply16 = pipe(quadruple, quadruple) const multiply24 = pipe(double, triple, quadruple) // usage multiply6(6) // 36 multiply9(9) // 81 multiply16(16) // 256 multiply24(10) // 240 write map using reduce if (!array.prototype.mapusingreduce) { array.proto...
Array.prototype.reduceRight() - JavaScript
nst f2 = x => mult3(f3, x); add5(f2, input); } difference between reduce and reduceright var a = ['1', '2', '3', '4', '5']; var left = a.reduce(function(prev, cur) { return prev + cur; }); var right = a.reduceright(function(prev, cur) { return prev + cur; }); console.log(left); // "12345" console.log(right); // "54321" defining composible function the concept of com
pose function is simple it combines n functions.
... * * h(x) = f(g(x)) * * function execution happens right to left * * https://en.wikipedia.org/wiki/function_composition */ const com
pose = (...args) => (value) => args.reduceright((acc, fn) => fn(acc), value) // increment passed number const inc = (n) => n + 1 // doubles the passed value const double = (n) => n * 2 // using composition function console.log(com
pose(double, inc)(2)); // 6 // using composition function console.log(com
pose(inc, double)(2)); // 5 specifications specification ecmascript (ecma-262)the definition of 'array.prototype.reduceright' in that specifi...
Function.prototype.call() - JavaScript
the main pur
pose of the anonymous function here is to add a print function to every object, which is able to print the correct index of the object in the array.
... passing the object as this value is not strictly necessary, but is done for explanatory pur
pose.
Object.prototype.hasOwnProperty() - JavaScript
the hasownproperty() method returns a boolean indicating whether the object has the specified property as its own property (as op
posed to inheriting it).
...perty to get correct results: var foo = { hasownproperty: function() { return false; }, bar: 'here be dragons' }; foo.hasownproperty('bar'); // always returns false // use another object's hasownproperty // and call it with 'this' set to foo ({}).hasownproperty.call(foo, 'bar'); // true // it's also possible to use the hasownproperty property // from the object prototype for this pur
pose object.prototype.hasownproperty.call(foo, 'bar'); // true note that in the last case there are no newly created objects.
Promise.prototype.then() - JavaScript
if the function passed as handler to then returns a promise, an equivalent promise will be ex
posed to the subsequent then in the method chain.
... this function // ex
poses a similar api, except the fulfillment // value of this function's promise has had more // work done on it.
Promise - JavaScript
for the nesting shown above, sup
pose the .then() associated with "promise b" returns a nextvalue of "promise x".
...the chain is com
posed of .then() calls, and typically (but not necessarily) has a single .catch() at the end, optionally followed by .finally().
RegExp.prototype.exec() - JavaScript
using this internally, exec() can be used to iterate over multiple matches in a string of text (with capture groups), as op
posed to getting just the matching strings with string.prototype.match().
... a newer function has been pro
posed to simplify matching multiple parts of a string (with capture groups): string.prototype.matchall().
TypedArray - JavaScript
this constructor is not directly ex
posed: there is no global %typedarray% or typedarray property.
...the byteoffset and length parameters specify the memory range that will be ex
posed by the typed array view.
encodeURI() - JavaScript
the encodeuri() function encodes a uri by replacing each instance of certain characters by one, two, three, or four escape sequences representing the utf-8 encoding of the character (will only be four escape sequences for characters com
posed of two "surrogate" characters).
...also, encodeuri() does not encode a few additional characters, known as "unreserved marks", which do not have a reserved pur
pose but are allowed in a uri "as is".
eval() - JavaScript
for example, sup
pose you have a variable x.
... parsing json (converting strings to javascript objects) if the string you're calling eval() on contains data (for example, an array: "[1, 2, 3]"), as op
posed to code, you should consider switching to json, which allows the string to use a subset of javascript syntax to represent data.
new operator - JavaScript
examples object type and object instance sup
pose you want to create an object type for cars.
...for example: var kenscar = new car('nissan', '300zx', 1992); object property that is itself another object sup
pose you define an object called person as follows: function person(name, age, sex) { this.name = name; this.age = age; this.sex = sex; } and then instantiate two new person objects as follows: var rand = new person('rand mcnally', 33, 'm'); var ken = new person('ken jones', 39, 'm'); then you can rewrite the definition of car to include an owner property that takes a person object, as fol...
typeof - JavaScript
(reference) a fix was pro
posed for ecmascript (via an opt-in), but was rejected.
... typeof undeclaredvariable === 'undefined'; typeof newletvariable; // referenceerror typeof newconstvariable; // referenceerror typeof newclass; // referenceerror let newletvariable; const newconstvariable = 'hello'; class newclass{}; exceptions all current browsers ex
pose a non-standard host object document.all with type undefined.
Digital audio concepts - Web media technologies
as a result, audio data is difficult to compress using traditional algorithms such as those used by generral-pur
pose tools like zip, which usually work by replacing repeating sequences of data with a shorthand representation.
...cbr is primarily used in codecs designed for voice-only pur
poses, where the frequency range and variation tends to be minimal, allowing cbr encoding to work without unworkable fluctuations in audio quality.
Web video codec guide - Web media technologies
its primary pur
pose is to be used to stream mpeg-4 audio and video over an rtp session.
... preparing video externally to prepare video for archival pur
poses from outside your web site or app, use a utility that performs compression on the original uncompressed video data.
Media - Progressive web apps (PWAs)
information: media the pur
pose of css is to specify how content is presented to the user.
...(in html5, this can be marked up with the <nav> element instead of <div> with an id attribute.) when printing the document, the navigation area has no pur
pose.
SVG Core Attributes - SVG: Scalable Vector Graphics
its pur
pose is to identify the element when linking (using a fragment identifier), scripting, or styling (with css).
... value: any valid language id; animatable: no tabindex the tabindex svg attribute allows you to control whether an element is focusable and to define the relative order of the element for the pur
poses of sequential focus navigation.
d - SVG: Scalable Vector Graphics
a path definition is a list of path commands where each command is com
posed of a command letter and numbers that represent the command parameters.
...each command is com
posed of a command letter and numbers that represent the command parameters.
tabindex - SVG: Scalable Vector Graphics
the tabindex attribute allows you to control whether an element is focusable and to define the relative order of the element for the pur
poses of sequential focus navigation.
...rg/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 pur
poses of sequential focus navigation.
<use> - SVG: Scalable Vector Graphics
--> </svg> the effect is the same as if the nodes were deeply cloned into a non-ex
posed dom, then pasted where the use element is, much like cloned template elements in html5.
... since the cloned nodes are not ex
posed, care must be taken when using css to style a use element and its cloned descendants.
Basic shapes - SVG: Scalable Vector Graphics
the pur
pose of these shapes is fairly obvious from their names.
... polygon a <polygon> is similar to a <polyline>, in that it is com
posed of straight line segments connecting a list of points.
Other content in SVG - SVG: Scalable Vector Graphics
embedding raster images much like the img element in html svg has an image element to serve the same pur
pose.
...its sole pur
pose is to be a container for other markup and a carrier for svg styling attributes (most prominently width and height to define the space the object will take).
Using templates and slots - Web Components
in addition, even if it is not already rendered, the pur
pose of the container as a template should be more semantically clear when using the <template>.
...in other words, the dom tree from the <element-details> elements get com
posed together with the content of the shadow root.
Web Components
event extensions extensions to the event interface related to shadow dom: event.com
posed: returns a boolean which indicates whether the event will propagate across the shadow dom boundary into the standard dom (true), or not (false).
... event.com
posedpath: returns the event’s path (objects on which listeners will be invoked).
XML Index - XML: Extensible Markup Language
it stands for extensible markup language and is a w3c recommended specification as a general pur
pose markup language.
...the primary pur
pose of the language is the sharing of data across different systems, such as the internet.
XML: Extensible Markup Language
it stands for extensible markup language and is a w3c recommended specification as a general pur
pose markup language.
...the primary pur
pose of the language is the sharing of data across different systems, such as the internet.
Understanding WebAssembly text format - WebAssembly
this is an intermediate form designed to be ex
posed in text editors, browser developer tools, etc.
...linear memory ex
poses the raw contents of stored values as bytes and this would allow wasm content to arbitrarily observe and corrupt raw function addresses, which is something that cannot be allowed on the web.
Using the WebAssembly JavaScript API - WebAssembly
the equivalent code would look like this: fetch('simple.wasm').then(response => response.arraybuffer() ).then(bytes => webassembly.instantiate(bytes, importobject) ).then(results => { results.instance.exports.exported_func(); }); viewing wasm in developer tools in firefox 54+, the developer tool debugger panel has functionality to ex
pose the text representation of any wasm code included in a web page.
... webassembly memory ex
poses its bytes by simply providing a buffer getter/setter that returns an arraybuffer.
Compiling an Existing C Module to WebAssembly - WebAssembly
$ git clone https://github.com/webmproject/libwebp to start off simple, ex
pose webpgetencoderversion() from encode.h to javascript by writing a c file called webp.c: #include "emscripten.h" #include "src/webp/encode.h" emscripten_keepalive int version() { return webpgetencoderversion(); } this is a good simple program to test whether you can get the source code of libwebp to compile, as it doesn't require any parameters or complex data structures to invoke this functio...
...for that, you need to ex
pose two additional functions — one that allocates memory for the image inside wasm and one that frees it up again: #include <stdlib.h> // required for malloc definition emscripten_keepalive uint8_t* create_buffer(int width, int height) { return malloc(width * height * 4 * sizeof(uint8_t)); } emscripten_keepalive void destroy_buffer(uint8_t* p) { free(p); } the create_buffer() function alloc...
Cross-domain Content Scripts - Archive of obsolete content
sup
pose your content script includes a line like: // content-script.js: unsafewindow.mycustomapi = function () {}; if you have included the "cross-domain-content" key, when the page script tries to access mycustomapi this will result in a "permission denied" exception.
context-menu - Archive of obsolete content
for example, sup
pose your add-on looks like this: var script = "self.on('click', function (node, data) {" + " console.log('clicked: ' + node.nodename);" + "});"; var cm = require("sdk/context-menu"); cm.item({ label: "body context", context: cm.selectorcontext("body"), contentscript: script }); this add-on creates a context-menu item that uses selectorcontext to display the item w...
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 ex
pose 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 a...
simple-prefs - Archive of obsolete content
sup
pose you've defined a preference like this: "preferences": [{ "name": "somepreference", "title": "some preference title", "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.lo...
content/worker - Archive of obsolete content
worker worker is com
posed from the eventemitter trait, therefore instances of worker and their descendants ex
pose all the public properties ex
posed by eventemitter along with additional public properties that are listed below.
net/xhr - Archive of obsolete content
possible attenuations before being ex
posed to unprivileged code, this object needs to be attenuated in such a way that, at the very least, it can't access the user's filesystem.
places/bookmarks - Archive of obsolete content
for example, sup
pose we called search() with two query objects: [{ url: "mozilla.org", tags: ["mobile"]}, { tags: ["firefox-os"]}] this will return: all bookmark items from mozilla.org that are also tagged "mobile" all bookmark items that are tagged "firefox-os" an options object may be used to determine overall settings such as sort order and how many objects should be returned.
test/assert - Archive of obsolete content
to check that the exception thrown contains a specific message, pass a regular expression here: the message property of the exception thrown must match the regular expression for example, sup
pose we define two different custom exceptions: function myerror(message) { this.name = "myerror"; this.message = message || "default message"; } myerror.prototype = new error(); myerror.prototype.constructor = myerror; function anothererror(message) { this.name = "anothererror"; this.message = message || "default message"; console.log(this.message); } anothererror.prototype = new erro...
cfx - Archive of obsolete content
sup
pose your the following local.json is as follows: { "configs": { "ff40": ["-b", "/usr/bin/firefox-4.0"] } } you can run: cfx test --use-config=ff40 and it would be equivalent to: cfx test -a firefox -b /usr/bin/firefox-4.0 this method of defining configuration options can be used for all of the run, build, and test tools.
Storing annotations - Archive of obsolete content
the annotation is com
posed of the text the user entered and the "annotation anchor", which consists of the url, element id and element content: function handlenewannotation(annotationtext, anchor) { var newannotation = new annotation(annotationtext, anchor); simplestorage.storage.annotations.push(newannotation); } this function calls a constructor for an annotation object, which we also need to supply: function ann...
Chrome Authority - Archive of obsolete content
var xhr = require("x"+"hr"); var modname = "xpcom"; var xpcom = require(modname); var one = require("one"); var two = require("two"); the intention is that developers use require() statements for two pur
poses: to declare (to security reviewers) what sorts of powers the module wants to use, and to control how those powers are mapped into the module's local namespace.
Creating Reusable Modules - Archive of obsolete content
} return path; } hash function firefox has built-in support for hash functions, ex
posed via the nsicryptohash xpcom interface the documentation page for that interface includes an example of calculating an md5 hash of a file's contents, given its path.
Drag & Drop - Archive of obsolete content
wuri(str.data.split("\n")[0], null, null); } else { var file = data.value.queryinterface(components.interfaces.nsifile); if (file) uri = _ios.newfileuri(file); } } if (uri) uris.push(uri); } // use the array of file uris } the _dragover function checks the drag data to see if a simple text file or general pur
pose file types are available.
Finding window handles - Archive of obsolete content
comparing to the method above, by using this method, you don't have to compile your component with nsiwidget.h and other bunchs of h files that should not be ex
posed to outside, and could change every time firefox updates, all you need is nsibasewindow.idl(it's not in gecko_sdk, get this from the latest firefox source, or http://mxr.mozilla.org/mozilla/sourc...basewindow.idl), and use xpidl to compile it to .h file, although that's stll a unfrozen interface, but it should be a lot better.
Label and description - Archive of obsolete content
note: if running in a xulrunner application add the following preferences to your default preferences file: pref("network.protocol-handler.ex
pose.http", false); pref("network.protocol-handler.warn-external.http", false); change or add additional protocols (https or ftp) as needed.
Rosetta - Archive of obsolete content
for a fast overview on the code pro
posed here you can git clone https://github.com/madmurphy/rosetta.js, or, at your choice, directly download this .zip file.
Introduction - Archive of obsolete content
firefox and other mozilla applications can be seen as com
posed of two different parts: a user interface layer that is distinct for each project, and a common platform on top of which the interface layer is built.
Setting up an extension development environment - Archive of obsolete content
chrome list navigate and view files in chrome:// (firefox version, thunderbird version) chrome edit plus a user file editor (firefox and thunderbird) firebug a variety of development tools (firefox) pentadactyl, a general pur
pose extension with builtin tools for extension development, including a command line with chrome javascript evaluation (including property and function argument completion) and the ability to demand-load external javascript and css files into window chrome.
Tabbed browser - Archive of obsolete content
.interfaces.nsiloadcontext); } catch (ex) { try { loadcontext = asubject.loadgroup.notificationcallbacks.getinterface(components.interfaces.nsiloadcontext); //in ff26 asubject.loadgroup.notificationcallbacks was null for me, i couldnt find a situation where it wasnt null, but whenever this was null, and i knew a loadcontext is sup
posed to be there, i found that "interfacerequestor.getinterface(components.interfaces.nsiloadcontext);" worked fine, so im thinking in ff26 it doesnt use asubject.loadgroup.notificationcallbacks anymore, but im not sure } catch (ex2) { loadcontext = null; //this is a problem i dont know why it would get here } } ...
Plug-n-Hack Phase1 - Archive of obsolete content
for testing); plug-n-hack requires tool and service manifests to be served from the same origin as the api endpoints but, for testing pur
poses, ringleader (the firefox addon implementation of the browser component) allows you to set a preference to relax or disable origin checks.
Extensions - Archive of obsolete content
the code snippet will look something like this: <em:targetapplication> <!– prism –> <description> <em:id>prism@developer.mozilla.org</em:id> <em:minversion>0.8</em:minversion> <em:maxversion>1.0.0.*</em:maxversion> </description> </em:targetapplication> in addition to the install manifest changes, you may want to ex
pose your extension into the prism ui.
RDF Datasource How-To - Archive of obsolete content
ns_release(mydatasource); } nsservicemanager::releaseservice(krdfservicecid, rdf); } displaying rdf as content now that you've gone through all this pain to ex
pose your information as a datasource, you probably want to see it.
Static Analysis for Windows Code under Linux - Archive of obsolete content
you can obtain mozilla 2 code by: hg clone http://hg.mozilla.org/mozilla-central/ and com
pose a .mozconfig file for cross-compiling mozilla with static analysis hooked: #specify the cross compile cross_compile=1 ac_add_options --enable-application=browser ac_add_options --host=i686-linux ac_add_options --target=i686-mingw32 ac_add_options --enable-default-toolkit=cairo-windows mk_add_options moz_objdir=@topsrcdir@/../mozilla-mingw # mozilla trunk uses many vista only features on windows...
Table Cellmap - Archive of obsolete content
introduction the table layout use the cellmap for two pur
poses: quick lookup of table structural data store of the border collapse data the cellmap code is contained in nscellmap.cpp and nscellmap.h this document does currently describe only the quick lookup part of the game, border collapse is still far away cellmap data - overview the entries in the cellmap contain information about the table cell frame corresponding to a given row and column number (celldata.h).
Tamarin build documentation - Archive of obsolete content
elease mac-64-release mac-32-debug mac-64-debug mac-32-release-debugger mac-64-release-debugger mac-32-debug-debugger mac-64-debug-debugger the build location will be project_root/build_name/avm note: as discussed above, the c++ indexer has been setup to track the current build config, so the correct conditional compiles are highlighted in the editor run/debug from eclipse for test pur
poses, a launch config (running the helloworld test from esc) has been included for each of the build configs.
2006-10-20 - Archive of obsolete content
traffic october 14, 2006, 6:53pm - ed notes that, on windows, com
poser 0.1's reccomended install directory needs to be different than those noted in the release notes.
2006-10-27 - Archive of obsolete content
traffic status of xpcom cycle collector graydon hoare provides the xpcom patch which experiments with implementing a general-pur
pose garbage-cycle collector for xpcom.
2006-12-01 - Archive of obsolete content
summary: mozilla.dev.quality - november 25-december 1, 2006 announcements need volunteers to maintain jssh for testing on firefox 2 branch - dave liebreich is looking for someone willing to take responsibility for maintaining jssh for testing pur
poses.
2006-10-06 - Archive of obsolete content
discussions protocol handlers boris zbarsky
posed the question, should random webpages have access to the following protocols: feed, pcast, moz-bookmark, webcal, swebcal.
2006-11-24 - Archive of obsolete content
discussions tutorials: 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 ex
posed 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.
External resources for plugin creation - Archive of obsolete content
project: nixysa project home page description (from the home page): nixysa is a framework written in python to automatically generate glue code for npapi plugins (plugins for browsers such as google chrome or firefox), letting you easily ex
pose c++ classes to javascript from a simple idl representation.
NPEvent - Archive of obsolete content
the event type may be any of the ollowing: graphicsex
pose 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.
NPWindow - Archive of obsolete content
(the drawable is provided in a graphicsex
pose event, when the paint is requested.) description the npwindow structure represents the native window or a drawable, and contains information about coordinate position, size, whether the plug-in is windowed or windowless, and some platform-specific information.
SAX - Archive of obsolete content
the following handlers are available: interface pur
pose nsisaxcontenthandler receive notification of the logical content of a document (e.g.
Digital Signatures - Archive of obsolete content
the content of the hashed data cannot, for all practical pur
poses, 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.
Scratchpad - Archive of obsolete content
from firefox 33 onwards, the key binding preference is ex
posed in the editor preferences section of the developer tools settings, and you can set it there instead of about:config.
E4X for templating - Archive of obsolete content
while it may be obvious after a study of the basics of e4x that it can be used for this pur
pose, if one adds a few common pur
pose functions (especially along with the convenience of javascript 1.8 expression closures), the templates can function more dynamically, offering the power and readability of templating languages such as smarty for php (though admittedly without the currently wider cross-browser support of xslt or the strictly-xml approach of phptal or seethrough templating).
Processing XML with E4X - Archive of obsolete content
we can also use the for each...in statement introduced in javascript 1.6 as part of javascript's e4x support: for each (var lang in languages.lang) { alert(lang); } for each...in can also be used with regular javascript objects to iterate over the values (as op
posed to the keys) contained in the object.
ArrayBuffer.transfer() - Archive of obsolete content
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 op
posed 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.
VBArray.toArray - Archive of obsolete content
for example, a vbarray with three dimensions and three elements in each dimension is converted into a javascript array as follows: sup
pose the vbarray contains: (1, 2, 3), (4, 5, 6), (7, 8, 9).
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-pur
pose 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.
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
this innovation, first introduced by microsoft® internet explorer and later adopted into the css specification, is very popular for the styling of text links, particularly those that are sup
posed to look and act like javascript-driven "rollovers." however, advancing css support in browsers has caused some unexpectedly aggressive hovering behavior on some pages.
Archive of obsolete content
we leverage some of these ideas to help you make your netscape communicator 4.x plugins ex
posed to javascript in mozilla based browsers.
Unconventional controls - Game development
we will need a few helper variables for our code to work — one for the pur
pose of calculating the degrees from radians, two for holding the horizontal and vertical amount of degrees our hand is leaning above the controller, one for the threshold of that lean, and one for the state of our hand's grab status.
Normative - MDN Web Docs Glossary: Definitions of Web-related terms
specifications might also contain sections that are marked as non-normative or informative, which means those are provided there for the pur
pose of helping the reader understand the specifications better or to showcase an example or best practice, which need not be followed as a rule.
SQL Injection - MDN Web Docs Glossary: Definitions of Web-related terms
how it works after entering username and password, behind the gui the sql queries work as follows: "select count(*) from users where username=' " + txt.user.text+" ' and password=' "+ txt.password.text+" ' "; now sup
pose user enters the username: admin and password: passwd123, so after clicking on the log in button, sql query will run as follows: "select count(*) from users where username=' admin ' and password=' passwd123 ' "; if the credentials are correct, then the user is allowed to log in, so it's a very simple (and therefore insecure) mechanism.
Semantics - MDN Web Docs Glossary: Definitions of Web-related terms
in programming, semantics refers to the meaning of a piece of code — for example "what effect does running that line of javascript have?", or "what pur
pose or role does that html element have" (rather than "what does it look like?".) semantics in javascript in javascript, consider a function that takes a string parameter, and returns an <li> element with that string as its textcontent.
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 pur
pose 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.
About Scriptable Interfaces - Interfaces
most of the information of this document is based on http://www.mozilla.org/scriptable/ and creating xpcom components scriptable interfaces interfaces allow xpcom components to ex
pose their functionality to the outside world while hiding the inner details of the component implementation.
Accessible multimedia - Learn web development
thers if they are in a quiet place (like a library.) this is not a new concept — television services have had closed captioning available for quite a long time: whereas many countries offer english films with subtitles written in their own native languages, and different language subtitles are often available on dvds, for example there are different types of text track with different pur
poses.
What is accessibility? - Learn web development
accessibility apis web browsers make use of special accessibility apis (provided by the underlying operating system) that ex
pose information useful for assistive technologies (ats) — ats mostly tend to make use of semantic information, so this information doesn't include things like styling information, or javascript.
Accessibility - Learn web development
html: a good basis for accessibility a great deal of web content can be made accessible just by making sure the correct html elements are always used for the correct pur
pose .
How do you upload your files to a web server? - Learn web development
open the filezilla application; you should see something like this: logging in for this example, we'll sup
pose that our hosting provider (the service that will host our http web server) is a fictitious company "example hosting provider" whose urls look like this: mypersonalwebsite.examplehostingprovider.net.
How to build custom form controls - Learn web development
finally, let's define how the control's options will behave: when the control is opened, the selected option is highlighted when the mouse is over an option, the option is highlighted and the previously highlighted option is returned to its normal state for the pur
poses of our example, we'll stop with that; however, if you're a careful reader, you'll notice that some behaviors are missing.
UI pseudo-classes - Learn web development
lute; content: "required"; color: white; background-color: black; padding: 5px 10px; top: -26px; left: -70px; } we set the <span> to position: relative simply so that we can set the generated content to position: absolute and position it relative to the <span> rather than the <body> (the generated content acts as though it is a child node of the element it is generated on, for the pur
poses of positioning).
Your first form - Learn web development
form controls can also be programmed to enforce specific formats or values to be entered (form validation), and paired with text labels that describe their pur
pose to both sighted and blind users.
Chrome-only API reference
note: most of the apis ex
posed to the web in general are also usable in chrome code: see web apis for a list of these.
overflow-clip-box-block
ent-box; } .padding-box { overflow-clip-box-block: padding-box; } javascript function scrollsomeelements() { var elms = document.queryselectorall('.scroll'); for (i=0; i < elms.length; ++i) { elms[i].scrollleft=80; } } var elt = document.queryelementsbytagname('body')[0]; elt.addeventlistener("load", scrollsomeelements, false); result specifications this property has been pro
posed to the w3c csswg; it is not yet on the standard track but, if accepted, should appear in css overflow module level 3.
overflow-clip-box-inline
nt-box; } .padding-box { overflow-clip-box-inline: padding-box; } javascript function scrollsomeelements() { var elms = document.queryselectorall('.scroll'); for (i=0; i < elms.length; ++i) { elms[i].scrollleft=80; } } var elt = document.queryelementsbytagname('body')[0]; elt.addeventlistener("load", scrollsomeelements, false); result specifications this property has been pro
posed to the w3c csswg; it is not yet on the standard track but, if accepted, should appear in css overflow module level 3.
overflow-clip-box
und: lime content-box; } .padding-box { overflow-clip-box: padding-box; } js function scrollsomeelements() { var elms = document.queryselectorall('.scroll'); for (i=0; i < elms.length; ++i) { elms[i].scrollleft=80; } } var elt = document.queryelementsbytagname('body')[0]; elt.addeventlistener("load", scrollsomeelements, false); result specifications this property has been pro
posed to the w3c csswg; it is not yet on the standard track but, if accepted, should appear in css overflow module level 3.
Chrome-only CSS reference
ua stylesheets.) note: most of the css properties ex
posed to the web in general are also usable in chrome stylesheets: see the css documentation for a list of these.
How test harnesses work
mozilla test harnesses are typically com
posed of a python runner that invokes firefox, utilizes the browser to run tests, and reports the results.
How to Report a Hung Firefox
if you suspect a hang (as op
posed to slow performance), wait one minute on an idle system before getting the stack trace.
IME handling guide
instead, gecko uses gtk_im_context_reset() api for this pur
pose because most ime cancel composition with it.
PBackground
for most pur
poses this is great, because the dom is already bound to the main thread.
Implementing Download Resuming
note: in versions of firefox prior to 3.0 alpha 7, nsiwebbrowserpersist cannot append to existing files (as op
posed to overwriting them), and is therefore not usable for this task (see bug 129921).
AsyncShutdown.jsm
firefox shutdown is com
posed of phases that take place sequentially.
Sqlite.jsm
sqlite.jsm ex
poses a transaction api built on top of task.jsm that allows transactions to be written as procedural javascript functions (as op
posed to a series of callback driven operations).
Using workers in JavaScript code modules
to create a chromeworker for this pur
pose, you need to use the nsiworkerfactory interface: var workerfactory = components.classes['@mozilla.org/threads/workerfactory;1'] .createinstance(components.interfaces.nsiworkerfactory); var worker = workerfactory.newchromeworker('script_url.js'); this will create a new chrome worker that will immediately begin to run the script at the specified url (in this case, ...
Webapps.jsm
the webapps.jsm modules ex
poses the domapplicationregistry, which is responsible for managing all of the open web apps.
Index
different gettext function name) for string which are sup
posed to support plurals.
Localization prerequisites
there is no warranty; not even for merchantability or fitness for a particular pur
pose great, hg works.
Localization sign-off reviews
the diff generated for sign-off reviews the image to the right illustrates the revisions diff between the current release revision and your newly pro
posed release revision.
Localization technical reviews
since it is performed on the first revision a l10n team pro
poses for release, this first revision requires a very detailed and comprehensive form of review.
gettext
different gettext function name) for string which are sup
posed to support plurals.
Mozilla Style System
computed style (front end) the interface that the front end ex
poses to the rest of mozilla consists of a single nsstyleset object and many nsstylecontext objects, each of which holds the computed style for an element, pseudo-element, or text node.
Mozilla Style System Documentation
for example, sup
pose we had the css stylesheet: /* rule 1 */ doc { display: block; text-indent: 1em; } /* rule 2 */ title { display: block; font-size: 3em; } /* rule 3 */ para { display: block; } /* rule 4 */ [class="emph"] { font-style: italic; } and the following document: <doc> <title>a few quotes</title> <para class="emph">benjamin franklin said that <quote>"a penny saved is a penny earned."</quo...
Build Metrics
static constructors are undesirable because their initialization im
poses an unavoidable time penalty every time firefox is started.
DMD
since you cannot mark files in /sdcard/ as executable, we will use /data/local/tmp for this pur
pose: adb push dmd_fennec /data/local/tmp adb shell cd /data/local/tmp chmod 755 dmd_fennec the final step is to make android use the above wrapper script while launching fennec, so that the environment variable is present when fennec starts up.
JS::PerfMeasurement
eventmask eventsmeasured instances of perfmeasurement ex
pose this constant.
Power profiling overview
intel processors have model-specific registers (msrs) containing measurements of how much time is spent in different c-states, and tools such as powermetrics (mac), powertop and turbostat (linux) can ex
pose this information.
Profiling with the Firefox Profiler
main thread file io, profiled thread file io, all file io - "mainthreadio", "fileio", "allfileio" this will inter
pose file i/o from a selection of threads, and report them in the profiles.
Scroll-linked effects
one way to implement this without the scroll event listener is to use the css property designed for this pur
pose: <body style="height: 5000px"> <div id="toolbar" style="position: sticky; top: 0px; margin-top: 100px; width: 100px; height: 20px; background-color: green"></div> </body> this version works well with asynchronous scrolling because position of the "toolbar" div is updated by the browser as the user scrolls.
perf
the following example shows how to invoke it for this pur
pose.
Research and prep
ensure that your suggestions follow these parameters: search there are typically five search plug-ins listed for firefox desktop (only four for firefox mobile): generic search the default option should ex
pose the quickest path to the best result on the world wide web for the user (indexing a large portion of the global www).
L20n HTML Bindings
when all dom nodes are localized, the document element will fire a documentlocalized event, which you can listen to: document.addeventlistener('documentlocalized', function() { // the dom has been localized and the user sees it in their language yourapp.init(); }); exposing context data you can ex
pose important bits of data to the localization context in form of context data.
Leak And Bloat Tests
code locations the files specific to leak and bloat testing are be stored in: http://mxr.mozilla.org/comm-central/source/mailnews/test/performance these files consist of: overlays (used to provide the hooks for the javascript): bloat/bloataddroverlay.xul bloat/bloatcom
poseoverlay.xul bloat/bloatmainoverlay.xul javascript files (used to drive the tests): bloat/bloataddroverlay.js bloat/bloatcom
poseoverlay.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.p...
NSPR Poll Method
the prototype of the poll method is print16 poll_method(prfiledesc *fd, print16 in_flags, print16 *out_flags); the pur
pose of the poll method is to allow a layer to modify that flags that will ultimately be used in the call to the underlying network transport's select (or equivalent) function, and to indicate that a layer is already able to make progress in the manner suggested by the polling flags.
I/O Functions
the pur
pose of a pollable event is to combine event waiting with i/o waiting in a single pr_poll call.
Interval Timing
this chapter describes printervaltime and the functions that allow you to use it for timing pur
poses: interval time type and constants interval functions interval time type and constants all timed functions in nspr require a parameter that depicts the amount of time allowed to elapse before the operation is declared failed.
Locks
in general, a monitor is a conceptual entity com
posed of a mutex, one or more condition variables, and the monitored data.
Named Shared Memory
security considerations on unix platforms, depending on implementation, contents of the backing store for the shared memory can be ex
posed via the file system.
PL_HashString
a general-pur
pose hash function for character strings.
PR_Interrupt
description the pur
pose of pr_interrupt is to request that a thread performing some task stop what it is doing and return to some control point.
PR_NormalizeTime
for example, sup
pose you want to compute the day of week for 3 march 1998.
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 pur
pose.
NSS FAQ
openssl is an open source project that implements server-side ssl, tls, and a general-pur
pose cryptography library.
Introduction to Network Security Services
only on 64-bit cpus, not on 32-bit cpus) or that doesn't use the more efficient 64-bit code on 64-bit cpus, which defeats the pur
pose of having these shared libraries.
NSS_3.12.1_release_notes.html
bug 67890: create self-signed cert with existing key that signed csr bug 129303: nss needs to ex
pose interfaces to deal with multiple token sources of certs.
NSS 3.12.5 release_notes
if the string parameter is null (as op
posed to empty, zero length), then the softoken default is used.
NSS 3.16.1 release notes
notable changes in nss 3.16.1 im
posed name constraints on the french government root ca anssi (dciss).
NSS 3.43 release notes
't installed, try running a local clang-format as a fallback bug 1531267 - enable fips mode automatically if the system fips mode flag is set bug 1528262 - add a -j option to the strsclnt command to specify sigschemes bug 1513909 - add manual for nss-policy-check bug 1531074 - fix a deref after a null check in seckey_setpublicvalue bug 1517714 - properly handle esni with hrr bug 1529813 - ex
pose hkdf-expand-label with mechanism bug 1535122 - align tls 1.3 hkdf trace levels bug 1530102 - use getentropy on compatible versions of freebsd.
NSS 3.44 release notes
ogus.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 - ex
pose 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 1537...
JS::AutoVectorRooter
js::autoscriptvector autovectorrooter<jsscript *> see also mxr id search for js::autovectorrooter mxr id search for js::autovaluevector mxr id search for js::autoidvector mxr id search for js::autoobjectvector mxr id search for js::autofunctionvector mxr id search for js::autoscriptvector js::autovaluearray<n> - fixed-size array of js::value bug 677079 bug 868580 - ex
pose js::autoobjectvector bug 848592 - added js::autofunctionvector bug 676281 - added js::autoscriptvector ...
JS::Value
spidermonkey 1.8.5 made jsval into a c struct and ex
posed it in c++ through the full-fledged js::value class.
JSClass.call
// sup
pose this object has jsclass.call and jsclass.construct hooks.
JSClass
le: /* spidermonkey 38 */ static jsclass robot_class = { "robot", /* name */ 0 /* flags */ }; /* spidermonkey 31 or older */ static jsclass robot_class = { "robot", /* name */ 0, /* flags */ js_propertystub, js_propertystub, js_propertystub, js_propertystub, js_enumeratestub, js_resolvestub, js_convertstub, null, jsclass_no_optional_members }; to ex
pose this class to scripts, and to attach methods and properties to it, use js_initclass.
JSExtendedClass.wrappedObject
a wrapper object that wraps an array is considered an array for the pur
pose of array.prototype.concat and array.concat (which treat array arguments differently from other arguments, per ecma 262-3 §15.4.4.4).
JSNewEnumerateOp
jsenumerate_init_all used identically to jsenumerate_init, but ex
poses all properties of the object regardless of enumerability.
JSNewResolveOp
jsresolve_detecting obsolete since jsapi 20 the property is being used in code like "if (o.p)...", or a similar idiom where the apparent pur
pose of the property access is to detect whether the property exists.
JSObjectOps.dropProperty
a single, built-in jsobjectops implementation is used for most spidermonkey objects that are ex
posed to scripts.
JSPropertyOp
this is typically the value of the left-hand side after assignment, as op
posed to the value of the right-hand side, as required by ecma 262-3 §11.13.
JSVAL_IS_GCTHING
this macro ex
poses javascript engine implementation details and usually isn't what the application really means.
JSVAL_TO_GCTHING
this macro is ex
posed in jsapi.h because other jsapi macros make use of it.
JS_Add*Root
typically name is a static string constant, identifying the source location of the call to js_addnamedroot for debugging pur
poses.
JS_CompareStrings
this function im
poses a total order on all javascript strings, the same order im
posed by the javascript string comparison operators (<, <=, >, >=), as described in ecma 262-3 § 11.8.5.
JS_ConvertArguments
(the pur
pose is to ensure gc safety.) format const char * null-terminated string describing the types of the out parameters and how to convert the values in argv.
Gecko events
changes to text that is ex
posed through the iaccessibletext and iaccessibleeditabletext interfaces.
Gecko states
state_selfvoicing the object or child uses text-to-speech (tts) technology for description pur
poses.
Implementation Details
cific pages to get information of supported relations for interested at api: gecko msaa ia2 at-spi attributes object attributes refer to specific pages to get information of supported object attributes 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 ex
pose 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 ex
posed.
XForms Accessibility
in general, when elements are similar to html elements, they are ex
posed to msaa/atk in a similar way.
XUL Accessibility
<description value="it's label for control" control="control" /> <hbox 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 ex
posed if the element has registered click event handler then click action is ex
posed xul elements notification used to display an informative message.
Places utilities for JavaScript
these are: qi_node qi_node(anode, aiid) runs a query interface on a bookmark node to ex
pose the interface available to that type.
Preferences API
interfaces the preferences api is ex
posed as a set of xpcom components and interfaces: nsiprefservice, nsiprefbranch.
XPCOM changes in Gecko 2.0
this was necessary in order to ensure that any components that should no longer be available are dis
posed of properly, and to re-register everything, loading any new components that may be needed.
Component Internals
the main pur
pose of the api at this point is to change which components directory xpcom searches when it looks for xpcom components.
Using XPCOM Components
xul is just one way to ex
pose the functionality of the cookiemanager component-but it's a particularly useful one in the mozilla world.
Making cross-thread calls using runnables
#include "nsthreadutils.h" class piresulttask : public nsrunnable { public: piresulttask(picallback callback, const nsacstring& result) : mcallback(callback) , mresult(result) , mworkerthread(do_getcurrentthread()) { moz_assert(!ns_ismainthread()); // this should be running on the worker thread } ns_imethod run() { moz_assert(ns_ismainthread()); // this method is sup
posed to run on the main thread!
XPCOM hashtable guide
floats - nsdatahashtable<nsuint32hashkey, float> a hashtable that maps nsisupports pointers to reference counted cacheentrys - nsrefptrhashtable<nsisupportshashkey, cacheentry> a hashtable that maps jscontext pointers to a contextinfo struct - nsclasshashtable<nsptrhashkey<jscontext>, contextinfo> a hashset of strings - nsthashtable<nsstringhashkey> hashtable api the hashtable classes all ex
pose the same basic api.
mozIStorageAsyncStatement
(mozistoragestatement can be used for both synchronous and asynchronous pur
poses.) this specialization for asynchronous operation allows us to avoid needing to acquire synchronization primitives also used by the asynchronous execution thread.
mozIStorageStatementParams
for example, say you create a statement like so: var statement = dbconn.createstatement("select * from table_name where id = :item_id"); this object would have one property, item_id, that you can use to bind a value to that named parameter like so: statement.params.item_id = 2; for more details on why you should bind parameters as op
posed to hard-coding them into your statement, please see the overview document about binding parameters.
nsIAbCard
converttobase64encodedxml() string converttobase64encodedxml() return value converttoxmlprintdata() astring converttoxmlprintdata() return value converttoescapedvcard() string converttoescapedvcard() return value generatename() generate a name from the card for display pur
poses.
nsIAccessNode
uniqueid voidptr a unique id calculated for this dom node, for the pur
poses of caching and referencing this object.
nsIAccessible
attributes many accessibles ex
poses attributes to provide more details that cannot be fit into existing api methods, please refer to attributes documentation for more information.
nsIAccessibleHyperText
accessible/public/nsiaccessiblehypertext.idlscriptable this interface is the main interface to ex
pose hyperlinks in a document, typically a text document, that are used to reference other documents.
nsIAccessibleStates
state_selfvoicing 0x00080000 the object or child uses text-to-speech (tts) technology for description pur
poses.
nsIAuthPrompt
netwerk/base/public/nsiauthprompt.idlscriptable this interface allows the networking layer to
pose a user/password prompt to obtain the values needed for authentication.
nsIChannel
in earlier versions callers could get the "content-length" property as 64-bit value by queryinterfacing the channel to nsipropertybag2, if that interface is ex
posed by the channel.
nsICommandLineHandler
example: category entry value command-line-handler b-jsdebug @mozilla.org/venkman/clh;1 command-line-handler c-extensions @mozilla.org/extension-manager/clh;1 command-line-handler m-edit @mozilla.org/com
poser/clh;1 command-line-handler m-irc @mozilla.org/chatzilla/clh;1 command-line-handler y-final @mozilla.org/browser/clh-final;1 method overview void handle(in nsicommandline acommandline); attributes attribute type description helpinfo autf8string when the a...
nsICurrentCharsetListener
to create an instance, use: var currentcharsetlistener = components.classes["@mozilla.org/intl/currentcharsetlistener;1"] .createinstance(components.interfaces.nsicurrentcharsetlistener); method overview void setcurrentcharset(in wstring charset); void setcurrentcom
posercharset(in wstring charset); void setcurrentmailcharset(in wstring charset); methods setcurrentcharset() void setcurrentcharset( in wstring charset ); parameters charset setcurrentcom
posercharset() void setcurrentcom
posercharset( in wstring charset ); parameters charset setcurrentmailcharset() void setcurrentmailcharset( in wstring charset ); parameters charset ...
nsIDOMJSWindow
page com
posed by sebastian gurin <sgurin@(nospam)montevideo.com.uy ...
nsIDOMParser
sup
posedly, if you want to create objects that some particular set of unprivileged code will be able to access (see discussion in bug 565480).
nsIDOMWindowUtils
the displayport will be used as the window's visible region for the pur
poses of invalidation and painting.
nsIFaviconService
this should be determined via privatebrowsingutils.iswindowprivate(somerelatedwindow) if the favicon may ex
pose the user's private browsing data by performing a network request, otherwise favicon_load_non_private may be used.
nsIGlobalHistory3
implementations should generally add the uri for aoldchannel to history for link coloring, but are advised not to ex
pose it in the history user interface.
nsIHttpChannelInternal
using features ex
posed by this interface is not recommended, as it will change in unpredictable ways.
nsIIDNService
the resulting string is useful for display pur
poses, and ensures that the encoding is consistent with nsiuri.gethost().
nsIJSON
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 pur
poses of this article, we'll pretend they can be and ignore that issue.
nsIJetpack
individual lines of the form //@line 1 "foo.js" can be used to specify filename and line number information for debugging pur
poses.
nsIMessageListener
objects an object whose properties are any cross process object wrappers ex
posed by the sender as the third argument to the message-sending function.
nsIMessageWakeupService
currently, services must ex
pose a wrappedjsobject in order to support this; however, once bug 593407 is fixed, the service to be woken up must implement nsiframemessagelistener.
nsIMsgCompFields
void convertbodytoplaintext ( ); attachment handling methods void addattachment ( in nsimsgattachment attachment ); void removeattachment ( in nsimsgattachment attachment ); void removeattachments ( ); header methods void setheader(char* name, char* value); references this interface is the type of the following properties: nsimsgcom
pose.compfields, nsimsgcom
poseparams.com
posefields this interface is passed as an argument to the following methods: nsimsgcom
posesecure.begincryptoencapsulation, nsimsgcom
posesecure.requirescryptoencapsulation, nsimsgsend.createandsendmessage, nsimsgsend.sendmessagefile, nsismimejshelper.getnocertaddresses, nsismimejshelper.getrecipientcertsinfo ...
nsIMsgHeaderParser
removealiasestome allows the address parser to use the preference which contains regular expressions which also mean 'me' for the pur
pose of stripping the user's email address(es) out of addrs string removeduplicateaddresses( in string addrs, in string other_addrs, in prbool removealiasestome ); parameters addrs the addresses to remove duplicates from.
nsIMsgProtocolInfo
showcom
posemsglink boolean true if com
pose ui actions should be enabled for the account type.
nsINavHistoryQueryOptions
this is because sorting by title requires us to sort after using locale-sensetive sorting (as op
posed to letting the database do it for us).
Component; nsIPrefBranch
these cycles generally occur because an object both registers itself as an observer (causing the branch to hold a reference to the observer) and holds a reference to the branch object for the pur
pose of getting/setting preference values.
nsIPrefBranch2
these cycles generally occur because an object both registers itself as an observer (causing the branch to hold a reference to the observer) and holds a reference to the branch object for the pur
pose of getting/setting preference values.
nsIProfileLock
localdirectory nsilocalfile a directory corresponding to the main profile directory, which exists for the pur
pose of storing data on the local filesystem, including cache files or other data files that may not represent critical user data.
nsIScriptError
that subclass offered the nsiscripterror.initwithwindowid() method for that pur
pose; that method is now available in this interface, however.
nsIStreamConverter
inherits from: nsistreamlistener last changed in gecko 1.7 sup
pose you had code that converted plain text into html.
nsISupportsPriority
xpcom/threads/nsisupportspriority.idlscriptable this interface ex
poses the general notion of a scheduled object with an integral priority value.
nsITaskbarWindowPreview
this interface's primary pur
pose is to let gecko applications take control over parts of the preview; however, certain parts of the preview are not controlled using this interface.
nsITelemetry
see also bug 649502 - ex
pose 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 ...
nsITransport
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 ex
posed by this interface).
nsIURI
inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) see the following rfcs for details: rfc3490: internationalizing domain names in applications (idna) rfc3986: uniform resource identifier (uri): generic syntax rfc3987: internationalized resource identifiers subclasses of nsiuri, such as nsiurl, im
pose further structure on the uri.
nsIURIFixup
methods createexposableuri() converts an internal uri (for example a wysiwyg uri) into one which we can ex
pose to the user, for example on the url bar.
nsIURL
obsolete since gecko 9.0 note: this was removed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) because the semicolon is not actually valid for this pur
pose and should not have been specially handled.
nsIURLFormatter
toolkit/components/urlformatter/public/nsiurlformatter.idlscriptable this interface ex
poses methods to substitute variables in url formats.
nsIUploadChannel
history here is that we need to support both streams that already have headers (for example, content-type and content-length) information prepended to the stream (by plugins) as well as clients (com
poser, uploading application) that want to upload data streams without any knowledge of protocol specifications.
nsIWeakReference
do not hold on to the produced interface permanently; that would defeat the pur
pose of using a non-owning nsiweakreference in the first place.
nsIWebNavigationInfo
docshell/base/nsiwebnavigationinfo.idlscriptable ex
poses a way to get information on the capabilities of gecko web navigation objects.
Events
com
pose-send-message a message gets sent com
pose-window-close a com
pose window gets closed com
pose-window-init a com
pose window has been opened com
pose-window-reopen a cached com
pose window has been reopened.
LDAP Support
mail com
pose typedown in mail com
pose, when typing a partial mail address, a typedown window appears listing possible matches against address books and ldap directories.
MailNews fakeserver
there are added in alphabetical order, which may help for pur
poses that rely on article key orders.
The libmime module
pizzarro <rhp@netscape.com> this module, libmime, implements a general-pur
pose mime parser.
Thunderbird API documentation
activity manager address book sync client design buddy icons in mail composition composition back end in mail cached com
pose window faq filelink providers new!
Create Custom Column
the customdbheaders preference article provides information on a preference setting that ex
poses custom header data for use in a custom column within thunderbird's main view.
Using JS in Mozilla code
arraybuffer.transfer() pro
posed for es2016 no, nightly-only for now sharedarraybuffer, sharedint8array..., atomics pro
posed for es2016 no, nightly-only for now typedobject pro
posed for es2016 no, nightly-only for now simd pro
posed for es2016 no, nightly-only for now ...
Using Objective-C from js-ctypes
*/ // struct is seen here in docs: http://clang.llvm.org/docs/block-abi-apple.html var block_literal_1 = ctypes.structtype('block_literal_1', [ { isa: ctypes.voidptr_t }, { flags: ctypes.int32_t }, { reserved: ctypes.int32_t }, { invoke: ctypes.voidptr_t }, { descriptor: block_descriptor_1.ptr } ]); var block_const = { block_has_copy_dis
pose: 1 << 25, block_has_ctor: 1 << 26, block_is_global: 1 << 28, block_has_stret: 1 << 29, block_has_signature: 1 << 30 }; // based on work from here: https://github.com/trueinteractions/tint2/blob/f6ce18b16ada165b98b07869314dad1d7bee0252/modules/bridge/core.js#l370-l394 var bl = block_literal_1(); // set the class of the instance bl.isa = _nsconcreteglobalblock; // global flags bl.f...
Declaring types
primitive types primitive types are those types that represent a single value in memory, as op
posed to arrays, structures, or functions.
Memory - Plugins
for example, sup
pose that the plug-in calls newgworld, and that the call fails because of insufficient memory.
Plug-in Basics - Plugins
<param name="pluginspage" value="http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash"/> </object> </object> </object> </p></body> </html> the outermost object element defines the classid; the first nested object uses the type value application/x-shockwave-flash to load the adobe flash plug-in, and the innermost object ex
poses a download page for users that do not already have the necessary plug-in.
Scripting plugins - Plugins
how the dom handles scripting the mozilla dom code now checks if a plugin supports this new scriptability api and if it ex
poses a scriptable object through this new mechanism.
Index - Firefox Developer Tools
3 accessibility inspector accessibility, accessibility inspector, devtools, guide, tools the accessibility inspector provides a means to access important information ex
posed to assistive technologies on the current page via the accessibility tree, allowing you to check what's missing or otherwise needs attention.
Network monitor recording - Firefox Developer Tools
this is useful in situations where, for example, you are trying to get a stable view of a page for debugging pur
poses, but under normal circumstances the view keeps evolving due to persistent network requests.
Style Editor - Firefox Developer Tools
from firefox 33 onwards, the key binding preference is ex
posed in the editor preferences section of the developer tools settings, and you can set it there instead of about:config.
The JavaScript input interpreter - Firefox Developer Tools
(): you can pass the iframe dom element: var frame = document.getelementbyid("frame1"); cd(frame); you can pass a css selector that matches the iframe: cd("#frame1"); you can pass the iframe's global window object: var frame = document.getelementbyid("frame1"); cd(frame.contentwindow); to switch the context back to the top-level window, call cd() with no arguments: cd(); for example, sup
pose we have a document that embeds an iframe: <!doctype html> <html> <head> <meta charset="utf-8"> </head> <body> <iframe id="frame1" src="static/frame/my-frame1.html"></iframe> </body> </html> the iframe defines a new function: <!doctype html> <html> <head> <meta charset="utf-8"> <script> function whoareyou() { return "i'm frame1"; } </script> </...
Animation.pause() - Web APIs
var nommingcake = document.getelementbyid('eat-me_sprite').animate( [ { transform: 'translatey(0)' }, { transform: 'translatey(-80%)' } ], { fill: 'forwards', easing: 'steps(4, end)', duration: alicechange.effect.timing.duration / 2 }); // doesn't actually need to be eaten until a click event, so pause it initially: nommingcake.pause(); additionally, when resetting : // an all-pur
pose function to pause the animations on alice, the cupcake, and the bottle that reads "drink me." var stopplayingalice = function() { alicechange.pause(); nommingcake.pause(); drinking.pause(); }; // when the user releases the cupcake or the bottle, pause the animations.
Attr.localName - Web APIs
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 op
posed to xhtml attributes in xml doms).
BaseAudioContext.createAnalyser() - Web APIs
the createanalyser() method of the baseaudiocontext interface creates an analysernode, which can be used to ex
pose audio time and frequency data and create data visualisations.
BaseAudioContext - Web APIs
baseaudiocontext.createanalyser() creates an analysernode, which can be used to ex
pose audio time and frequency data and for example to create data visualisations.
Blob - Web APIs
click the link to see the decoded object url.</p> javascript the main piece of this code for example pur
poses is the typedarraytourl() function, which creates a blob from the given typed array and returns an object url for it.
Bluetooth.getDevices() - Web APIs
the getdevices() method of bluetooth interface of web bluetooth api ex
poses the bluetooth devices this origin is allowed to access.
Body - Web APIs
properties body.body read only a simple getter used to ex
pose a readablestream of the body contents.
Cache - Web APIs
note that the cache interface is ex
posed to windowed scopes as well as workers.
DOMImplementation - Web APIs
this function is unreliable and kept for compatibility pur
pose alone: except for svg-related queries, it always returns true.
Document.execCommand() - Web APIs
when an html document has been switched to designmode, its document object ex
poses an execcommand method to run commands that manipulate the current editable region, such as form inputs or contenteditable elements.
Document.getElementById() - Web APIs
note that the id parameter is case-sensitive, so document.getelementbyid("main") will return null instead of the element <div id="main"> because "m" and "m" are different for the pur
poses of this method.
Document.requestStorageAccess() - Web APIs
grant the document access to cookies and other site storage and store that fact for the pur
poses of future calls to document.hasstorageaccess() and requeststorageaccess().
EXT_float_blend - Web APIs
this ensures that content written before ext_float_blend was ex
posed by webgl will function as expected.
EXT_sRGB - Web APIs
constants this extension ex
poses the following constants, which can be used in the teximage2d(), texsubimage2d(), renderbufferstorage() and getframebufferattachmentparameter() methods.
EffectTiming.fill - Web APIs
px; padding-bottom: 4px; color: white; background-color: darkgreen; font: 14px "open sans", "arial", sans-serif; } #text { width: 160px; padding: 10px; position: relative; text-align: center; align-self: center; color: white; font: bold 2em "lucida grande", "open sans", sans-serif; } while there's other css involved in this example, the part that really matters for our pur
poses is the css that styles the "box" element that we'll be animating.
Element.innerHTML - Web APIs
<div class="box"> <div><strong>log:</strong></div> <div class="log"></div> </div> the <div> with the class "box" is just a container for layout pur
poses, presenting the contents with a box around it.
Element.localName - Web APIs
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 op
posed to xhtml elements in xml doms).
Element - Web APIs
element.computedname read only returns a domstring containing the label ex
posed to accessibility.
Event() - Web APIs
com
posed optional a boolean indicating whether the event will trigger listeners outside of a shadow root (see event.com
posed for more details).
Event.currentTarget - Web APIs
it always refers to the element to which the event handler has been attached, as op
posed to event.target, which identifies the element on which the event occurred and which may be its descendant.
Event.preventDefault() - Web APIs
it's not an elegant function but does the job for the pur
poses 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); } ...
FederatedCredential - Web APIs
a federated identity provider is an entity that a website trusts to correctly authenticate a user, and that provides an api for that pur
pose.
Using Fetch - Web APIs
this is not ex
posed to the web, but it affects which mutation operations are allowed on the headers object.
FileSystem.name - Web APIs
this usvstring is unique among all file systems currently ex
posed by the file and directory entries api.
HTMLDocument - Web APIs
cs/web/api/htmldocument" target="_top"><rect x="386" y="1" width="120" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="446" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldocument</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} for the pur
poses of web development, you can generally think of htmldocument as an alias for document, upon which htmldocument is based.
HTMLElement: beforeinput event - Web APIs
bubbles yes cancelable yes interface inputevent event handler property none sync / async sync com
posed yes default action update the dom element examples this example logs current value of the element immediately before replacing that value with the new one applied to the <input> element.
inert - Web APIs
according to the spec: when a node is inert, then the user agent must act as if the node was absent for the pur
poses of targeting user interaction events, may ignore the node for the pur
poses of text search user interfaces (commonly known as "find in page"), and may prevent the user from selecting text in that node.
HTMLElement - Web APIs
htmlelement.inert is a boolean indicating whether the user agent must act as though the given node is absent for the pur
poses of user interaction events, in-page text searches ("find in page"), and text selection.
HTMLKeygenElement - Web APIs
the <keygen> elements ex
pose the htmlkeygenelement interface, which provides special properties and methods (beyond the regular element object interface they also have available to them by inheritance) for manipulating the layout and presentation of keygen elements.
HTMLLIElement - Web APIs
the htmllielement interface ex
poses specific properties and methods (beyond those defined by regular htmlelement interface it also has available to it by inheritance) for manipulating list elements.
HTMLMediaElement.play() - Web APIs
exceptions the promise's rejection handler is called with an exception name passed in as its sole input parameter (as op
posed to a traditional exception being thrown).
HTMLMeterElement - Web APIs
the html <meter> elements ex
pose the htmlmeterelement interface, which provides special properties and methods (beyond the htmlelement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <meter> elements.
HTMLPreElement - Web APIs
the htmlpreelement interface ex
poses specific properties and methods (beyond those of the htmlelement interface it also has available to it by inheritance) for manipulating a block of preformatted text (<pre>).
HTMLTableElement - Web APIs
htmltableelement.summary is a domstring containing a description of the pur
pose or the structure of the table.
The HTML DOM API - Web APIs
html dom target audience the features ex
posed by the html dom are among the most commonly-used apis in the web developer's arsenal.
Location - Web APIs
examples // create anchor element and use href property for the pur
pose of this example // a more correct alternative is to browse to the url and use document.location or window.location var url = document.createelement('a'); url.href = 'https://developer.mozilla.org:8080/search?q=url#search-results-close-container'; console.log(url.href); // https://developer.mozilla.org:8080/search?q=url#search-results-close-container console.log(url.protocol); // https: cons...
MediaDeviceInfo.groupId - Web APIs
this might be used to produce a user interface that gathers associated devices together for presentation pur
poses, or to make it easy for the user to choose to use the built-in camera and microphone on the same display at the same time.
MediaDevices - Web APIs
getdisplaymedia() prompts the user to select a display or portion of a display (such as a window) to capture as a mediastream for sharing or recording pur
poses.
MediaQueryList.onchange - Web APIs
the event object is a mediaquerylistevent instance, which is recognised as a medialistquery instance in older browsers, for backwards compatibility pur
poses.
MediaQueryList.removeListener() - Web APIs
this is basically an alias for eventtarget.removeeventlistener(), for backwards compatibility pur
poses — in older browsers you could use removeeventlistener() instead.
MediaStreamAudioSourceNode - Web APIs
track ordering for the pur
poses of the mediastreamtrackaudiosourcenode interface, the order of the audio tracks on the stream is determined by taking the tracks whose kind is audio, then sorting the tracks by their id property's values, in unicode code point order (essentially, in alphabetical or lexicographical order, for ids which are simple alphanumeric strings).
MediaTrackConstraints.latency - Web APIs
in most cases, low latency is desirable for performance and user experience pur
poses, but when power consumption is a concern, or delays are otherwise acceptable, higher latency might be acceptable.
MediaTrackSettings.groupId - Web APIs
however, it can be used to ensure that audio input and output are both being performed on the same headset, for example, or to ensure that the built-in camera and microphone on a phone are being used for video conferencing pur
poses.
MessagePort: message event - Web APIs
bubbles no cancelable no interface messageevent event handler property onmessage examples sup
pose 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.postmessa...
MessagePort: messageerror event - Web APIs
bubbles no cancelable no interface messageevent event handler property onmessageerror examples sup
pose 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); ...
Metadata - Web APIs
specifications specification status comment file and directory entries api draft draft of pro
posed api this api has no official w3c or whatwg specification.
Microdata DOM API - Web APIs
microdata becomes even more useful when scripts can use it to ex
pose information to the user, for example offering it in a form that can be used by other applications.
MouseEvent.clientX - Web APIs
the clientx read-only property of the mouseevent interface provides the horizontal coordinate within the application's client area at which the event occurred (as op
posed to the coordinate within the page).
MouseEvent.clientY - Web APIs
the clienty read-only property of the mouseevent interface provides the vertical coordinate within the application's client area at which the event occurred (as op
posed to the coordinate within the page).
Navigator.battery - Web APIs
the battery read-only property returns a batterymanager which provides information about the system's battery charge level and whether the device is charging and ex
poses events that fire when these parameters change.
Navigator.credentials - Web APIs
the credentials property of the navigator interface returns the credentialscontainer interface, which ex
poses methods to request credentials.
Navigator.getBattery() - Web APIs
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 ex
pose battery information to insecure contexts and this method was called from insecure context.
Navigator.mediaCapabilities - Web APIs
the navigator.mediacapabilities read-only property returns a mediacapabilities object that can ex
pose information about the decoding and encoding capabilities for a given format and output capabilities as defined by the media capabilities api.
NavigatorPlugins.plugins - Web APIs
(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 ex
poses a small interface for getting information about the various plugins installed in your browser.
Node.localName - Web APIs
he 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 op
posed to xhtml elements in xml doms).
RTCOutboundRtpStreamStats.pliCount - Web APIs
however, the primary pur
pose of a pli packet is to allow the rtcrtpsender for which this rtcoutboundrtpstreamstats object provides statistics to consider techniques to mitigate network performance issues.
RTCPeerConnection.close() - Web APIs
all rtcrtpsender objects are considered to be stopped once this returns (they may still be in the process of stopping, but for all intents and pur
poses, they're stopped).
RTCPeerConnection.setRemoteDescription() - Web APIs
answer); }) .then(function() { // send the answer to the remote peer using the signaling server }) .catch(handlegetusermediaerror); } after creating our rtcpeerconnection and saving it as mypeerconnection, we pass the description included in the received offer message, msg, directly into setremotedescription() to tell the user agent's webrtc layer what configuration the caller has pro
posed using.
RTCPeerConnection - Web APIs
ise, and should then be sent to the source of the offer to continue the negotiation process.createdatachannel() the createdatachannel() method on the rtcpeerconnection interface creates a new channel linked with the remote peer, over which any kind of data may be transmitted.createoffer()the createoffer() method of the rtcpeerconnection interface initiates the creation of an sdp offer for the pur
pose of starting a new webrtc connection to a remote peer.generatecertificate()the generatecertificate() method of the rtcpeerconnection interface creates and stores an x.509 certificate and corresponding private key then returns an rtccertificate, providing access to it.getconfiguration() the rtcpeerconnection.getconfiguration() method returns an rtcconfiguration object which indicates the current c...
RTCPeerConnectionIceErrorEvent - Web APIs
properties the rtcpeerconnectioniceerrorevent interface includes the properties found on the event interface, as well as the following properties: address read only a domstring providing the local ip address used to communicate with the stun or turn server being used to negotiate the connection, or null if the local ip address has not yet been ex
posed as part of a local ice candidate.
RTCRtpSender.replaceTrack() - Web APIs
examples switching video cameras // example to change video camera, sup
pose selected value saved into window.selectedcamera navigator.mediadevices .getusermedia({ video: { deviceid: { exact: window.selectedcamera } } }) .then(function(stream) { let videotrack = stream.getvideotracks()[0]; pcs.foreach(function(pc) { var sender = pc.getsenders().find(function(s) { return s.track.kind == videotrack.kind; }); ...
RTCRtpStreamStats - Web APIs
their primary pur
pose is to examine the error resiliency of the connection, as they provide information about lost packets, lost frames, and how heavily compressed the data is.
Reporting API - Web APIs
the reporting api's pur
pose is to provide a consistent reporting mechanism that can be used to make such information available to developers in the form of reports represented by javascript objects.
Request.destination - Web APIs
the destination is used by the user agent to, for example, help determine which set of rules to follow for cors pur
poses, or how to navigate any complicated code paths that affect how specific types of request get handled.
Request - Web APIs
request implements body, so it also inherits the following properties: body read only a simple getter used to ex
pose a readablestream of the body contents.
Response.error() - Web APIs
note: an "error" response never really gets ex
posed to script: such a response to a fetch() would reject the promise.
SVGAngle - Web APIs
every svgangle object operates in one of two modes: reflect the base value of a reflected animatable attribute (being ex
posed through the baseval member of an svganimatedangle), be detached, which is the case for svgangle objects created with svgsvgelement.createsvgangle().
SVGGraphicsElement - Web APIs
the svggraphicselement interface represents svg elements whose primary pur
pose is to directly render graphics into a group.
SVGMatrix - Web APIs
many of svg's graphics operations utilize 2x3 matrices of the form: [a c e] [b d f] which, when expanded into a 3x3 matrix for the pur
poses of matrix arithmetic, become: [a c e] [b d f] [0 0 1] an svgmatrix object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.
Screen.availHeight - Web APIs
since screen is ex
posed on the window interface's window.screen property, you access availheight using window.screen.availheight.
Sensor APIs - Web APIs
the sensor apis are a set of interfaces built to a common design that ex
pose device sensors in a consistent way to the web platform.
ServiceWorkerContainer - Web APIs
most importantly, it ex
poses 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.
ServiceWorkerGlobalScope - Web APIs
the service worker can optionally send a response back via the messageport ex
posed in event.data.port, corresponding to the controlled page.
SpeechRecognitionEvent.emma - Web APIs
the exact contents can vary across user agents and recognition engines, but all supporting implementations will ex
pose a valid xml document complete with an emma namespace.
StorageEstimate - Web APIs
these values are only estimates for several reasons, including both performance and preventing storage capacity data from being used for fingerprinting pur
poses.
Using readable streams - Web APIs
bytestreams will be covered separately in a future tutorial, as they are somewhat different in pur
pose and use case to regular (default) streams.
SubtleCrypto.unwrapKey() - Web APIs
the inverse of unwrapkey() is subtlecrypto.wrapkey(): while unwrapkey is com
posed of decrypt + import, wrapkey is com
posed of encrypt + export.
SubtleCrypto.wrapKey() - Web APIs
the inverse of wrapkey() is subtlecrypto.unwrapkey(): while wrapkey is com
posed of export + encrypt, unwrapkey is com
posed of import + decrypt.
Text.wholeText - Web APIs
syntax str = textnode.wholetext; notes and example sup
pose 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!
TextRange - Web APIs
selection compatibility the document.selection object is the primary pur
pose of textrange.
TextTrack - Web APIs
texttrack.label read only a human-readable domstring which contains the text track's label, if one is present; otherwise, this is an empty string (""), in which case a custom label may need to be generated by your code using other attributes of the track, if the track's label needs to be ex
posed to the user.
TimeRanges - Web APIs
the timeranges interface is used to represent a set of time ranges, primarily for the pur
pose of tracking which portions of media have been buffered when loading it for use by the <audio> and <video> elements.
Touch events - Web APIs
alternatively, some frameworks have taken to refiring touch events as mouse events for this same pur
pose.
TrackEvent() - Web APIs
com
posed optional a boolean indicating whether or not the event will trigger listeners outside of a shadow root; see event.com
posed for more details.
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 ex
posed to the web platform in any way, and so the sourcecapabilities of a resize event will typically be null.
USBDevice.deviceClass - Web APIs
the deviceclass read only property of the usbdevice interface one of three properties that identify usb devices for the pur
pose of loading a usb driver that will work with that device.
USBDevice.deviceClass - Web APIs
the deviceclass read only property of the usbdevice interface one of three properties that identify usb devices for the pur
pose of loading a usb driver that will work with that device.
USBDevice.deviceProtocol - Web APIs
the deviceprotocol read only property of the usbdevice interface one of three properties that identify usb devices for the pur
pose of loading a usb driver that will work with that device.
USBDevice.deviceSubclass - Web APIs
the devicesubclass read only property of the usbdevice interface one of three properties that identify usb devices for the pur
pose of loading a usb driver that will work with that device.
WEBGL_debug_renderer_info - Web APIs
the webgl_debug_renderer_info extension is part of the webgl api and ex
poses two constants with information about the graphics driver for debugging pur
poses.
WEBGL_debug_shaders - Web APIs
the webgl_debug_shaders extension is part of the webgl api and ex
poses a method to debug shaders from privileged contexts.
WEBGL_lose_context - Web APIs
the webgl_lose_context extension is part of the webgl api and ex
poses functions to simulate losing and restoring a webglrenderingcontext.
WakeLock - Web APIs
the system wake lock is ex
posed through the global navigator.wakelock property.
Data in WebGL - Web APIs
glsl data types <<document the basic types, vectors, etc; see data type (glsl) on the khronos webgl wiki>> glsl variables there are three kinds of "variable" or data storage available in glsl, each of which with its own pur
pose and use cases: attributes, varyings, and uniforms.
Matrix math for the web - Web APIs
transformation = rotate * translate * scale composing multiple transformations the function that we will be using to com
pose our matrices is multiplyarrayofmatrices(), which is part of the set of utility functions introduced near the top of this article.
WebRTC API - Web APIs
webrtc concepts and usage webrtc serves multiple pur
poses; together with the media capture and streams api, they provide powerful multimedia capabilities to the web, including support for audio and video conferencing, file exchange, screen sharing, identity management, and interfacing with legacy telephone systems including support for sending dtmf (touch-tone dialing) signals.
WebXR application life cycle - Web APIs
if your scene is complex, you should consider creating a worker—or using one that you've previously created for this pur
pose—to perform the computations needed for each frame to be rendered.
Starting up and shutting down a WebXR session - Web APIs
start rendering the scene referencespace = await worlddata.session.requestreferencespace("unbounded"); worlddata.referencespace = referencespace.getoffsetreferencespace( new xrrigidtransform(worlddata.playerspawnposition, worlddata.playerspawnorientation)); worlddata.animationframerequestid = worlddata.session.requestanimationframe(ondrawframe); return worlddata; } for the pur
poses of this example, an object named worlddata gets created to encapsulate data about the world and rendering environment.
Web Animations API Concepts - Web APIs
(see animating like you just don’t care with element.animate.) in some instances, it may negate the need for a fully fledged library entirely in the same way vanilla javascript can be used without jquery for many pur
poses.
Web Audio API best practices - Web APIs
if you have buttons that switch audio on and off, using the aria role="switch" attribute on them is a good option for signalling to assistive technology what the button's exact pur
pose is, and therefore making the app more accessible.
Example and tutorial: Simple synth keyboard - Web APIs
function setup() { notefreq = createnotetable(); volumecontrol.addeventlistener("change", changevolume, false); mastergainnode = audiocontext.creategain(); mastergainnode.connect(audiocontext.destination); mastergainnode.gain.value = volumecontrol.value; // create the keys; skip any that are sharp or flat; for // our pur
poses we don't need them.
Web Authentication API - Web APIs
credentialscontainer ex
poses methods to request credentials and notify the user agent when events such as successful sign in or sign out happen.
Using the Web Speech API - Web APIs
speechrecognition.onnomatch seems to be sup
posed to handle the first case mentioned, although note that at the moment it doesn't seem to fire correctly; it just returns whatever was recognised anyway: recognition.onnomatch = function(event) { diagnostic.textcontent = 'i didnt recognise that color.'; } speechrecognition.onerror handles cases where there is an actual error with the recognition successfully — the speechrecognitionerror.erro...
Window.console - Web APIs
these methods are intended for debugging pur
poses only and should not be relied on for presenting information to end users.
Window.crypto - Web APIs
syntax var cryptoobj = window.crypto || window.mscrypto; // for ie 11 value an instance of the crypto interface, providing access to general-pur
pose cryptography and a strong random-number generator.
Window.getComputedStyle() - Web APIs
however, the two objects have different pur
poses: the object from getcomputedstyle is read-only, and should be used to inspect the element's style — including those set by a <style> element or an external stylesheet.
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 ex
posed on the global scope.
Window: message event - Web APIs
bubbles no cancelable no interface messageevent event handler property onmessage examples sup
pose 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.addeventlis...
Obsolete features - Web APIs
forcing fullscreen onto other users is also extremely unpopular and is considered an outright rude attempt to im
pose web author's viewing preferences onto users.
Window.performance - Web APIs
syntax performancedata = window.performance; value a performance object offering access to the performance and timing-related information offered by the apis it ex
poses.
window.postMessage() - Web APIs
the arguments passed to window.postmessage() (i.e., the “message”) are ex
posed to the receiving window through the event object.
Window - Web APIs
a global variable, window, representing the window in which the script is running, is ex
posed to javascript code.
Worker() - Web APIs
name: a domstring specifying an identifying name for the dedicatedworkerglobalscope representing the scope of the worker, which is mainly useful for debugging pur
poses.
WorkerGlobalScope - Web APIs
this change was made to stop close() being available on service workers, as it isn't sup
posed to be used there and always throws an exception when called (see bug 1336043).
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 ex
pose the origin and user credentials when fetching resources.
XRInputSource.targetRayMode - Web APIs
function updateinputsources(session, frame, refspace) { for (let source of session.getinputsources()) { let targetray
pose = frame.get
pose(inputsource.targetrayspace, refspace); if (targetray
pose) { if (source.targetraymode == "tracked-pointer") { myrendertargetrayasbeam(targetray
pose); } } /* ...
XRInputSourceArray.entries() - Web APIs
specification status comment webxr device apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface definition causes entries(), foreach(), keys(), and values() methods to be ex
posed from objects that implement the interface.
XRInputSourceArray.forEach() - Web APIs
specification status comment webxr device apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface definition causes entries(), foreach(), keys(), and values() methods to be ex
posed from objects that implement the interface.
XRInputSourceArray.keys() - Web APIs
specification status comment webxr device apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface definition causes entries(), foreach(), keys(), and values() methods to be ex
posed from objects that implement the interface.
XRInputSourceArray.values() - Web APIs
specification status comment webxr device apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface definition causes entries(), foreach(), keys(), and values() methods to be ex
posed from objects that implement the interface.
XRInputSourceEvent() - Web APIs
xrsession.addeventlistener("select", event => { let targetray
pose = event.frame.get
pose(event.inputsource.targetrayspace, myrefspace); if (targetray
pose) { let hit = myhittest(targetray
pose.transform); if (hit) { /* handle the hit */ } } }); specifications specification status comment webxr device apithe definition of 'xrinputsourceevent' in that specification.
XRSession.onselect - Web APIs
xrsession.onselect = event => { let source = event.inputsource; if (source.handedness == user.handedness) { if (source.targetraymode == "tracked-pointer") { let targetray
pose = event.frame.get
pose(source.targetrayspace, myrefspace); if (targetray
pose) { myhandleselectwithray(targetray
pose); } } } }; specifications specification status comment webxr device apithe definition of 'xrsession.onselect' in that specification.
XRSession.onsqueezeend - Web APIs
xrsession.onsqueezeend = event => { if (event.inputsource.handedness == user.handedness) { let targetray
pose = event.frame.get
pose(event.inputsource.targetrayspace, myrefspace; if (user.heldobject) { cancelobjectdrag(user.heldobject); } } }; this code presumes that if the user actually intentionally completed the drag, user.heldobject will be null here.
XRSession.onsqueezestart - Web APIs
xrsession.onsqueezestart = event => { if (event.inputsource.handedness == user.handedness) { let targetray
pose = event.frame.get
pose(event.inputsource.targetrayspace, myrefspace; if (targetray
pose) { user.heldobject = findobjectusingray(targetray
pose.transform); } } }; specifications specification status comment webxr device apithe definition of 'xrsession.onsqueezestart' in that specification.
XRSpace - Web APIs
numeric values such as
pose positions are thus coordinates in the corresponding xrspace, relative to that space's origin.
XRTargetRayMode - Web APIs
function updateinputsources(session, frame, refspace) { for (let source of session.getinputsources()) { let targetray
pose = frame.get
pose(inputsource.targetrayspace, refspace); if (targetray
pose) { if (source.targetraymode == "tracked-pointer") { myrendertargetrayasbeam(targetray
pose); } } /* ...
XSLTProcessor - Web APIs
properties non-web-ex
posed properties the following properties are [chromeonly] and not ex
posed to web content: [chromeonly] attribute unsigned long xsltprocessor.flags flags that tweak the behavior of the processor.
Web APIs
venttarget xmlhttprequestresponsetype xmlserializer xpathevaluator xpathexception xpathexpression xpathnsresolver xpathresult xrboundedreferencespace xrenvironmentblendmode xreye xrframe xrframerequestcallback xrhandedness xrinputsource xrinputsourcearray xrinputsourceevent xrinputsourceeventinit xrinputsourceschangeevent xrinputsourceschangeeventinit xrpermissiondescriptor xrpermissionstatus xr
pose xrreferencespace xrreferencespaceevent xrreferencespaceeventinit xrreferencespacetype xrrenderstate xrrenderstateinit xrrigidtransform xrsession xrsessionevent xrsessioneventinit xrsessioninit xrsessionmode xrspace xrsystem xrtargetraymode xrview xrviewer
pose xrviewport xrvisibilitystate xrwebgllayer xrwebgllayerinit xsltprocessor ...
ARIA live regions - Accessibility
aria live regions fill this gap and provide a way to programmatically ex
pose dynamic content changes in a way that can be announced by assistive technologies.
Using the alert role - Accessibility
possible effects on user agents and assistive technology when the alert role is added to an element, or such an element becomes visible, the user agent should do the following: ex
pose the element as having an alert role in the operating system's accessibility api.
Using the article role - Accessibility
possible effects on user agents and assistive technology when the user navigates an element assigned the role of article, assistive technologies that typically intercept standard keyboard events should switch to document browsing mode, as op
posed to passing keyboard events through to the web application.
Using the group role - Accessibility
possible effects on user agents and assistive technology when the group role is added to an element, or such an element becomes visible, the user agent should do the following: ex
pose the element as having a group role in the operating system's accessibility api.
Using the link role - Accessibility
possible effects on user agents and assistive technology when the link role is added to an element, or such an element becomes visible, the user agent should do the following: ex
pose the element as having a link role in the operating system's accessibility api.
Using the log role - Accessibility
possible effects on user agents and assistive technology when the log role is added to an element, or such an element becomes visible, the user agent should do the following: ex
pose the element as having a log role in the operating system's accessibility api.
Using the presentation role - Accessibility
for example, a table used for layout pur
poses could have the presentation role applied to the table element to remove any semantic meaning from the table element and any of its table related children elements, such as table headers and table data elements.
Using the status role - Accessibility
possible effects on user agents and assistive technology when the status role is added to an element, or such an element becomes visible, the user agent should do the following: ex
pose the element as having a status role in the operating system's accessibility api.
ARIA: grid role - Accessibility
even though both data grids and layout grids employ the same aria roles, states, and properties, differences in their content and pur
pose surface factors that are important to consider in keyboard interaction design.
ARIA: List role - Accessibility
so, the li elements are not ex
posed to assistive technologies, but elements contained inside of those li elements, including nested lists, are visible to assistive technologies.
ARIA: Mark role - Accessibility
the mark landmark role semantically denotes html elements containing text that is marked/highlighted for reference pur
poses.
ARIA: tab role - Accessibility
parent .queryselectorall('[role="tabpanel"]') .foreach(p => p.setattribute("hidden", true)); // show the selected panel grandparent.parentnode .queryselector(`#${target.getattribute("aria-controls")}`) .removeattribute("hidden"); } best practices it is recommended to use a button element with the role tab for their built-in functional and accessible features instead, as op
posed to needing to add them yourself.
Basic form hints - Accessibility
<button aria-describedby="descriptionrevert">revert</button> <div id="descriptionrevert">reverting will undo any changes that have been made since the last save.</div> note: the aria-describedby attribute is used for other pur
poses, in addition to form controls.
Web accessibility for seizures and physical reactions - Accessibility
because of this condition, their brain will produce seizure-like discharges when ex
posed to this type of visual stimulation gamma oscillations and photosensitive epilepsy current biology volume 27, issue 9, 8 may 2017, pages r336-r338 certain visual images, even in the absence of motion or flicker, can trigger seizures in patients with photosensitive epilepsy.
Robust - Accessibility
when using semantic elements correctly for their intended pur
pose, this criterion should be passed automatically.
Understandable - Accessibility
this is essential for pur
poses like making sure the reader has arrived at a page written in a language suitable for them.
unicode-range - CSS: Cascading Style Sheets
description the pur
pose of this descriptor is to allow the font resources to be segmented so that a browser only needs to download the font resource needed for the text content of a particular page.
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
our bigger item ends up bigger because it started from a bigger size, even though it has the same amount of spare space assigned to it as the others: if what you actually want is three equally-sized items, even if they start out at different sizes, you should use this: flex: 1 1 0; here we are saying that the size of the item for the pur
poses of our space distribution calculation is 0 — all the space is up for grabs and as all of the items have the same flex-grow factor, they each get an equal amount of space distributed.
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
for the pur
poses of box generation and layout, the element must be treated as if it had been replaced with its children and pseudo-elements in the document tree.” this value of display controls box generation, and whether the element should generate a box that we can style and see on the page, or whether instead the box it would normally create should be removed and the child elements essentially moved up to...
OpenType font features guide - CSS: Cascading Style Sheets
in addition to broad feature sets like ligatures or lining figures (numerals that line up evenly as op
posed to 'oldstyle', which look more like lower-case letters), there are also very specific ones such as stylistic sets (which might include several specific variants of glyphs meant to be used together), alternates (which might be one or more variants of the letter 'a'), or even language-specific alterations for east asian languages.
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
for the pur
poses of box generation and layout, the element must be treated as if it had been replaced with its children and pseudo-elements in the document tree.” if you set an item to display: contents the box it would normally create disappears, and the boxes of the child elements appear as if they have risen up a level.
Implementing image sprites in CSS - CSS: Cascading Style Sheets
implementation sup
pose an image is given to every item with class toolbtn: .toolbtn { background: url(myfile.png); display: inline-block; height: 20px; width: 20px; } a background position can be added either as two x, y values after the url()() in the background, or as background-position.
Using CSS transitions - CSS: Cascading Style Sheets
you can control the individual components of the transition with the following sub-properties: (note that these transitions loop infinitely only for the pur
pose of our examples; css transitions only visualize a property change from start to finish.
CSS Writing Modes - CSS: Cascading Style Sheets
reference properties direction glyph-orientation-horizontal text-combine-upright text-orientation unicode-bidi writing-mode specifications specification status comment css writing modes module level 3 pro
posed recommendation css level 2 (revision 1) recommendation css level 1 recommendation initial definition ...
align-content - CSS: Cascading Style Sheets
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 im
posed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container along the cross axis.
align-self - CSS: Cascading Style Sheets
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 im
posed 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.
box-align - CSS: Cascading Style Sheets
notes the edge of the box designated the start for alignment pur
poses depends on the box's orientation: horizontal top vertical left the edge opposite to the start is designated the end.
box-direction - CSS: Cascading Style Sheets
notes the edge of the box designated the start for layout pur
poses depends on the box's orientation: horizontal left vertical top the edge opposite to the start is designated the end.
box-pack - CSS: Cascading Style Sheets
notes the edge of the box designated the start for packing pur
poses 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.
color-adjust - CSS: Cascading Style Sheets
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 pur
poses.
<color> - CSS: Cascading Style Sheets
these system colors are ex
posed by the following keywords, which can be used to ensure that the rest of the page integrates well with the restricted palette.
<display-inside> - CSS: Cascading Style Sheets
these keywords are used as values of the display property, and can be used for legacy pur
poses as a single keyword, or as defined in the level 3 specification alongside a value from the <display-outside> keywords.
<display-outside> - CSS: Cascading Style Sheets
these keywords are used as values of the display property, and can be used for legacy pur
poses as a single keyword, or as defined in the level 3 specification alongside a value from the <display-inside> keywords.
flex - CSS: Cascading Style Sheets
description for most pur
poses, authors should set flex to one of the following values: auto, initial, none, or a positive unitless number.
font-size - CSS: Cascading Style Sheets
in order to calculate the em equivalent for any pixel value required, you can use this formula: em = desired element pixel value / parent element font-size in pixels for example, sup
pose the font-size of the body of the page is set to 16px.
<integer> - CSS: Cascading Style Sheets
during the css3 values cycle there was a lot of discussion about setting a minimum range to support: the latest decision, in april 2012 during the lc phase, was [-227-1; 227-1], but other values like 224-1 and 230-1 were also pro
posed.
justify-content - CSS: Cascading Style Sheets
stretch if the combined size of the items along the main axis is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints im
posed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container along the main axis.
justify-items - CSS: Cascading Style Sheets
stretch if the combined size of the items 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 im
posed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container.
justify-self - CSS: Cascading Style Sheets
stretch if the combined size of the items 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 im
posed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container.
place-content - CSS: Cascading Style Sheets
stretch if the combined size of the items 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 im
posed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container formal definition initial valuenormalapplies tomulti-line flex containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'align-content'> <'justify-content'>?
place-items - CSS: Cascading Style Sheets
stretch if the combined size of the items 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 im
posed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container.
place-self - CSS: Cascading Style Sheets
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 im
posed 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.
repeat() - CSS: Cascading Style Sheets
for the pur
pose of finding the number of auto-repeated tracks, the user agent floors the track size to a user agent specified value (e.g., 1px), to avoid division by zero.
<transform-function> - CSS: Cascading Style Sheets
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 com
pose, most common transformations: rotations, scaling, or skewing.
Getting Started - Developer guides
httprequest = new xmlhttprequest(); } else if (window.activexobject) { // ie 6 and older httprequest = new activexobject("microsoft.xmlhttp"); } note: for illustration pur
poses, the above is a somewhat simplified version of the code to be used for creating an xmlhttp instance.
Audio and Video Delivery - Developer guides
other tips for audio/video stopping the download of media while stopping the playback of media is as easy as calling the element's pause() method, the browser keeps downloading the media until the media element is dis
posed of through garbage collection.
<hgroup> - HTML: Hypertext Markup Language
however, given that a key pur
pose 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.
<input type="checkbox"> - HTML: Hypertext Markup Language
value the value attribute is one which all <input>s share; however, it serves a special pur
pose for inputs of type checkbox: when a form is submitted, only checkboxes which are currently checked are submitted to the server, and the reported value is the value of the value attribute.
<input type="radio"> - HTML: Hypertext Markup Language
value the value attribute is one which all <input>s share; however, it serves a special pur
pose for inputs of type radio: when a form is submitted, only radio buttons which are currently checked are submitted to the server, and the reported value is the value of the value attribute.
<input type="search"> - HTML: Hypertext Markup Language
" id="mysearch" name="q" placeholder="search the site..."> <button>search</button> </div> </form> you can see how the placeholder is rendered below: search form labels and accessibility one problem with search forms is their accessibility; a common design practice is not to provide a label for the search field (although there might be a magnifying glass icon or similar), as the pur
pose of a search form is normally fairly obvious for sighted users due to placement (this example shows a typical pattern).
<input type="time"> - HTML: Hypertext Markup Language
tional 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 pur
poses 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.
<table>: The Table element - HTML: Hypertext Markup Language
</td> </tr> </table> <p>simple table with caption</p> <table> <caption>awesome caption</caption> <tr> <td>awesome data</td> </tr> </table> table { border-collapse: collapse; border-spacing: 0px; } table, th, td { padding: 5px; border: 1px solid black; } accessibility concerns captions by supplying a <caption> element whose value clearly and concisely describes the table's pur
pose, it helps the people decide if they need to read the rest of the table content or skip over it.
<textarea> - HTML: Hypertext Markup Language
the above example demonstrates a number of features of <textarea>: an id attribute to allow the <textarea> to be associated with a <label> element for accessibility pur
poses a name attribute to set the name of the associated data point submitted to the server when the form is submitted.
<var>: The Variable element - HTML: Hypertext Markup Language
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 pur
poses rather than semantic pur
poses, you should either use a <span> with appropriate css or, an appropriate semantic element among the following: <em> <i> <q> default style most browsers apply font-style to "italic" when rendering <var>.
class - HTML: Hypertext Markup Language
though the specification doesn't put requirements on the name of classes, web developers are encouraged to use names that describe the semantic pur
pose of the element, rather than the presentation of the element.
Preloading content with rel="preload" - HTML: Hypertext Markup Language
other resource preloading mechanisms other preloading features exist, but none are quite as fit for pur
pose as <link rel="preload">: <link rel="prefetch"> has been supported in browsers for a long time, but it is intended for prefetching resources that will be used in the next navigation/page load (e.g.
Data URLs - HTTP
syntax data urls are com
posed of four parts: a prefix (data:), a mime type indicating the type of data, an optional base64 token if non-textual, and the data itself: data:[<mediatype>][;base64],<data> the mediatype is a mime type string, such as 'image/jpeg' for a jpeg image file.
Evolution of HTTP - HTTP
since 2005, the set of apis available to web pages greatly increased and several of these apis created extensions, mostly new specific http headers, to the http protocol for specific pur
poses: server-sent events, where the server can push occasional messages to the browser.
Compression in HTTP - HTTP
engineers designed the optimized compression algorithm used by file formats designed for this specific pur
pose.
Content negotiation - HTTP
over the years, other content negotiation proposals, like transparent content negotiation and the alternates header, have been pro
posed.
Feature Policy - HTTP
this allows you to lock in best practices, even as the codebase evolves over time — as well as to more safely com
pose third-party content — by limiting which features are available.
Content-Encoding - HTTP
the http/1.1 standard also recommends that the servers supporting this content-encoding should recognize x-gzip as an alias, for compatibility pur
poses.
ETag - HTTP
etags are therefore similar to fingerprints, and might also be used for tracking pur
poses by some servers.
Forwarded - HTTP
this header is used for debugging, statistics, and generating location-dependent content and by design it ex
poses privacy sensitive information, such as the ip address of the client.
Server-Timing - HTTP
rver-timing: missedcache // single metric with value server-timing: cpu;dur=2.4 // single metric with description and value server-timing: cache;desc="cache read";dur=23.2 // two metrics with value server-timing: db;dur=53, app;dur=47.2 // server-timing as trailer trailer: server-timing --- response body --- server-timing: total;dur=123.4 privacy and security the server-timing header may ex
pose potentially sensitive application and infrastructure information.
Server - HTTP
however, ex
posed apache versions helped browsers work around a bug those versions had with content-encoding combined with range.
Set-Cookie - HTTP
browsers block frontend javascript code from accessing the set cookie header, as required by the fetch spec, which defines set-cookie as a forbidden response-header name that must be filtered out from any response ex
posed to frontend code.
Transfer-Encoding - HTTP
the http/1.1 standard also recommends that the servers supporting this content-encoding should recognize x-gzip as an alias, for compatibility pur
poses.
Vary - HTTP
directives * each request for a url is sup
posed to be treated as a unique and uncacheable request.
X-Forwarded-For - HTTP
this header is used for debugging, statistics, and generating location-dependent content and by design it ex
poses privacy sensitive information, such as the ip address of the client.
X-Forwarded-Host - HTTP
this header is used for debugging, statistics, and generating location-dependent content and by design it ex
poses privacy sensitive information, such as the ip address of the client.
POST - HTTP
ary="boundary" --boundary content-disposition: form-data; name="field1" value1 --boundary content-disposition: form-data; name="field2"; filename="example.txt" value2 --boundary-- specifications specification title rfc 7231, section 4.3.3: post hypertext transfer protocol (http/1.1): semantics and content rfc 2046, section 5.1.1: common syntax multipur
pose internet mail extensions (mime) part two: media types ...
A re-introduction to JavaScript (JS tutorial) - JavaScript
calling var bill = trivialnew(person, 'william', 'orange'); is therefore almost equivalent to var bill = new person('william', 'orange'); apply() has a sister function named call, which again lets you set this but takes an expanded argument list as op
posed to an array.
Control flow and error handling - JavaScript
while it is common to throw numbers or strings as errors, it is frequently more effective to use one of the exception types specifically created for this pur
pose: ecmascript exceptions domexception and domerror throw statement use the throw statement to throw an exception.
Numbers and dates - JavaScript
these methods use integers to represent these values as follows: seconds and minutes: 0 to 59 hours: 0 to 23 day: 0 (sunday) to 6 (saturday) date: 1 to 31 (day of the month) months: 0 (january) to 11 (december) year: years since 1900 for example, sup
pose you define the following date: var xmas95 = new date('december 25, 1995'); then xmas95.getmonth() returns 11, and xmas95.getfullyear() returns 1995.
Regular expression syntax cheatsheet - JavaScript
for example, /e?le?/ matches the "el" in "angel" and the "le" in "angle." if used immediately after any of the quantifiers *, +, ?, or {}, makes the quantifier non-greedy (matching the minimum number of times), as op
posed to the default, which is greedy (matching the maximum number of times).
Quantifiers - JavaScript
for example, /e?le?/ matches the "el" in "angel" and the "le" in "angle." if used immediately after any of the quantifiers *, +, ?, or {}, makes the quantifier non-greedy (matching the minimum number of times), as op
posed to the default, which is greedy (matching the maximum number of times).
Regular expressions - JavaScript
writing a regular expression pattern a regular expression pattern is com
posed of simple characters, such as /abc/, or a combination of simple and special characters, such as /ab*c/ or /chapter (\d+)\.\d*/.
JavaScript language resources - JavaScript
ascript 2019 language specification ecma-262 9th edition pdf, html, working draft, repository 2018 ecmascript 2018 language specification ecma-402 5th edition working draft, repository 2018 ecmascript 2018 internationalization api specification obsolete/historical editions ecma-262 pdf june 1997 ecmascript: a general pur
pose, cross-platform programming language.
Public class fields - JavaScript
both public and private field declarations are an experimental feature (stage 3) pro
posed at tc39, the javascript standards committee.
Classes - JavaScript
class rectangle { constructor(height, width) { this.height = height; this.width = width; } } static (class-side) data properties and prototype data properties must be defined outside of the classbody declaration: rectangle.staticwidth = 20; rectangle.prototype.prototypewidth = 25; field declarations public and private field declarations are an experimental feature (stage 3) pro
posed at tc39, the javascript standards committee.
TypeError: "x" is not a constructor - JavaScript
examples invalid cases var car = 1; new car(); // typeerror: car is not a constructor new math(); // typeerror: math is not a constructor new symbol(); // typeerror: symbol is not a constructor function* f() {}; var obj = new f; // typeerror: f is not a constructor a car constructor sup
pose you want to create an object type for cars.
Functions - JavaScript
like the program itself, a function is com
posed of a sequence of statements called the function body.
Array.prototype.forEach() - JavaScript
let words = ['one', 'two', 'three', 'four'] words.foreach((word) => { console.log(word) if (word === 'two') { words.shift() //'one' will delete from array } }) // one // two // four console.log(words); //['two', 'three', 'four'] flatten an array the following example is only here for learning pur
pose.
Array.prototype.reverse() - JavaScript
description the reverse method trans
poses the elements of the calling array object in place, mutating the array, and returning a reference to the array.
WeakSet - JavaScript
weaksets are ideal for this pur
pose: // execute a callback on everything stored inside an object function execrecursively(fn, subject, _refs = null){ if(!_refs) _refs = new weakset(); // avoid infinite recursion if(_refs.has(subject)) return; fn(subject); if("object" === typeof subject){ _refs.add(subject); for(let key in subject) execrecursively(fn, subject[key], _refs); } } const foo = { foo: "foo", bar: {...
WebAssembly.Module.customSections() - JavaScript
(read high level structure for information on section structures, and how normal sections ("known sections") and custom sections are distinguished.) this provides developers with a way to include custom data inside wasm modules for other pur
poses, for example the name custom section, which allows developers to provide names for all the functions and locals in the module (like "symbols" in a native build).
encodeURIComponent() - JavaScript
the encodeuricomponent() function encodes a uri by replacing each instance of certain characters by one, two, three, or four escape sequences representing the utf-8 encoding of the character (will only be four escape sequences for characters com
posed of two "surrogate" characters).
undefined - JavaScript
var x; if (x === undefined) { // these statements execute } else { // these statements do not execute } note: the strict equality operator (as op
posed to the standard equality operator) must be used here, because x == undefined also checks whether x is null, while strict equality doesn't.
new.target - JavaScript
examples new.target in function calls in normal function calls (as op
posed to constructor function calls), new.target is undefined.
for...in - JavaScript
it may be most practically used for debugging pur
poses, being an easy way to check the properties of an object (by outputting to the console or otherwise).
Strict mode - JavaScript
yet because of its historical functionality, arguments.caller for a strict mode function is also a non-deletable property which throws when set or retrieved: 'use strict'; function fun(a, b) { 'use strict'; var v = 12; return arguments.caller; // throws a typeerror } fun(1, 2); // doesn't ex
pose v (or a or b) paving the way for future ecmascript versions future ecmascript versions will likely introduce new syntax, and strict mode in ecmascript 5 applies some restrictions to ease the transition.
categories - Web app manifests
type array of strings mandatory no the categories member is an array of strings defining the names of categories that the application sup
posedly belongs to.
<semantics> - MathML
the rules of determining the visible child in a <semantics> element are the following: if no rule other rule applies: by default only the first child is rendered, which is sup
posed to be presentation markup.
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 sup
posed to be rendered by the mathml parser (see bug 276028).
OpenSearch description format
note: for icons loaded remotely (that is, from https:// uris as op
posed to data: uris), firefox will reject icons larger than 10 kilobytes.
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 pur
poses.
Mobile first - Progressive web apps (PWAs)
therefore we should try to simplify things on mobile, keeping each view cut down to a single, simple pur
pose where possible, and reducing the amount of typing users are expected to do.
display - SVG: Scalable Vector Graphics
it has implications for the <tspan>, <tref>, and <altglyph> elements, event processing, for bounding box calculations and for calculation of clipping paths: if display is set to none on a <tspan>, <tref>, or <altglyph> element, then the text string is ignored for the pur
poses of text layout.
<feConvolveMatrix> - SVG: Scalable Vector Graphics
to illustrate, sup
pose you have a input image which is 5 pixels by 5 pixels, whose color values for one of the color channels are as follows: 0 20 40 235 235 100 120 140 235 235 200 220 240 235 235 225 225 255 255 255 225 225 255 255 255 and you define a 3-by-3 convolution kernel as follows: 1 2 3 4 5 6 7 8 9 let's focus on the color value at the second row and second column of the image (source pixel value i...
SVG as an Image - SVG: Scalable Vector Graphics
many browsers support svg images in: html <img> or <svg> elements css background-image gecko-specific contexts additionally, gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) introduced support for using svg in these contexts: css list-style-image css content svg <image> element svg <feimage> element canvas drawimage function restrictions for security pur
poses, gecko places some restrictions on svg content when it's being used as an image: javascript is disabled.
Positions - SVG: Scalable Vector Graphics
a quote from the svg 1.1 specification illustrates this: [...] sup
pose that the user agent can determine from its environment that "1px" corresponds to "0.2822222mm" (i.e., 90dpi).
Mixed content - Web security
the risk involved with mixed content does depend on the type of website the user is visiting and how sensitive the data ex
posed to that site may be.
Secure contexts - Web security
sources 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 ex
posed on the global scope.
How to turn off form autocompletion - Web security
note that the wcag 2.1 success criterion 1.3.5: identify input pur
pose does not require that autocomplete/autofill actually work - merely that form fields that relate to specific personal user information are programmatically identified.
Subresource Integrity - Web security
<script src="https://example.com/example-framework.js" integrity="sha384-oqvuafxrkap7fdgccy5uykm6+r9gqq8k/uxy9rx7hnqlgyl1kpzqho1wx4jwy8wc" crossorigin="anonymous"></script> note: for more details on the pur
pose of the crossorigin attribute, see cors settings attributes.
XPath snippets - XPath
this article provides some xpath code snippets—simple examples of how to a few simple utility functions based on standard interfaces from the dom level 3 xpath specification that ex
pose xpath functionality to javascript code.